/*! aliyun webrtc sdk - ver 1.17.2 created:2022/4/18 下午3:48:44 */ !function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=105)}([function(e,t,r){"use strict";(function(n){var i,o,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(r,n){"object"===s(t)?e.exports=t=n():(o=[],i=n,void 0!==(a="function"==typeof i?i.apply(t,o):i)&&(e.exports=a))}(0,function(){var e=e||function(e,t){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==n&&n.crypto&&(i=n.crypto),!i)try{i=r(167)}catch(e){}var o=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),s={},c=s.lib={},u=c.Base=function(){return{extend:function(e){var t=a(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),l=c.WordArray=u.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[n+o>>>2]|=a<<24-(n+o)%4*8}else for(var s=0;s>>2]=r[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=u.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new l.init(r,t/2)}},h=d.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new l.init(r,t)}},p=d.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},_=c.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,i=n.words,o=n.sigBytes,a=this.blockSize,s=4*a,c=o/s;c=t?e.ceil(c):e.max((0|c)-this._minBufferSize,0);var u=c*a,d=e.min(4*u,o);if(u){for(var f=0;f>>2];e.sigBytes-=t}},v=(n.BlockCipher=d.extend({cfg:d.cfg.extend({mode:p,padding:m}),reset:function(){var e;d.reset.call(this);var t=this.cfg,r=t.iv,n=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=n.createEncryptor:(e=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(n,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),n.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),y=r.format={},g=y.OpenSSL={stringify:function(e){var t,r=e.ciphertext,n=e.salt;return t=n?o.create([1398893684,1701076831]).concat(n).concat(r):r,t.toString(c)},parse:function(e){var t,r=c.parse(e),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(t=o.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),v.create({ciphertext:r,salt:t})}},b=n.SerializableCipher=i.extend({cfg:i.extend({format:g}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),o=i.finalize(t),a=i.cfg;return v.create({ciphertext:o,key:r,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),S=r.kdf={},k=S.OpenSSL={execute:function(e,t,r,n){n||(n=o.random(8));var i=l.create({keySize:t+r}).compute(e,n),a=o.create(i.words.slice(t),4*r);return i.sigBytes=4*t,v.create({key:i,iv:a,salt:n})}},w=n.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:k}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=n.kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var o=b.encrypt.call(this,e,t,i.key,n);return o.mixIn(i),o},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,b.decrypt.call(this,e,t,i.key,n)}})}()})},function(e,t,r){"use strict";(function(e){var r,n,i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};/*! useragent-util - ver 1.1.3 created:2022/3/3 下午5:14:09 */ !function(a,s){if("object"==o(t)&&"object"==o(e))e.exports=s();else{n=[],r=s,void 0!==(i="function"==typeof r?r.apply(t,n):r)&&(e.exports=i)}}(self,function(){return function(){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{}};return t[n](i,i.exports,e),i.exports}var t={622:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserUtil=t.BrowserType=void 0;var n,i=r(101);!function(e){e.IE="IE",e.Chrome="Chrome",e.Safari="Safari",e.Firefox="Firefox",e.Opera="Opera",e.Edge="Edge",e.MicroMessenger="MicroMessenger",e.X5Core="X5Core",e.Quark="Quark",e.QQ="QQ",e.QQBrowser="QQBrowser",e.DingTalk="DingTalk",e.Electron="Electron",e.Sogou="Sogou",e.Vivo="VivoBrowser",e.Oppo="OppoBrowser",e.UC="UCBrowser",e.MI="MiBrowser",e.Lenovo="SLBrowser",e.Maxthon="Maxthon",e.Liebao="Liebao",e.Huawei="Huawei",e.Meizu="MZBrowser",e.Finger="FingerBrowser",e.Unknown="unknown"}(n=t.BrowserType||(t.BrowserType={}));var o=function(){function e(){}return Object.defineProperty(e,"isBrowser",{get:function(){return"undefined"!=typeof document},enumerable:!1,configurable:!0}),Object.defineProperty(e,"domain",{get:function(){return window.location.protocol+window.location.host},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isHttps",{get:function(){return this.isBrowser&&document.location&&("https:"==document.location.protocol||0===document.location.host.indexOf("127.0.0.1:")||0===document.location.host.indexOf("localhost:"))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isSupportScreenShare",{get:function(){return!!(navigator&&navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isChrome",{get:function(){return e._getBrowserInfo(),n.Chrome===e._browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isSafari",{get:function(){return e._getBrowserInfo(),n.Safari===e._browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isIE",{get:function(){return e._getBrowserInfo(),n.IE===e._browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isFirefox",{get:function(){return e._getBrowserInfo(),n.Firefox===e._browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isEdge",{get:function(){return e._getBrowserInfo(),n.Edge===e.browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isSogou",{get:function(){return e._getBrowserInfo(),n.Sogou===e.browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isVivoBroswer",{get:function(){return e._getBrowserInfo(),n.Vivo===e.browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isOppoBrowser",{get:function(){return e._getBrowserInfo(),n.Oppo===e.browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isMiBrowser",{get:function(){return e._getBrowserInfo(),n.MI===e.browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isLenovoBrowser",{get:function(){return e._getBrowserInfo(),n.Lenovo===e.browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isMaxthonBrowser",{get:function(){return e._getBrowserInfo(),n.Maxthon===e.browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isLiebaoBrowser",{get:function(){return e._getBrowserInfo(),n.Liebao===e.browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isHuaweiBrowser",{get:function(){return e._getBrowserInfo(),n.Huawei===e.browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isMZBrowser",{get:function(){return e._getBrowserInfo(),n.Meizu===e._browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isOpera",{get:function(){return e._getBrowserInfo(),n.Opera===e._browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isMicroMessenger",{get:function(){return e._getBrowserInfo(),e._browserName===n.MicroMessenger},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isQQ",{get:function(){return e._getBrowserInfo(),n.QQ===e.browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isQQBrowser",{get:function(){return e._getBrowserInfo(),n.QQBrowser===e.browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isX5Core",{get:function(){return e._getBrowserInfo(),e._browserName===n.X5Core},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isUCBrowser",{get:function(){return e._getBrowserInfo(),e._browserName===n.UC},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isQuarkBrowser",{get:function(){return e._getBrowserInfo(),e._browserName===n.Quark},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isFingerBrowser",{get:function(){return e._getBrowserInfo(),e._browserName===n.Finger},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isChromeCore",{get:function(){return e._getBrowserInfo(),"Chrome"===e._core},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isDingTalk",{get:function(){return e._getBrowserInfo(),e._browserName===n.DingTalk},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isUnknown",{get:function(){return e._getBrowserInfo(),n.Unknown===e.browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"browserName",{get:function(){return e._getBrowserInfo(),e._browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"browserVersion",{get:function(){return e._getBrowserInfo(),e._browserVersion},enumerable:!1,configurable:!0}),Object.defineProperty(e,"browserMainVersion",{get:function(){return e._getBrowserInfo(),e._browserVersion?parseInt(e._browserVersion.split(".")[0],10):0},enumerable:!1,configurable:!0}),Object.defineProperty(e,"browserCoreVersion",{get:function(){return navigator.userAgent.toLowerCase(),i.SystemUtil.isIos||i.SystemUtil.isMacOS,e.browserMainVersion},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isElectron",{get:function(){return e._getBrowserInfo(),n.Electron===e.browserName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"userAgent",{get:function(){var e=navigator.userAgent.toLowerCase(),t=e.indexOf("gecko");if(t>-1){t=e.indexOf(" ",t);var r=(e=e.substring(t+1,e.length)).split(" ");e="";for(var n=0;no)return!0}return!0}return!0},e._getBrowserInfo=function(){if(!e._browserName||!e._browserVersion)if(navigator&&navigator.userAgent){var t=navigator.userAgent.toLowerCase(),r=void 0;(r=t.match(/edg[e|a]?\/([\d.]+)/))||(r=t.match(/edgios\/([\d.]+)/))?e._updateBrowserInfo(n.Edge,t,r[1]):(r=t.match(/rv:([\d.]+)\) like gecko/))||(r=t.match(/msie ([\d.]+)/))?e._updateBrowserInfo(n.IE,t,r[1]):(r=t.match(/vivobrowser\/([\d.]+)/))?e._updateBrowserInfo(n.Vivo,t,r[1]):(r=t.match(/miuibrowser\/([\d.]+)/))?e._updateBrowserInfo(n.MI,t,r[1]):(r=t.match(/heytapbrowser\/([\d.]+)/))?e._updateBrowserInfo(n.Oppo,t,r[1]):(r=t.match(/mzbrowser\/([\d.]+)/))?e._updateBrowserInfo(n.Meizu,t,r[1]):(r=t.match(/ucbrowser\/([\d.]+)/))?e._updateBrowserInfo(n.UC,t,r[1]):(r=t.match(/quark\/([\d.]+)/))?e._updateBrowserInfo(n.Quark,t,r[1]):(r=t.match(/slbrowser\/([\d.]+)/))?e._updateBrowserInfo(n.Lenovo,t,r[1]):(r=t.match(/lbbrowser\/([\d.]+)/))?e._updateBrowserInfo(n.Liebao,t,r[1]):(r=t.match(/fingerbrowser\/([\d.]+)/))?e._updateBrowserInfo(n.Finger,t,r[1]):(r=t.match(/huaweibrowser\/([\d.]+)/))?e._updateBrowserInfo(n.Huawei,t,r[1]):(r=t.match(/maxthon\/([\d.]+)/))?e._updateBrowserInfo(n.Maxthon,t,r[1]):(r=t.match(/firefox\/([\d.]+)/))?e._updateBrowserInfo(n.Firefox,t,r[1]):(r=t.match(/electron\/([\d.]+)/))?e._updateBrowserInfo(n.Electron,t,r[1]):(r=t.match(/chrome\/([\d.]+)/))&&this._isChrome(t)||(r=t.match(/crios\/([\d.]+)/))&&this._isChrome(t)?e._updateBrowserInfo(n.Chrome,t,r[1]):(r=t.match(/metasr\s([\d.]+)/))||(r=t.match(/sogoumobilebrowser\/([\d.]+)/))?e._updateBrowserInfo(n.Sogou,t,r[1]):(r=t.match(/opr.([\d.]+)/))?e._updateBrowserInfo(n.Opera,t,r[1]):(r=t.match(/micromessenger.([\d.]+)/))?e._updateBrowserInfo(n.MicroMessenger,t,r[1]):(r=t.match(/qq\/([\d.]+)/))?e._updateBrowserInfo(n.QQ,t,r[1]):(r=t.match(/m?qqbrowser\/([\d.]+)/))||(r=t.match(/qqbrowserlite\/([\d.]+)/))?e._updateBrowserInfo(n.QQBrowser,t,r[1]):(r=t.match(/dingtalk.([\d.]+)/))?e._updateBrowserInfo(n.DingTalk,t,r[1]):(r=t.match(/tbs\/([\d.]+)/))?e._updateBrowserInfo(n.X5Core,t,r[1]):(r=t.match(/version\/([\d.]+).*safari/))&&this._isSafari(t)&&e._updateBrowserInfo(n.Safari,t,r[1])}else e._browserName=n.Unknown,e._browserVersion="0.0"},e._isChrome=function(t){var r=t.split(/\(|\)/);if(e._core="Chrome",5===r.length){var n=r[4].trim().split(" ");if(2===n.length){if(n[0].indexOf("chrome")>-1&&n[1].indexOf("safari")>-1)return!0}else if(3===n.length){if(n[1].indexOf("mobile")>-1&&n[2].indexOf("safari")>-1&&(n[0].indexOf("chrome")>-1||n[0].indexOf("crios")>-1))return!0}else if(t.indexOf("qianniu")>-1)return!0}else if(t.indexOf("dingtalk")>-1)return!0;return!1},e._isSafari=function(e){var t=e.split(/\(|\)/);if(5===t.length){var r=t[4].trim().split(" ");if(2===r.length){if(r[0].indexOf("version")>-1&&r[1].indexOf("safari")>-1)return!0}else if(3===r.length&&r[0].indexOf("version")>-1&&r[1].indexOf("mobile")>-1&&r[2].indexOf("safari")>-1)return!0}return!1},e._updateBrowserInfo=function(t,r,o){e._browserName=t;var a=null;switch(t){case n.QQBrowser:i.SystemUtil.isIos||i.SystemUtil.isMacOS?(a=r.match(/version\/([\d.]+).*safari/),e._browserVersion=a?a[1]:"0.0"):(a=r.match(/chrome\/([\d.]+)/),e._browserVersion=a?a[1]:"0.0");break;case n.Vivo:case n.Oppo:case n.Meizu:case n.Huawei:case n.Sogou:a=r.match(/chrome\/([\d.]+)/),e._browserVersion=a?a[1]:"0.0";break;default:e._browserVersion=o}},e._browserName=n.Unknown,e._browserVersion="",e._core="",e}();t.BrowserUtil=o},864:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Guid=void 0;var r=function(){function e(){}return e.create=function(e,t){void 0===t&&(t=16);var r,n,i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[];if(t=t||i.length,e)for(r=0;r-1},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isIos",{get:function(){return r.Iphone===e.systemName||r.Ipad===e.systemName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isAndroid",{get:function(){return r.Android===e.systemName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isLinux",{get:function(){return r.Linux===e.systemName||r.Linux===e._platform},enumerable:!1,configurable:!0}),Object.defineProperty(e,"systemName",{get:function(){return e._getSystemInfo(),e._systemName},enumerable:!1,configurable:!0}),Object.defineProperty(e,"systemVersion",{get:function(){return e._getSystemInfo(),e._systemVersion},enumerable:!1,configurable:!0}),Object.defineProperty(e,"platform",{get:function(){return e._getSystemInfo(),e._platform},enumerable:!1,configurable:!0}),Object.defineProperty(e,"isUnknown",{get:function(){return!e.platform||e.platform===r.Unknown},enumerable:!1,configurable:!0}),e.compareVersion=function(t){if(e._getSystemInfo(),e._systemVersion){for(var r=e._systemVersion.split("."),n=t.split("."),i=0,o=0,a=0;ao)return!0}return!0}return!0},e._getSystemInfo=function(){if(!e._systemName||!e._systemVersion||!e._platform)if(navigator&&navigator.userAgent){var t=navigator.userAgent.toLowerCase();t.indexOf("ipad")>-1?(e._systemName=r.Ipad,e._platform=r.iOS,e._systemVersion=e._getIosSystemVersion(t)):t.indexOf("iphone")>-1?(e._systemName=r.Iphone,e._platform=r.iOS,e._systemVersion=e._getIosSystemVersion(t)):t.indexOf("android")>-1?(e._platform=r.Android,e._systemName=r.Android,e._systemVersion=e._getAndroidSystemVersion(t)):t.indexOf("win")>-1?t.indexOf("windwos nt 10")>-1||t.indexOf("windows 10")?(e._systemName=n.Windows10,e._platform=r.Windows,e._systemVersion="10"):t.indexOf("windows nt 6.1")>-1||t.indexOf("windows 7")>-1?(e._systemName=n.Windows7,e._platform=r.Windows,e._systemVersion="7"):t.indexOf("windows nt 6.0")>-1||t.indexOf("windows vista")>-1?(e._systemName=n.WindowsVista,e._platform=r.Windows,e._systemVersion="vista"):t.indexOf("widows nt 5.1")>-1||t.indexOf("windows xp")>-1?(e._systemName=n.WindowsXP,e._platform=r.Windows,e._systemVersion="xp"):(e._platform=r.Windows,e._systemName=r.Windows,e._systemVersion="0.0"):t.indexOf("mac")>-1?navigator&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0?(e._systemName=r.Ipad,e._platform=r.iOS,e._systemVersion=e._getIosSystemVersion(t)):(e._platform=r.MacOS,e._systemName=r.MacOS,e._systemVersion=e._getMacSystemVersion(t)):t.indexOf("linux")>-1?(e._platform=r.Linux,e._systemName=r.Linux,e._systemVersion="0.0"):t.indexOf("cros")>-1?(e._platform=r.Linux,e._systemName=r.ChromeOS,e._systemVersion="0.0"):(e._systemName=r.Unknown,e._platform=r.Windows,e._systemVersion="0.0")}else e._systemName=r.Unknown,e._platform=r.Unknown,e._systemVersion="0.0"},e._getIosSystemVersion=function(e){return(e.match(/OS [\d._]*/gi)+"").replace(/[^0-9|_.]/gi,"").replace(/_/gi,".")},e._getMacSystemVersion=function(e){return(e.match(/OS X [\d._]*/gi)+"").replace(/[^0-9|_.]/gi,"").replace(/_/gi,".")},e._getAndroidSystemVersion=function(e){return e.substr(e.indexOf("android")+8,e.indexOf(";",e.indexOf("android"))-e.indexOf("android")-8)},e._systemName="",e._systemVersion="",e._platform=r.Unknown,e}();t.SystemUtil=i}},r={},n={};return function(){var t=n;Object.defineProperty(t,"__esModule",{value:!0}),t.ApiRequest=t.LocalStorage=t.Guid=t.BrowserUtil=t.SystemUtil=void 0;var r=e(101);Object.defineProperty(t,"SystemUtil",{enumerable:!0,get:function(){return r.SystemUtil}});var i=e(622);Object.defineProperty(t,"BrowserUtil",{enumerable:!0,get:function(){return i.BrowserUtil}});var o=e(864);Object.defineProperty(t,"Guid",{enumerable:!0,get:function(){return o.Guid}});var a=e(442);Object.defineProperty(t,"LocalStorage",{enumerable:!0,get:function(){return a.LocalStorage}});var s=e(72);Object.defineProperty(t,"ApiRequest",{enumerable:!0,get:function(){return s.ApiRequest}}),window&&(window.SystemUtil=r.SystemUtil,window.BrowserUtil=i.BrowserUtil,window.Guid=o.Guid,window.LocalStorage=a.LocalStorage,window.ApiRequest=s.ApiRequest)}(),n}()})}).call(t,r(23)(e))},function(e,t,r){"use strict";var n,i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=e.exports=r(14),s=r(62);a.codegen=r(152),a.fetch=r(153),a.path=r(154),a.fs=a.inquire("fs"),a.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n0)e[i]=n(e[i]||{},t,r);else{var o=e[i];o&&(r=[].concat(o).concat(r)),e[i]=r}return e}if("object"!==(void 0===e?"undefined":o(e)))throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return t=t.split("."),n(e,t,r)},Object.defineProperty(a,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(r(44)))}})},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c,u){"object"===a(t)?e.exports=t=c(r(0),r(21),r(22)):(i=[r(0),r(21),r(22)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){return function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,o=t.algo,a=o.MD5,s=o.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,n=this.cfg,o=n.hasher.create(),a=i.create(),s=a.words,c=n.keySize,u=n.iterations;s.length>>6-a%4*2,u=s|c;n[o>>>2]|=u<<24-o%4*8,o++}return i.create(n,o)}var r=e,n=r.lib,i=n.WordArray,o=r.enc;o.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255,s=t[o+1>>>2]>>>24-(o+1)%4*8&255,c=t[o+2>>>2]>>>24-(o+2)%4*8&255,u=a<<16|s<<8|c,l=0;l<4&&o+.75*l>>6*(3-l)&63));var d=n.charAt(64);if(d)for(;i.length%4;)i.push(d);return i.join("")},parse:function(e){var r=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>32-o)+t}function n(e,t,r,n,i,o,a){var s=e+(t&n|r&~n)+i+a;return(s<>>32-o)+t}function i(e,t,r,n,i,o,a){var s=e+(t^r^n)+i+a;return(s<>>32-o)+t}function o(e,t,r,n,i,o,a){var s=e+(r^(t|~n))+i+a;return(s<>>32-o)+t}var a=e,s=a.lib,c=s.WordArray,u=s.Hasher,l=a.algo,d=[];!function(){for(var e=0;e<64;e++)d[e]=4294967296*t.abs(t.sin(e+1))|0}();var f=l.MD5=u.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var a=0;a<16;a++){var s=t+a,c=e[s];e[s]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}var u=this._hash.words,l=e[t+0],f=e[t+1],h=e[t+2],p=e[t+3],_=e[t+4],m=e[t+5],v=e[t+6],y=e[t+7],g=e[t+8],b=e[t+9],S=e[t+10],k=e[t+11],w=e[t+12],C=e[t+13],R=e[t+14],E=e[t+15],T=u[0],O=u[1],P=u[2],A=u[3];T=r(T,O,P,A,l,7,d[0]),A=r(A,T,O,P,f,12,d[1]),P=r(P,A,T,O,h,17,d[2]),O=r(O,P,A,T,p,22,d[3]),T=r(T,O,P,A,_,7,d[4]),A=r(A,T,O,P,m,12,d[5]),P=r(P,A,T,O,v,17,d[6]),O=r(O,P,A,T,y,22,d[7]),T=r(T,O,P,A,g,7,d[8]),A=r(A,T,O,P,b,12,d[9]),P=r(P,A,T,O,S,17,d[10]),O=r(O,P,A,T,k,22,d[11]),T=r(T,O,P,A,w,7,d[12]),A=r(A,T,O,P,C,12,d[13]),P=r(P,A,T,O,R,17,d[14]),O=r(O,P,A,T,E,22,d[15]),T=n(T,O,P,A,f,5,d[16]),A=n(A,T,O,P,v,9,d[17]),P=n(P,A,T,O,k,14,d[18]),O=n(O,P,A,T,l,20,d[19]),T=n(T,O,P,A,m,5,d[20]),A=n(A,T,O,P,S,9,d[21]),P=n(P,A,T,O,E,14,d[22]),O=n(O,P,A,T,_,20,d[23]),T=n(T,O,P,A,b,5,d[24]),A=n(A,T,O,P,R,9,d[25]),P=n(P,A,T,O,p,14,d[26]),O=n(O,P,A,T,g,20,d[27]),T=n(T,O,P,A,C,5,d[28]),A=n(A,T,O,P,h,9,d[29]),P=n(P,A,T,O,y,14,d[30]),O=n(O,P,A,T,w,20,d[31]),T=i(T,O,P,A,m,4,d[32]),A=i(A,T,O,P,g,11,d[33]),P=i(P,A,T,O,k,16,d[34]),O=i(O,P,A,T,R,23,d[35]),T=i(T,O,P,A,f,4,d[36]),A=i(A,T,O,P,_,11,d[37]),P=i(P,A,T,O,y,16,d[38]),O=i(O,P,A,T,S,23,d[39]),T=i(T,O,P,A,C,4,d[40]),A=i(A,T,O,P,l,11,d[41]),P=i(P,A,T,O,p,16,d[42]),O=i(O,P,A,T,v,23,d[43]),T=i(T,O,P,A,b,4,d[44]),A=i(A,T,O,P,w,11,d[45]),P=i(P,A,T,O,E,16,d[46]),O=i(O,P,A,T,h,23,d[47]),T=o(T,O,P,A,l,6,d[48]),A=o(A,T,O,P,y,10,d[49]),P=o(P,A,T,O,R,15,d[50]),O=o(O,P,A,T,m,21,d[51]),T=o(T,O,P,A,w,6,d[52]),A=o(A,T,O,P,p,10,d[53]),P=o(P,A,T,O,S,15,d[54]),O=o(O,P,A,T,f,21,d[55]),T=o(T,O,P,A,g,6,d[56]),A=o(A,T,O,P,E,10,d[57]),P=o(P,A,T,O,v,15,d[58]),O=o(O,P,A,T,C,21,d[59]),T=o(T,O,P,A,_,6,d[60]),A=o(A,T,O,P,k,10,d[61]),P=o(P,A,T,O,h,15,d[62]),O=o(O,P,A,T,b,21,d[63]),u[0]=u[0]+T|0,u[1]=u[1]+O|0,u[2]=u[2]+P|0,u[3]=u[3]+A|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var o=t.floor(n/4294967296),a=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var e=u.clone.call(this);return e._hash=this._hash.clone(),e}});a.MD5=u._createHelper(f),a.HmacMD5=u._createHmacHelper(f)}(Math),e.MD5})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={OnPublisher:"onPublisher",OnMediaStream:"onMediaStream",OnError:"onError",OnUnPublisher:"onUnPublisher",OnLeave:"onLeave",OnJoin:"onJoin",OnBye:"onBye",OnNotify:"onNotify",OnConnecting:"OnConnecting",OnConnected:"OnConnected",OnLiveStream:"onLiveStream",OnUpdateRole:"onUpdateRole",OnAudioLevel:"onAudioLevel",OnMedia:"onMedia",OnDeviceChange:"onDeviceChange",OnNetworkQuality:"onNetworkQuality",OnAudioMixingPlayed:"onAudioMixingPlayed",OnAudioMixingFinished:"onAudioMixingFinished",OnMediaStreamUpdate:"onMediaStreamUpdate",OnPublishChange:"onPublishChange",OnSubscribeChange:"onSubscribeChange",OnAutoPublishFail:"onAutoPublishFail",OnAutoSubscribeFail:"onAutoSubscribeFail",OnShareSystemAudioStart:"onShareSystemAudioStart",OnReconnecting:"onReconnecting",OnReconnectResult:"onReconnectResult"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={MsLabel:"H5streamLabel",SmallVideo:"sophon_video_camera_small",LargeVideo:"sophon_video_camera_large",ScreenShareVideo:"sophon_video_screen_share",SuperVideo:"sophon_video_camera_super",Audio:"sophon_audio"};t.default=n},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r3&&void 0!==arguments[3]&&arguments[3];if(this._checkFunction(t)){void 0===this._eventListener[e]&&(this._eventListener[e]=[]);for(var i=this._eventListener[e],o=0;o3&&void 0!==arguments[3]&&arguments[3];if(this._checkFunction(t)){void 0===this._eventListener[e]?this._eventListener[e]=[]:this._eventListener[e].splice(0);for(var i=this._eventListener[e],o=0;o=0;--n){var i=r[n].func,o=r[n].context;r[n].once&&r.splice(n,1),i.apply(o,e)}}},{key:"_checkFunction",value:function(e){return!(!e||"function"!=typeof e)}}]),e}();t.default=o},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r0)},a.Buffer=function(){try{var e=a.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),a._Buffer_from=null,a._Buffer_allocUnsafe=null,a.newBuffer=function(e){return"number"==typeof e?a.Buffer?a._Buffer_allocUnsafe(e):new a.Array(e):a.Buffer?a._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},a.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,a.Long=a.global.dcodeIO&&a.global.dcodeIO.Long||a.global.Long||a.inquire("long"),a.key2Re=/^true|false|0|1$/,a.key32Re=/^-?(?:0|[1-9][0-9]*)$/,a.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,a.longToHash=function(e){return e?a.LongBits.from(e).toHash():a.LongBits.zeroHash},a.longFromHash=function(e,t){var r=a.LongBits.fromHash(e);return a.Long?a.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},a.merge=n,a.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},a.newError=i,a.ProtocolError=i("ProtocolError"),a.oneOfGetter=function(e){for(var t={},r=0;r-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},a.oneOfSetter=function(e){return function(t){for(var r=0;r=r&&parseInt(n[r],10)}function i(e,t,r){if(e.RTCPeerConnection){var n=e.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(e,n){if(e!==t)return i.apply(this,arguments);var o=function(e){var t=r(e);t&&n(t)};return this._eventMap=this._eventMap||{},this._eventMap[n]=o,i.apply(this,[e,o])};var o=n.removeEventListener;n.removeEventListener=function(e,r){if(e!==t||!this._eventMap||!this._eventMap[r])return o.apply(this,arguments);var n=this._eventMap[r];return delete this._eventMap[r],o.apply(this,[e,n])},Object.defineProperty(n,"on"+t,{get:function(){return this["_on"+t]},set:function(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=!0,s=!0;e.exports={extractVersion:n,wrapPeerConnectionEvent:i,disableLog:function(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":o(e))+". Please use a boolean."):(a=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},disableWarnings:function(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":o(e))+". Please use a boolean."):(s=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))},log:function(){if("object"===("undefined"==typeof window?"undefined":o(window))){if(a)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},deprecated:function(e,t){s&&console.warn(e+" is deprecated, please use "+t+" instead.")},detectBrowser:function(e){var t=e&&e.navigator,r={};if(r.browser=null,r.version=null,void 0===e||!e.navigator)return r.browser="Not a browser.",r;if(t.mozGetUserMedia)r.browser="firefox",r.version=n(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia)r.browser="chrome",r.version=n(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))r.browser="edge",r.version=n(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return r.browser="Not a supported browser.",r;r.browser="safari",r.version=n(t.userAgent,/AppleWebKit\/(\d+)\./,1)}return r}}},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!==(void 0===r?"undefined":i(r)))throw new TypeError(r+"must be non-object");for(var o in r)n(r,o)&&(e[o]=r[o])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var a={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)return void e.set(t.subarray(r,r+n),i);for(var o=0;o>>31}var d=(n<<5|n>>>27)+c+a[u];d+=u<20?1518500249+(i&o|~i&s):u<40?1859775393+(i^o^s):u<60?(i&o|i&s|o&s)-1894007588:(i^o^s)-899497514,c=s,s=o,o=i<<30|i>>>2,i=n,n=d}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),e.SHA1})},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c){"object"===a(t)?e.exports=t=c(r(0)):(i=[r(0)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){!function(){var t=e,r=t.lib,n=r.Base,i=t.enc,o=i.Utf8,a=t.algo;a.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),a=this._iKey=t.clone(),s=i.words,c=a.words,u=0;u1&&(t=1),this._levelt)return!0;return!1},i.isReservedName=function(e,t){if(e)for(var r=0;r0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof i))throw Error("path conflicts with non-namespace objects")}else r.add(r=new i(n))}return t&&r.addJSON(t),r},i.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t-1)return n}else if(n instanceof i&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var o=0;o-1&&this.oneof.splice(t,1),e.partOf=null,this},n.prototype.onAdd=function(e){o.prototype.onAdd.call(this,e);for(var t=this,r=0;r0&&o0&&a=0;){var c=t[a],u=c.indexOf("label:");if(u>0){for(var l=!1,d=0;d0){for(var h=!1,p=0;p-1){u=t[o].split(" ")[0]+" ";for(var d=o;d-1;++d)t[d].indexOf("cname:")>-1?(!0,++o):t[d].indexOf("msid:")>-1?(a=!0,++o):t[d].indexOf("mslabel:")>-1?(s=!0,++o):t[d].indexOf("label")>-1&&(c=!0,++o);if(a||(t.splice(o,0,u+i),++o,++l),!s){var f=i.split(" ")[0];f=f.replace("msid","mslabel"),t.splice(o,0,u+f),++o,++l}c||(t.splice(o,0,u+"label:"+i.split(" ")[1]),++l)}return l}},{key:"maybeSetOpusOptions",value:function(t,r){return"true"===r.opusStereo?t=e.setCodecParam(t,"opus/48000","stereo","1"):"false"===r.opusStereo&&(t=e.removeCodecParam(t,"opus/48000","stereo")),"true"===r.opusFec?t=e.setCodecParam(t,"opus/48000","useinbandfec","1"):"false"===r.opusFec&&(t=e.removeCodecParam(t,"opus/48000","useinbandfec")),"true"===r.opusDtx?t=e.setCodecParam(t,"opus/48000","usedtx","1"):"false"===r.opusDtx&&(t=e.removeCodecParam(t,"opus/48000","usedtx")),r.opusMaxPbr&&(t=e.setCodecParam(t,"opus/48000","maxplaybackrate",r.opusMaxPbr)),t}},{key:"maybeSetAudioSendBitRate",value:function(t,r){return r.audioSendBitrate?e.preferBitRate(t,r.audioSendBitrate,"audio"):t}},{key:"maybeSetAudioReceiveBitRate",value:function(t,r){return r.audioRecvBitrate?(consolog.log("Prefer audio receive bitrate: "+r.audioRecvBitrate),e.preferBitRate(t,r.audioRecvBitrate,"audio")):t}},{key:"maybeSetVideoSendBitRate",value:function(t,r){return r.videoSendBitrate?(cosole.log("Prefer video send bitrate: "+r.videoSendBitrate),e.preferBitRate(t,r.videoSendBitrate,"video")):t}},{key:"maybeSetVideoReceiveBitRate",value:function(t,r){return r.videoRecvBitrate?e.preferBitRate(t,r.videoRecvBitrate,"video"):t}},{key:"preferBitRate",value:function(t,r,n){var i=t.split("\r\n"),o=e.findLine(i,"m=",n);if(null===o)return t;var a=e.findLineInRange(i,o+1,-1,"m=");null===a&&(a=i.length);var s=e.findLineInRange(i,o+1,a,"c=");if(null===s)return t;var c=e.findLineInRange(i,s+1,a,"b=AS");c&&i.splice(c,1);var u="b=AS:"+r;return i.splice(s+1,0,u),t=i.join("\r\n")}},{key:"maybeSetVideoSendInitialBitRate",value:function(t,r){var n=parseInt(r.videoSendInitialBitrate);if(!n)return t;var i=parseInt(n),o=parseInt(r.videoSendBitrate);o&&(n>o&&(n=o,r.videoSendInitialBitrate=n),i=o);var a=t.split("\r\n"),s=e.findLine(a,"m=","video");if(null===s)return t;var c=a[s],u=new RegExp("m=video\\s\\d+\\s[A-Z/]+\\s"),l=c.split(u)[1].split(" ")[0],d=a[e.findLine(a,"a=rtpmap",l)],f=d.split("a=rtpmap:"+l)[1].split("/")[0],h=r.videoSendCodec||f;return t=e.setCodecParam(t,h,"x-google-min-bitrate",r.videoSendInitialBitrate.toString()),t=e.setCodecParam(t,h,"x-google-max-bitrate",i.toString())}},{key:"removePayloadTypeFromMline",value:function(e,t){e=e.split(" ");for(var r=0;r0||e.indexOf("h264")>0)}},{key:"replace42e01fTo42001f",value:function(e){return e}},{key:"supportH264",value:function(e){return-1==e.indexOf("m=video")?-1:e.indexOf("H264")>0||e.indexOf("h264")>0||e.indexOf("H.264")>0||e.indexOf("h.264")>0?1:0}},{key:"needUnifiedSDPPlan",value:function(e){var t=e.indexOf("a=mid:");if(t>-1){var r=e.indexOf("\r",t);-1==r&&(r=e.indexOf("\n",t));var n=e.substring(t+6,r);return-1==n.indexOf("audio")&&-1==n.indexOf("video")}return!1}},{key:"replaceGoogRemb",value:function(e){if(e.indexOf("transport-cc")){for(var t=e.split("\r\n"),r=t.length-1;r>=0;--r)-1!=t[r].indexOf("goog-remb")&&t.splice(r,1);return t.join("\r\n")}return e}},{key:"replaceTransportCC",value:function(e){if(-1!=e.indexOf("goog-remb")){for(var t=e.split("\r\n"),r=t.length-1;r>=0;--r)-1!=t[r].indexOf("transport-cc")&&t.splice(r,1);return t.join("\r\n")}return e}},{key:"addAudioNack",value:function(e){for(var t=e.split("\r\n"),r=0;r=0;--n){if(r&&-1!=t[n].indexOf("m=audio")){t[n]=t[n].replace(r+" ","");break}-1!=t[n].indexOf("red/48000")&&(r=t[n].split(" ")[0].substring(9),0===t[n+1].indexOf("a=fmtp:"+r)?t.splice(n,2):t.splice(n,1))}return t.join("\r\n")}},{key:"supportStereo",value:function(e){for(var t=e.split("\r\n"),r=0;r-1){t[r]+=";stereo=1;sprop-stereo=1;";break}return t.join("\r\n")}},{key:"DEFAULT_SDP_OFFER_OPTIONS",get:function(){return{offerToReceiveAudio:!0,offerToReceiveVideo:!0}}}]),e}());t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={AudioTrackChange:"AudioTrackChange",ScreenTrackEnded:"ScreenTrackEnded",DeviceChange:"DeviceChange",VideoResolutionChange:"VideoResolutionChange",VideoDeivceChange:"VideoDeivceChange"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={ListenerTimeOut:"TimeOut",Publishers:"publishers",UnPublish:"unpublish",Offer:"offer",SignalError:"signalError",Error:"error",Leave:"leave",Join:"join",Bye:"bye",UnSubscribe:"unsubscribe",StatusNotify:"statusnotify",TimeOut:"timeout"};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={evn:"PRODUCT",version:"1.17.1",protocol_version:1,sdk_version:"0.0.1"};t.default=n},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};t=e._getUrl(t,r),n.headers||(n.headers={}),n.headers["Content-Type"]="application/json";var i="";return new Promise(function(r,o){var a=setTimeout(function(){o({code:408,message:"request timeout"})},1e4);e.request("GET",t,n).then(function(e){return i=e,e.ok?e.json():e.text()}).then(function(t){clearTimeout(a),i.ok?t.code?(t=e._intercept(t),o(t)):r(t.data):o(e._httpErrorMessage(i,t))}).catch(function(t){clearTimeout(a),t=e._httpErrorMessage(t),o(t)})})}},{key:"post",value:function(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=e._getUrl(t,r),i.headers||(i.headers={}),i.body=n,i.headers.Accept="application/json",i.headers["Content-Type"]="application/json";var o="";return new Promise(function(r,n){e.request("POST",t,i).then(function(e){return o=e,e.ok?e.json():e.text()}).then(function(t){o.ok?t.code?(t=e._intercept(t),n(t)):r(t.data):n(e._httpErrorMessage(o,t))}).catch(function(t){t=e._httpErrorMessage(t),n(t)})})}},{key:"request",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"GET",t=arguments[1],r=arguments[2],n=new Headers(r.headers),i={method:e,headers:n},o=new Request(t,i);return fetch(o)}},{key:"requestBody",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"GET",t=arguments[1],r=arguments[2];return fetch(t,{method:e,body:r,headers:new Headers({"Content-Type":"application/json"})})}},{key:"ajaxPost",value:function(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t=e._getUrl(t,r),i.headers||(i.headers={}),i.headers.Accept="application/json",i.headers["Content-Type"]="application/json",e.ajax("POST",t,n,i)}},{key:"logPost",value:function(t,r,n){var i={headers:r};return e.ajax("POST",t,n,i)}},{key:"ajax",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"GET",r=arguments[1],n=arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};"undefined"==typeof XMLHttpRequest&&(window.XMLHttpRequest=function(){try{return new window.ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new window.ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new window.ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw new Error("This browser does not support XMLHttpRequest.")});var o=new XMLHttpRequest;return new Promise(function(a,s){o.onreadystatechange=function(){if(4===o.readyState)if(200===o.status){var t=JSON.parse(o.responseText);t.code?(t=e._intercept(t),s(t)):a(t)}else s({message:o.responseText||"请求失败:"+r})},o.open(t,r,!0);try{if(i.withCredentials&&(o.withCredentials=!0),i.headers)for(var c in i.headers)o.setRequestHeader(c,i.headers[c])}catch(e){return void s(e)}try{o.send(n)}catch(e){s(e)}})}},{key:"_getUrl",value:function(e,t){var r=[];if(t)for(var n in t)r.push(n+"="+t[n]);var i=r.join("&");return e=(-1!=e.indexOf("?")?e:e+"?")+i}},{key:"_httpErrorMessage",value:function(e,t){return e.message||(e.message="HTTP "+e.status+"("+e.statusText+") : "+t),e}},{key:"_intercept",value:function(e){var t=e.data;return e.code&&(t=t||{},t.data=e.data,t.code=e.code,t.description=e.description,t.message="0x"+Number(e.code).toString(16)+", "+e.description,t.tid&&(t.message+=", tid="+t.tid)),t}}]),e}();t.default=o},function(e,t,r){"use strict";var n,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":i(window))&&(n=window)}e.exports=n},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c){"object"===a(t)?e.exports=t=c(r(0)):(i=[r(0)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,o=n.Hasher,a=r.algo,s=[],c=[];!function(){function e(e){return 4294967296*(e-(0|e))|0}for(var r=2,n=0;n<64;)(function(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0})(r)&&(n<8&&(s[n]=e(t.pow(r,.5))),c[n]=e(t.pow(r,1/3)),n++),r++}();var u=[],l=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],l=r[5],d=r[6],f=r[7],h=0;h<64;h++){if(h<16)u[h]=0|e[t+h];else{var p=u[h-15],_=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,m=u[h-2],v=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[h]=_+u[h-7]+v+u[h-16]}var y=s&l^~s&d,g=n&i^n&o^i&o,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),S=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),k=f+S+y+c[h]+u[h],w=b+g;f=d,d=l,l=s,s=a+k|0,a=o,o=i,i=n,n=k+w|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+l|0,r[6]=r[6]+d|0,r[7]=r[7]+f|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=o._createHelper(l),r.HmacSHA256=o._createHmacHelper(l)}(Math),e.SHA256})},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c,u){"object"===a(t)?e.exports=t=c(r(0),r(17)):(i=[r(0),r(17)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){return function(){function t(){return a.create.apply(a,arguments)}var r=e,n=r.lib,i=n.Hasher,o=r.x64,a=o.Word,s=o.WordArray,c=r.algo,u=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],l=[];!function(){for(var e=0;e<80;e++)l[e]=t()}();var d=c.SHA512=i.extend({_doReset:function(){this._hash=new s.init([new a.init(1779033703,4089235720),new a.init(3144134277,2227873595),new a.init(1013904242,4271175723),new a.init(2773480762,1595750129),new a.init(1359893119,2917565137),new a.init(2600822924,725511199),new a.init(528734635,4215389547),new a.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],c=r[5],d=r[6],f=r[7],h=n.high,p=n.low,_=i.high,m=i.low,v=o.high,y=o.low,g=a.high,b=a.low,S=s.high,k=s.low,w=c.high,C=c.low,R=d.high,E=d.low,T=f.high,O=f.low,P=h,A=p,I=_,M=m,D=v,x=y,L=g,N=b,j=S,V=k,B=w,U=C,F=R,H=E,z=T,W=O,G=0;G<80;G++){var J,q,X=l[G];if(G<16)q=X.high=0|e[t+2*G],J=X.low=0|e[t+2*G+1];else{var K=l[G-15],Q=K.high,Y=K.low,Z=(Q>>>1|Y<<31)^(Q>>>8|Y<<24)^Q>>>7,$=(Y>>>1|Q<<31)^(Y>>>8|Q<<24)^(Y>>>7|Q<<25),ee=l[G-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),oe=l[G-7],ae=oe.high,se=oe.low,ce=l[G-16],ue=ce.high,le=ce.low;J=$+se,q=Z+ae+(J>>>0<$>>>0?1:0),J+=ie,q=q+ne+(J>>>0>>0?1:0),J+=le,q=q+ue+(J>>>0>>0?1:0),X.high=q,X.low=J}var de=j&B^~j&F,fe=V&U^~V&H,he=P&I^P&D^I&D,pe=A&M^A&x^M&x,_e=(P>>>28|A<<4)^(P<<30|A>>>2)^(P<<25|A>>>7),me=(A>>>28|P<<4)^(A<<30|P>>>2)^(A<<25|P>>>7),ve=(j>>>14|V<<18)^(j>>>18|V<<14)^(j<<23|V>>>9),ye=(V>>>14|j<<18)^(V>>>18|j<<14)^(V<<23|j>>>9),ge=u[G],be=ge.high,Se=ge.low,ke=W+ye,we=z+ve+(ke>>>0>>0?1:0),ke=ke+fe,we=we+de+(ke>>>0>>0?1:0),ke=ke+Se,we=we+be+(ke>>>0>>0?1:0),ke=ke+J,we=we+q+(ke>>>0>>0?1:0),Ce=me+pe,Re=_e+he+(Ce>>>0>>0?1:0);z=F,W=H,F=B,H=U,B=j,U=V,V=N+ke|0,j=L+we+(V>>>0>>0?1:0)|0,L=D,N=x,D=I,x=M,I=P,M=A,A=ke+Ce|0,P=we+Re+(A>>>0>>0?1:0)|0}p=n.low=p+A,n.high=h+P+(p>>>0>>0?1:0),m=i.low=m+M,i.high=_+I+(m>>>0>>0?1:0),y=o.low=y+x,o.high=v+D+(y>>>0>>0?1:0),b=a.low=b+N,a.high=g+L+(b>>>0>>0?1:0),k=s.low=k+V,s.high=S+j+(k>>>0>>0?1:0),C=c.low=C+U,c.high=w+B+(C>>>0>>0?1:0),E=d.low=E+H,d.high=R+F+(E>>>0>>0?1:0),O=f.low=O+W,f.high=T+z+(O>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});r.SHA512=i._createHelper(d),r.HmacSHA512=i._createHmacHelper(d)}(),e.SHA512})},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r127;)t[r++]=127&e|128,e>>>=7;t[r]=e}function u(e,t){this.len=e,this.next=void 0,this.val=t}function l(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function d(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}e.exports=a;var f,h=r(14),p=h.LongBits,_=h.base64,m=h.utf8,v=function(){return h.Buffer?function(){return(a.create=function(){return new f})()}:function(){return new a}};a.create=v(),a.alloc=function(e){return new h.Array(e)},h.Array!==Array&&(a.alloc=h.pool(a.alloc,h.Array.prototype.subarray)),a.prototype._push=function(e,t,r){return this.tail=this.tail.next=new n(e,t,r),this.len+=t,this},u.prototype=Object.create(n.prototype),u.prototype.fn=c,a.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new u((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},a.prototype.int32=function(e){return e<0?this._push(l,10,p.fromNumber(e)):this.uint32(e)},a.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},a.prototype.uint64=function(e){var t=p.from(e);return this._push(l,t.length(),t)},a.prototype.int64=a.prototype.uint64,a.prototype.sint64=function(e){var t=p.from(e).zzEncode();return this._push(l,t.length(),t)},a.prototype.bool=function(e){return this._push(s,1,e?1:0)},a.prototype.fixed32=function(e){return this._push(d,4,e>>>0)},a.prototype.sfixed32=a.prototype.fixed32,a.prototype.fixed64=function(e){var t=p.from(e);return this._push(d,4,t.lo)._push(d,4,t.hi)},a.prototype.sfixed64=a.prototype.fixed64,a.prototype.float=function(e){return this._push(h.float.writeFloatLE,4,e)},a.prototype.double=function(e){return this._push(h.float.writeDoubleLE,8,e)};var y=h.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n>>0;if(!t)return this._push(s,1,0);if(h.isString(e)){var r=a.alloc(t=_.length(e));_.decode(e,r,0),e=r}return this.uint32(t)._push(y,t,e)},a.prototype.string=function(e){var t=m.length(e);return t?this.uint32(t)._push(m.write,t,e):this._push(s,1,0)},a.prototype.fork=function(){return this.states=new o(this),this.head=this.tail=new n(i,0,0),this.len=0,this},a.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new n(i,0,0),this.len=0),this},a.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},a.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},a._configure=function(e){f=e,a.create=v(),f._configure()}},function(e,t,r){"use strict";function n(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function i(e){this.buf=e,this.pos=0,this.len=e.length}function o(){var e=new l(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw n(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw n(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function a(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function s(){if(this.pos+8>this.len)throw n(this,8);return new l(a(this.buf,this.pos+=4),a(this.buf,this.pos+=4))}e.exports=i;var c,u=r(14),l=u.LongBits,d=u.utf8,f="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new i(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new i(e);throw Error("illegal buffer")},h=function(){return u.Buffer?function(e){return(i.create=function(e){return u.Buffer.isBuffer(e)?new c(e):f(e)})(e)}:f};i.create=h(),i.prototype._slice=u.Array.prototype.subarray||u.Array.prototype.slice,i.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,n(this,10);return e}}(),i.prototype.int32=function(){return 0|this.uint32()},i.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},i.prototype.bool=function(){return 0!==this.uint32()},i.prototype.fixed32=function(){if(this.pos+4>this.len)throw n(this,4);return a(this.buf,this.pos+=4)},i.prototype.sfixed32=function(){if(this.pos+4>this.len)throw n(this,4);return 0|a(this.buf,this.pos+=4)},i.prototype.float=function(){if(this.pos+4>this.len)throw n(this,4);var e=u.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},i.prototype.double=function(){if(this.pos+8>this.len)throw n(this,4);var e=u.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},i.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw n(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},i.prototype.string=function(){var e=this.bytes();return d.read(e,0,e.length)},i.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw n(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw n(this)}while(128&this.buf[this.pos++]);return this},i.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},i._configure=function(e){c=e,i.create=h(),c._configure();var t=u.Long?"toLong":"toNumber";u.merge(i.prototype,{int64:function(){return o.call(this)[t](!1)},uint64:function(){return o.call(this)[t](!0)},sint64:function(){return o.call(this).zzDecode()[t](!1)},fixed64:function(){return s.call(this)[t](!0)},sfixed64:function(){return s.call(this)[t](!1)}})}},function(e,t,r){"use strict";function n(e,t){o.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function i(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}e.exports=n;var o=r(25);((n.prototype=Object.create(o.prototype)).constructor=n).className="Type";var a=r(13),s=r(26),c=r(18),u=r(40),l=r(41),d=r(43),f=r(38),h=r(37),p=r(3),_=r(63),m=r(64),v=r(65),y=r(66),g=r(67);Object.defineProperties(n.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t-1){var r=e.substring(t);if(r in u)return r}return null}function s(e,t){try{if(h.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),h.isString(t)){c.filename=e;var n,i=c(t,d,r),s=0;if(i.imports)for(;s-1)){if(d.files.push(e),e in u)return void(f?s(e,u[e]):(++p,setTimeout(function(){--p,s(e,u[e])})));if(f){var r;try{r=h.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||o(e))}s(e,r)}else++p,d.fetch(e,function(r,i){if(--p,n)return r?void(t?p||o(null,d):o(r)):void s(e,i)})}}"function"==typeof r&&(n=r,r=void 0);var d=this;if(!n)return h.asPromise(e,d,t,r);var f=n===i,p=0;h.isString(t)&&(t=[t]);for(var _,m=0;m-1&&this.deferred.splice(t,1)}}else if(e instanceof d)p.test(e.name)&&delete e.parent[e.name];else if(e instanceof a){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:1e3;this._stopMonitor(),this._interval=e,this._startMonitorTimer()}},{key:"_stopMonitor",value:function(){this._stopMonitorTimer()}},{key:"releaseMonitor",value:function(){this._stopMonitor(),this._monitor&&this._monitor.dispose(),this._monitor=null}},{key:"_startMonitorTimer",value:function(){var e=this;this._stopMonitorTimer(),this._timerId=setInterval(function(){e._onMonitorTimer()},this._interval)}},{key:"_stopMonitorTimer",value:function(){this._timerId&&clearInterval(this._timerId),this._timerId=0}},{key:"_onMonitorTimer",value:function(){}},{key:"dispose",value:function(){}}]),t}(c.default);t.default=u},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;rthis.duration?this.duration:t}return-1},set:function(e){this.sourceNode&&this.arrayBuffer&&(this.playbackTime=e/1e3,e<0?this.emit("error",{code:o.ErrorCode.ERROR_PLAYTIME_ERROR,reason:"currentTime out of range"}):e>=this.duration?(this.stop(),this.playerState=a.PlayerState.End,this.emit("ended")):(this.stop(),this.initPlay(this.arrayBuffer)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playbackRate",{get:function(){return this.sourceNode?this.sourceNode.playbackRate.value:1},set:function(e){this.sourceNode&&(this.sourceNode.playbackRate.value=e)},enumerable:!1,configurable:!0}),t.prototype.getGainNode=function(){return this.gainNode},t.prototype.play=function(e,t){var r=this;return void 0===t&&(t=0),new Promise(function(n,i){r.playerState===a.PlayerState.Loading?setTimeout(function(){r.play(e,t).then(function(){n()})},100):(r.playbackTime=t/1e3,r.stop(),r.audioContext?r.isArrayBuffer(e)?r.playArrayBuffer(e).then(function(){n()}).catch(function(e){i(e)}):i({code:o.ErrorCode.ERROR_NOT_ARRAYBUFFER,message:"source not ArrayBuffer"}):i({code:o.ErrorCode.ERROR_NOTSUPPORT_AUDIOCONTEXT,message:"not support AudioContext"}))})},t.prototype.pause=function(){var e;this.audioContext&&a.PlayerState.Playing===this.playerState&&(null===(e=this.audioContext)||void 0===e||e.suspend(),this.playerState=a.PlayerState.Pause)},t.prototype.stop=function(){var t;a.PlayerState.Pause===this.state&&(null===(t=this.audioContext)||void 0===t||t.resume()),this.sourceNode&&(this.sourceNode.onended=null,this.sourceNode.stop(),this.sourceNode=void 0),e.prototype.stop.call(this)},t.prototype.isArrayBuffer=function(e){return e instanceof ArrayBuffer},t.prototype.playArrayBuffer=function(e){var t=this;return this.playerState=a.PlayerState.Loading,new Promise(function(r,n){t.audioContext?t.audioContext.decodeAudioData(e,function(e){t.initPlay(e),r()},function(e){t.playerState=a.PlayerState.End,n(e)}):(t.playerState=a.PlayerState.End,n({code:o.ErrorCode.ERROR_NOTSUPPORT_AUDIOCONTEXT,message:"not support AudioContext"}))})},t.prototype.initPlay=function(e){var t=this;this.audioContext&&(this.sourceNode=this.audioContext.createBufferSource(),this.sourceNode.onended=function(){t.emit("ended")},this.arrayBuffer=e,this.sourceNode.buffer=this.arrayBuffer,this.playbackTime<0?(this.playerState=a.PlayerState.End,this.emit("error",{code:o.ErrorCode.ERROR_PLAYTIME_ERROR,reason:"playTime out of range"})):1e3*this.playbackTime>this.duration?(this.playerState=a.PlayerState.End,this.emit("ended")):this.playNode())},t.prototype.playNode=function(){if(e.prototype.playNode.call(this),this.sourceNode){var t=this.sourceNode;t.start(0,this.playbackTime),this.playerState=a.PlayerState.Playing,t.context&&(this.offsetTime=t.context.currentTime)}},t}(a.BasePlayer);t.AudioBufferPlayer=s},159:function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AudioMediaStreamPlayer=void 0;var o=function(e){function t(){var t=e.call(this)||this;return t.audioVolume=1,t.audioMuted=!1,t}return i(t,e),t.prototype.initMediaStream=function(e){return!!(this.audioContext&&this.isMediaStream(e)&&(this.sourceNode=this.audioContext.createMediaStreamSource(e),this.sourceNode))},t.prototype.play=function(e){return!!this.initMediaStream(e)&&(this.playNode(),!0)},t.prototype.stop=function(){this.sourceNode&&(this.sourceNode.disconnect(),this.sourceNode=void 0),e.prototype.stop.call(this)},t.prototype.isMediaStream=function(e){return e instanceof MediaStream},t}(r(314).BasePlayer);t.AudioMediaStreamPlayer=o},314:function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BasePlayer=t.PlayerState=void 0;var o,a=r(125),s=r(603),c=r(875);!function(e){e[e.Init=0]="Init",e[e.Loading=1]="Loading",e[e.Playing=2]="Playing",e[e.Pause=3]="Pause",e[e.Stop=4]="Stop",e[e.End=5]="End"}(o=t.PlayerState||(t.PlayerState={}));var u=function(e){function t(){var t=e.call(this)||this;return t.playerState=o.Init,t.audioLevelTimerId=0,t.audioVolume=1,t.audioMuted=!1,t.audioContext=c.AudioUtil.getAudioContext(),t.audioContext&&(t.gainNode=t.audioContext.createGain(),t.analyser=t.audioContext.createAnalyser(),t.timeDomainData=new Uint8Array(t.analyser.frequencyBinCount)),t}return i(t,e),Object.defineProperty(t.prototype,"volume",{get:function(){return this.audioVolume},set:function(e){this.audioVolume=e,this.gainNode&&(this.gainNode.gain.value=this.audioVolume)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mute",{set:function(e){this.audioMuted=e,this.audioMuted?this.gainNode&&this.audioContext&&this.gainNode.disconnect(this.audioContext.destination):this.gainNode&&this.audioContext&&this.gainNode.connect(this.audioContext.destination)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this.playerState},enumerable:!1,configurable:!0}),t.prototype.resume=function(){var e=this;return new Promise(function(t,r){var n;o.Pause===e.playerState?null===(n=e.audioContext)||void 0===n||n.resume().then(function(){e.checkPlaying(),t()}).catch(function(e){r(e)}):r()})},t.prototype.stop=function(){this.gainNode&&this.gainNode.disconnect(),this.analyser&&this.analyser.disconnect(),this.playerState=o.Stop},t.prototype.startAudioLevel=function(e){var t=this;return void 0===e&&(e=500),this.audioLevelTimerId=window.setInterval(function(){var e=0;if(t.analyser&&t.timeDomainData){t.analyser.getByteTimeDomainData(t.timeDomainData);for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:-1;return e<=0||e>this._cacheArr.length?this._cacheArr.splice(0):this._cacheArr.splice(0,e)}}]),e}()},function(e,t,r){"use strict";function n(e,t){for(var r=new Array(arguments.length-1),n=0,i=2,o=!0;i>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}function i(e){for(var t,r,i=s.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),c=e.fieldsArray.slice().sort(s.compareFieldsById),t=0;t>>0,8|a.mapKey[u.keyType],u.keyType),void 0===f?i("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",l,r):i(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|f,d,r),i("}")("}")):u.repeated?(i("if(%s!=null&&%s.length){",r,r),u.packed&&void 0!==a.packed[d]?i("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",r)("w.%s(%s[i])",d,r)("w.ldelim()"):(i("for(var i=0;i<%s.length;++i)",r),void 0===f?n(i,u,l,r+"[i]"):i("w.uint32(%i).%s(%s[i])",(u.id<<3|f)>>>0,d,r)),i("}")):(u.optional&&i("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",r,u.name),void 0===f?n(i,u,l,r):i("w.uint32(%i).%s(%s)",(u.id<<3|f)>>>0,d,r))}return i("return w")}e.exports=i;var o=r(13),a=r(20),s=r(3)},function(e,t,r){"use strict";function n(e){return"missing required '"+e.name+"'"}function i(e){var t=s.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter(function(e){return e.map}).length?",k,value":""))("while(r.pos>>3){");for(var r=0;r>>3){")("case 1: k=r.%s(); break",i.keyType)("case 2:"),void 0===a.basic[c]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",c),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==a.long[i.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):i.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==a.packed[c]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function i(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof a?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,i?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}var o=t,a=r(13),s=r(3);o.fromObject=function(e){var t=e.fieldsArray,r=s.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var i=0;i0)return P.shift();if(A)return i();var n,a,s,c,u,l=0===S;do{if(S===k)return null;for(n=!1;d.test(s=f(S));)if("\n"===s&&(l=!0,++w),++S===k)return null;if("/"===f(S)){if(++S===k)throw r("comment");if("/"===f(S))if(t){if(c=S,u=!1,p(S)){u=!0;do{if((S=_(S))===k)break;S++}while(p(S))}else S=Math.min(k,_(S)+1);u&&h(c,S,l),w++,n=!0}else{for(u="/"===f(c=S+1);"\n"!==f(++S);)if(S===k)return null;++S,u&&h(c,S-1,l),++w,n=!0}else{if("*"!==(s=f(S)))return"/";c=S+1,u=t||"*"===f(c);do{if("\n"===s&&++w,++S===k)throw r("comment");a=s,s=f(S)}while("*"!==a||"/"!==s);++S,u&&h(c,S-2,l),n=!0}}}while(n);var m=S;if(o.lastIndex=0,!o.test(f(m++)))for(;m]/g,a=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,s=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,c=/^ *[*/]+ */,u=/^\s*\*?\/*/,l=/\n/g,d=/\s/,f=/\\(.?)/g,h={0:"\0",r:"\r",n:"\n",t:"\t"};i.unescape=n},function(e,t,r){"use strict";function n(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){a=r>2e3?2e3:r,r-=a;do{i=i+t[n++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}e.exports=n},function(e,t,r){"use strict";function n(e,t,r,n){var o=i,a=n+r;e^=-1;for(var s=n;s>>8^o[255&(e^t[s])];return-1^e}var i=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=n},function(e,t,r){"use strict";function n(e,t){if(t<65534&&(e.subarray&&a||!e.subarray&&o))return String.fromCharCode.apply(null,i.shrinkBuf(e,t));for(var r="",n=0;n=252?6:c>=248?5:c>=240?4:c>=224?3:c>=192?2:1;s[254]=s[254]=1,t.string2buf=function(e){var t,r,n,o,a,s=e.length,c=0;for(o=0;o>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},t.buf2binstring=function(e){return n(e,e.length)},t.binstring2buf=function(e){for(var t=new i.Buf8(e.length),r=0,n=t.length;r4)u[i++]=65533,r+=a-1;else{for(o&=2===a?31:3===a?15:7;a>1&&r1?u[i++]=65533:o<65536?u[i++]=o:(o-=65536,u[i++]=55296|o>>10&1023,u[i++]=56320|1023&o)}return n(u,i)},t.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+s[e[r]]>t?r:t}},function(e,t,r){"use strict";function n(){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=n},function(e,t,r){"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(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c){"object"===a(t)?e.exports=t=c(r(0)):(i=[r(0)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){return function(){if("function"==typeof ArrayBuffer){var t=e,r=t.lib,n=r.WordArray,i=n.init;(n.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var t=e.byteLength,r=[],n=0;n>>2]|=e[n]<<24-n%4*8;i.call(this,r,t)}else i.apply(this,arguments)}).prototype=n}}(),e.lib.WordArray})},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c){"object"===a(t)?e.exports=t=c(r(0)):(i=[r(0)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){return function(){function t(e){return e<<8&4278255360|e>>>8&16711935}var r=e,n=r.lib,i=n.WordArray,o=r.enc;o.Utf16=o.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>1]|=e.charCodeAt(n)<<16-n%2*16;return i.create(r,2*t)}};o.Utf16LE={stringify:function(e){for(var r=e.words,n=e.sigBytes,i=[],o=0;o>>2]>>>16-o%4*8&65535);i.push(String.fromCharCode(a))}return i.join("")},parse:function(e){for(var r=e.length,n=[],o=0;o>>1]|=t(e.charCodeAt(o)<<16-o%2*16);return i.create(n,2*r)}}}(),e.enc.Utf16})},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c){"object"===a(t)?e.exports=t=c(r(0)):(i=[r(0)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){return function(){function t(e,t,r){for(var n=[],o=0,a=0;a>>6-a%4*2,u=s|c;n[o>>>2]|=u<<24-o%4*8,o++}return i.create(n,o)}var r=e,n=r.lib,i=n.WordArray,o=r.enc;o.Base64url={stringify:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e.words,n=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var o=[],a=0;a>>2]>>>24-a%4*8&255,c=r[a+1>>>2]>>>24-(a+1)%4*8&255,u=r[a+2>>>2]>>>24-(a+2)%4*8&255,l=s<<16|c<<8|u,d=0;d<4&&a+.75*d>>6*(3-d)&63));var f=i.charAt(64);if(f)for(;o.length%4;)o.push(f);return o.join("")},parse:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e.length,i=r?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var a=0;a>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8);var s=r[i];s.high^=a,s.low^=o}for(var c=0;c<24;c++){for(var h=0;h<5;h++){for(var p=0,_=0,m=0;m<5;m++){var s=r[h+5*m];p^=s.high,_^=s.low}var v=f[h];v.high=p,v.low=_}for(var h=0;h<5;h++)for(var y=f[(h+4)%5],g=f[(h+1)%5],b=g.high,S=g.low,p=y.high^(b<<1|S>>>31),_=y.low^(S<<1|b>>>31),m=0;m<5;m++){var s=r[h+5*m];s.high^=p,s.low^=_}for(var k=1;k<25;k++){var p,_,s=r[k],w=s.high,C=s.low,R=u[k];R<32?(p=w<>>32-R,_=C<>>32-R):(p=C<>>64-R,_=w<>>64-R);var E=f[l[k]];E.high=p,E.low=_}var T=f[0],O=r[0];T.high=O.high,T.low=O.low;for(var h=0;h<5;h++)for(var m=0;m<5;m++){var k=h+5*m,s=r[k],P=f[k],A=f[(h+1)%5+5*m],I=f[(h+2)%5+5*m];s.high=P.high^~A.high&I.high,s.low=P.low^~A.low&I.low}var s=r[0],M=d[c];s.high^=M.high,s.low^=M.low}},_doFinalize:function(){var e=this._data,r=e.words,n=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(t.ceil((n+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],l=0;l>>24)|4278255360&(f<<24|f>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),u.push(h),u.push(f)}return new i.init(u,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});r.SHA3=o._createHelper(h),r.HmacSHA3=o._createHmacHelper(h)}(Math),e.SHA3})},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c){"object"===a(t)?e.exports=t=c(r(0)):(i=[r(0)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){/** @preserve (c) 2012 by Cédric Mesnil. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ return function(t){function r(e,t,r){return e^t^r}function n(e,t,r){return e&t|~e&r}function i(e,t,r){return(e|~t)^r}function o(e,t,r){return e&r|t&~r}function a(e,t,r){return e^(t|~r)}function s(e,t){return e<>>32-t}var c=e,u=c.lib,l=u.WordArray,d=u.Hasher,f=c.algo,h=l.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),p=l.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),_=l.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),m=l.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),v=l.create([0,1518500249,1859775393,2400959708,2840853838]),y=l.create([1352829926,1548603684,1836072691,2053994217,0]),g=f.RIPEMD160=d.extend({_doReset:function(){this._hash=l.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var c=0;c<16;c++){var u=t+c,l=e[u];e[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}var d,f,g,b,S,k,w,C,R,E,T=this._hash.words,O=v.words,P=y.words,A=h.words,I=p.words,M=_.words,D=m.words;k=d=T[0],w=f=T[1],C=g=T[2],R=b=T[3],E=S=T[4];for(var x,c=0;c<80;c+=1)x=d+e[t+A[c]]|0,x+=c<16?r(f,g,b)+O[0]:c<32?n(f,g,b)+O[1]:c<48?i(f,g,b)+O[2]:c<64?o(f,g,b)+O[3]:a(f,g,b)+O[4],x|=0,x=s(x,M[c]),x=x+S|0,d=S,S=b,b=s(g,10),g=f,f=x,x=k+e[t+I[c]]|0,x+=c<16?a(w,C,R)+P[0]:c<32?o(w,C,R)+P[1]:c<48?i(w,C,R)+P[2]:c<64?n(w,C,R)+P[3]:r(w,C,R)+P[4],x|=0,x=s(x,D[c]),x=x+E|0,k=E,E=R,R=s(C,10),C=w,w=x;x=T[1]+g+R|0,T[1]=T[2]+b+E|0,T[2]=T[3]+S+k|0,T[3]=T[4]+d+w|0,T[4]=T[0]+f+C|0,T[0]=x},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=d.clone.call(this);return e._hash=this._hash.clone(),e}});c.RIPEMD160=d._createHelper(g),c.HmacRIPEMD160=d._createHmacHelper(g)}(Math),e.RIPEMD160})},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c,u){"object"===a(t)?e.exports=t=c(r(0),r(21),r(22)):(i=[r(0),r(21),r(22)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){return function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,o=t.algo,a=o.SHA1,s=o.HMAC,c=o.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=s.create(r.hasher,e),o=i.create(),a=i.create([1]),c=o.words,u=a.words,l=r.keySize,d=r.iterations;c.length>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}function r(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var n=e.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),r(a);var s=a.slice(0);n.encryptBlock(s,0);for(var c=0;c>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923})},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c,u){"object"===a(t)?e.exports=t=c(r(0),r(1)):(i=[r(0),r(1)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){return e.pad.Iso10126={pad:function(t,r){var n=4*r,i=n-t.sigBytes%n;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Iso10126})},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c,u){"object"===a(t)?e.exports=t=c(r(0),r(1)):(i=[r(0),r(1)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){return e.pad.Iso97971={pad:function(t,r){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,r)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971})},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c,u){"object"===a(t)?e.exports=t=c(r(0),r(1)):(i=[r(0),r(1)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1,r=e.sigBytes-1;r>=0;r--)if(t[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},e.pad.ZeroPadding})},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c,u){"object"===a(t)?e.exports=t=c(r(0),r(1)):(i=[r(0),r(1)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding})},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c,u){"object"===a(t)?e.exports=t=c(r(0),r(1)):(i=[r(0),r(1)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){return function(t){var r=e,n=r.lib,i=n.CipherParams,o=r.enc,a=o.Hex,s=r.format;s.Hex={stringify:function(e){return e.ciphertext.toString(a)},parse:function(e){var t=a.parse(e);return i.create({ciphertext:t})}}}(),e.format.Hex})},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c,u){"object"===a(t)?e.exports=t=c(r(0),r(5),r(7),r(4),r(1)):(i=[r(0),r(5),r(7),r(4),r(1)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){return function(){var t=e,r=t.lib,n=r.BlockCipher,i=t.algo,o=[],a=[],s=[],c=[],u=[],l=[],d=[],f=[],h=[],p=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=0,n=0,t=0;t<256;t++){var i=n^n<<1^n<<2^n<<3^n<<4;i=i>>>8^255&i^99,o[r]=i,a[i]=r;var _=e[r],m=e[_],v=e[m],y=257*e[i]^16843008*i;s[r]=y<<24|y>>>8,c[r]=y<<16|y>>>16,u[r]=y<<8|y>>>24,l[r]=y;var y=16843009*v^65537*m^257*_^16843008*r;d[i]=y<<24|y>>>8,f[i]=y<<16|y>>>16,h[i]=y<<8|y>>>24,p[i]=y,r?(r=_^e[e[e[v^_]]],n^=e[e[n]]):r=n=1}}();var _=[0,1,2,4,8,16,32,64,128,27,54],m=i.AES=n.extend({_doReset:function(){var e;if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,r=t.words,n=t.sigBytes/4,i=this._nRounds=n+6,a=4*(i+1),s=this._keySchedule=[],c=0;c6&&c%n==4&&(e=o[e>>>24]<<24|o[e>>>16&255]<<16|o[e>>>8&255]<<8|o[255&e]):(e=e<<8|e>>>24,e=o[e>>>24]<<24|o[e>>>16&255]<<16|o[e>>>8&255]<<8|o[255&e],e^=_[c/n|0]<<24),s[c]=s[c-n]^e);for(var u=this._invKeySchedule=[],l=0;l>>24]]^f[o[e>>>16&255]]^h[o[e>>>8&255]]^p[o[255&e]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,c,u,l,o)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,d,f,h,p,a);var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,o,a,s){for(var c=this._nRounds,u=e[t]^r[0],l=e[t+1]^r[1],d=e[t+2]^r[2],f=e[t+3]^r[3],h=4,p=1;p>>24]^i[l>>>16&255]^o[d>>>8&255]^a[255&f]^r[h++],m=n[l>>>24]^i[d>>>16&255]^o[f>>>8&255]^a[255&u]^r[h++],v=n[d>>>24]^i[f>>>16&255]^o[u>>>8&255]^a[255&l]^r[h++],y=n[f>>>24]^i[u>>>16&255]^o[l>>>8&255]^a[255&d]^r[h++];u=_,l=m,d=v,f=y}var _=(s[u>>>24]<<24|s[l>>>16&255]<<16|s[d>>>8&255]<<8|s[255&f])^r[h++],m=(s[l>>>24]<<24|s[d>>>16&255]<<16|s[f>>>8&255]<<8|s[255&u])^r[h++],v=(s[d>>>24]<<24|s[f>>>16&255]<<16|s[u>>>8&255]<<8|s[255&l])^r[h++],y=(s[f>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[255&d])^r[h++];e[t]=_,e[t+1]=m,e[t+2]=v,e[t+3]=y},keySize:8});t.AES=n._createHelper(m)}(),e.AES})},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c,u){"object"===a(t)?e.exports=t=c(r(0),r(5),r(7),r(4),r(1)):(i=[r(0),r(5),r(7),r(4),r(1)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){return function(){function t(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<>>5]>>>31-i%32&1}for(var o=this._subKeys=[],a=0;a<16;a++){for(var s=o[a]=[],d=l[a],n=0;n<24;n++)s[n/6|0]|=r[(u[n]-1+d)%28]<<31-n%6,s[4+(n/6|0)]|=r[28+(u[n+24]-1+d)%28]<<31-n%6;s[0]=s[0]<<1|s[0]>>>31;for(var n=1;n<7;n++)s[n]=s[n]>>>4*(n-1)+3;s[7]=s[7]<<5|s[7]>>>27}for(var f=this._invSubKeys=[],n=0;n<16;n++)f[n]=o[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,n,i){this._lBlock=e[n],this._rBlock=e[n+1],t.call(this,4,252645135),t.call(this,16,65535),r.call(this,2,858993459),r.call(this,8,16711935),t.call(this,1,1431655765);for(var o=0;o<16;o++){for(var a=i[o],s=this._lBlock,c=this._rBlock,u=0,l=0;l<8;l++)u|=d[l][((c^a[l])&f[l])>>>0];this._lBlock=c,this._rBlock=s^u}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,t.call(this,1,1431655765),r.call(this,8,16711935),r.call(this,2,858993459),t.call(this,16,65535),t.call(this,4,252645135),e[n]=this._lBlock,e[n+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});n.DES=a._createHelper(h);var p=s.TripleDES=a.extend({_doReset:function(){var e=this._key,t=e.words;if(2!==t.length&&4!==t.length&&t.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var r=t.slice(0,2),n=t.length<4?t.slice(0,2):t.slice(2,4),i=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=h.createEncryptor(o.create(r)),this._des2=h.createEncryptor(o.create(n)),this._des3=h.createEncryptor(o.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});n.TripleDES=a._createHelper(p)}(),e.TripleDES})},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c,u){"object"===a(t)?e.exports=t=c(r(0),r(5),r(7),r(4),r(1)):(i=[r(0),r(5),r(7),r(4),r(1)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){return function(){function t(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){t=(t+1)%256,r=(r+e[t])%256;var o=e[t];e[t]=e[r],e[r]=o,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}var r=e,n=r.lib,i=n.StreamCipher,o=r.algo,a=o.RC4=i.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;for(var i=0,o=0;i<256;i++){var a=i%r,s=t[a>>>2]>>>24-a%4*8&255;o=(o+n[i]+s)%256;var c=n[i];n[i]=n[o],n[o]=c}this._i=this._j=0},_doProcessBlock:function(e,r){e[r]^=t.call(this)},keySize:8,ivSize:0});r.RC4=i._createHelper(a);var s=o.RC4Drop=a.extend({cfg:a.cfg.extend({drop:192}),_doReset:function(){a._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)t.call(this)}});r.RC4Drop=i._createHelper(s)}(),e.RC4})},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c,u){"object"===a(t)?e.exports=t=c(r(0),r(5),r(7),r(4),r(1)):(i=[r(0),r(5),r(7),r(4),r(1)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){return function(){function t(){for(var e=this._X,t=this._C,r=0;r<8;r++)s[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(var r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,o=n>>>16,a=((i*i>>>17)+i*o>>>15)+o*o,u=((4294901760&n)*n|0)+((65535&n)*n|0);c[r]=a^u}e[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,e[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,e[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,e[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,e[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,e[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,e[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,e[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}var r=e,n=r.lib,i=n.StreamCipher,o=r.algo,a=[],s=[],c=[],u=o.Rabbit=i.extend({_doReset:function(){for(var e=this._key.words,r=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var i=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var n=0;n<4;n++)t.call(this);for(var n=0;n<8;n++)o[n]^=i[n+4&7];if(r){var a=r.words,s=a[0],c=a[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),l=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),d=u>>>16|4294901760&l,f=l<<16|65535&u;o[0]^=u,o[1]^=d,o[2]^=l,o[3]^=f,o[4]^=u,o[5]^=d,o[6]^=l,o[7]^=f;for(var n=0;n<4;n++)t.call(this)}},_doProcessBlock:function(e,r){var n=this._X;t.call(this),a[0]=n[0]^n[5]>>>16^n[3]<<16,a[1]=n[2]^n[7]>>>16^n[5]<<16,a[2]=n[4]^n[1]>>>16^n[7]<<16,a[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)a[i]=16711935&(a[i]<<8|a[i]>>>24)|4278255360&(a[i]<<24|a[i]>>>8),e[r+i]^=a[i]},blockSize:4,ivSize:2});r.Rabbit=i._createHelper(u)}(),e.Rabbit})},function(e,t,r){"use strict";var n,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,c,u){"object"===a(t)?e.exports=t=c(r(0),r(5),r(7),r(4),r(1)):(i=[r(0),r(5),r(7),r(4),r(1)],n=c,void 0!==(o="function"==typeof n?n.apply(t,i):n)&&(e.exports=o))}(0,function(e){return function(){function t(){for(var e=this._X,t=this._C,r=0;r<8;r++)s[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(var r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,o=n>>>16,a=((i*i>>>17)+i*o>>>15)+o*o,u=((4294901760&n)*n|0)+((65535&n)*n|0);c[r]=a^u}e[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,e[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,e[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,e[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,e[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,e[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,e[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,e[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}var r=e,n=r.lib,i=n.StreamCipher,o=r.algo,a=[],s=[],c=[],u=o.RabbitLegacy=i.extend({_doReset:function(){var e=this._key.words,r=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var o=0;o<4;o++)t.call(this);for(var o=0;o<8;o++)i[o]^=n[o+4&7];if(r){var a=r.words,s=a[0],c=a[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),l=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),d=u>>>16|4294901760&l,f=l<<16|65535&u;i[0]^=u,i[1]^=d,i[2]^=l,i[3]^=f,i[4]^=u,i[5]^=d,i[6]^=l,i[7]^=f;for(var o=0;o<4;o++)t.call(this)}},_doProcessBlock:function(e,r){var n=this._X;t.call(this),a[0]=n[0]^n[5]>>>16^n[3]<<16,a[1]=n[2]^n[7]>>>16^n[5]<<16,a[2]=n[4]^n[1]>>>16^n[7]<<16,a[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)a[i]=16711935&(a[i]<<8|a[i]>>>24)|4278255360&(a[i]<<24|a[i]>>>8),e[r+i]^=a[i]},blockSize:4,ivSize:2});r.RabbitLegacy=i._createHelper(u)}(),e.RabbitLegacy})},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:100,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:20;e&&(this._callback=e,this._releaseWorker(),this._createWorker(t,r),this._worker.postMessage({cmd:1}))}},{key:"stopTimer",value:function(){this._worker&&(this._worker.postMessage({cmd:2}),this._releaseWorker())}},{key:"_onTimer",value:function(){this._callback&&this._callback.apply()}},{key:"_createWorker",value:function(e,t){var r=this,n="var timerId=0;function startTimer(){if(!timerId){var ts=new Date().getTime();timerId=setInterval(function(){var newTS=new Date().getTime();var gap=newTS-ts;if(gap>="+e+"){ts=newTS;this.postMessage({cmd:3})}},"+t+");}};this.onmessage=function(event){if(event.data){if(event.data.cmd===1){startTimer()}else if(event.data.cmd===2){stopTimer()}}};function stopTimer(){if(timerId){clearInterval(timerId);timerId=0}};",i=window.URL||window.webkitURL||window.mozURL||window.msURL,o=new Blob([n],{type:"text/javascript"}),a=i.createObjectURL(o);this._worker=new Worker(a),this._worker.objectURL=a;var s=(new Date).getTime();this._worker.onmessage=function(e){if(e.data&&3===e.data.cmd){var t=(new Date).getTime();s=t,r._onTimer()}}}},{key:"_releaseWorker",value:function(){this._worker&&(this._worker.terminate(),this._worker=null)}},{key:"isSupport",get:function(){return"undefined"!=typeof Worker}}]),e}();t.default=o},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=30?w.default.FPS_30:w.default.FPS_15,a=0;a1&&void 0!==arguments[1]&&arguments[1];return new Promise(function(t,r){navigator.mediaDevices.getUserMedia(e).then(function(e){t(e)}).catch(function(e){r(e)})})}},{key:"_updateAudioCapture",value:function(){var e=this;if(this._publishStream&&this._publishStream.getAudioTracks().length){var t=this._audioTrack;this._getAudioTrack().then(function(r){r.enabled=t.enabled,e.dispatchEvent(T.default.AudioTrackChange,r)})}}},{key:"_setVideoElementAttribute",value:function(e){this._localVideoElement&&(this._localVideoElement.setAttribute("autoplay",""),this._localVideoElement.srcObject=e)}},{key:"_setScreenShareVideoElementAttribute",value:function(e){this._screenShareVideo&&(this._screenShareVideo.setAttribute("autoplay",""),this._screenShareVideo.srcObject=e)}},{key:"_releaseLocalVideoElement",value:function(){this._localVideoElement&&(this._localVideoElement.srcObject=null,this._localVideoElement=null)}},{key:"_releasePreviewStream",value:function(){this._preViewStream&&this._preViewStream.getTracks().forEach(function(e){e.stop()}),this._preViewStream=null,null==this._cameraVideoTrack&&this._releaseHoldCameraTrack()}},{key:"_getResolution",value:function(e,t){var r=this,n=this._resolutionArr.length,i=0,o=[];return new Promise(function(a,s){!function c(){var u=r._resolutionArr[i];r._checkResolution(e,t,u.width,u.height).then(function(e){o.push({width:e.width?e.width:u.width,height:e.height?e.height:u.height}),i==n-1?a(o):(i++,c())}).catch(function(e){i==n-1?o.length?a(o):s(e):(i++,c())})}()})}},{key:"_checkResolution",value:function(e,t,r,n){var i={audio:!1,video:{width:{exact:r},height:{exact:n}}};return e&&(i.video.deviceId={exact:e}),new Promise(function(e,t){navigator.mediaDevices.getUserMedia(i).then(function(t){t.getTracks().forEach(function(e){e.stop()}),e({width:r,height:n})}).catch(function(e){t(e)})})}},{key:"_getAudioConstraints",value:function(){var e={audio:{}};this._audioInfo.deviceId&&Object.assign(e.audio,this._audioInfo),this._addAudioConstraints3AParam(e,"echoCancellation"),this._addAudioConstraints3AParam(e,"autoGainControl"),this._addAudioConstraints3AParam(e,"noiseSuppression");var t=!0;for(var r in e.audio){t=!1;break}return t&&(e.audio=!0),e}},{key:"_addAudioConstraints3AParam",value:function(e,t){this._supportedConstraints[t]&&(e.audio[t]={ideal:!0})}},{key:"_addAspectRatio",value:function(e){return e.video&&e.video.width&&e.video.height&&(e.video.aspectRatio=e.video.width/e.video.height),e}},{key:"_getHoldCameraTrack",value:function(){var e=this;return new Promise(function(t,r){if(e._holdCameraTrack)t();else if(e._getHoldCameraTracking)var n=setInterval(function(){e._getHoldCameraTracking||(clearInterval(n),n=0,e._getHoldCameraTrack().then(function(){t()}).catch(function(e){r(e)}))},100);else{var i=e._getCameraVideoHoldsConstraints();e._getHoldCameraTracking=!0,navigator.mediaDevices.getUserMedia(i).then(function(r){e._holdCameraTrack=r.getVideoTracks()[0],e._getHoldCameraTracking=!1,t()}).catch(function(t){e._getHoldCameraTracking=!1,r(t)})}})}},{key:"_releaseHoldCameraTrack",value:function(){this._holdCameraTrack&&(this._holdCameraTrack.stop(),this._holdCameraTrack=null)}},{key:"_getApplyPreviewConstraints",value:function(){var e=this._videoProfile.getVideoConstraints();return this._enableHighDefinitionPreview&&e.width<=1280&&e.height<=720&&(e.width=1280,e.height=720),e.aspectRatio=e.width/e.height,e}},{key:"_getApplyPublishConstraints",value:function(){var e=this._videoProfile.getVideoConstraints();return e.aspectRatio=e.width/e.height,e}},{key:"_getPreviewStream",value:function(){var e=this;return new Promise(function(t,r){e._getHoldCameraTrack().then(function(){var r=e._holdCameraTrack.clone(),n=e._getApplyPreviewConstraints();r.applyConstraints(n).then(function(){}).catch(function(e){}).then(function(){var e=new MediaStream;e.addTrack(r),t(e)})}).catch(function(e){r(e)})})}},{key:"_getCameraVideoHoldsConstraints",value:function(){var e={};return(this._cameraInfo.facingMode||this._cameraInfo.deviceId)&&(e.video=this._videoProfile.getVideoConstraints(),this._cameraInfo.facingMode?e.video.facingMode={exact:this._cameraInfo.facingMode}:this._cameraInfo.deviceId&&(e.video.deviceId={exact:this._cameraInfo.deviceId})),e.video&&1!=e.video?e.video.width<=1280&&e.video.height<=720&&(e.video.width=1280,e.video.height=720):e.video={width:1280,height:720},e}},{key:"_releaseExternalAudioTrack",value:function(){this._externalAudioTrack&&(this._externalAudioTrack.onended=null,this._externalAudioTrack.stop()),this._externalAudioTrack=null}},{key:"_releaseExternalCameraTrack",value:function(){this._externalCameraTrack&&(this._externalCameraTrack.onended=null,this._externalCameraTrack.stop()),this._externalCameraTrack=null}},{key:"_releaseExternalScreenTrack",value:function(){this._externalScreenTrack&&(this._externalScreenTrack.onended=null,this._externalScreenTrack.stop()),this._externalScreenTrack=null}},{key:"_checkSupport",value:function(){var e=this;return new Promise(function(t,r){e._isSupportRTC?t():r({errorCode:g.default.ERROR_NOTSUPPORT_WEBRTC,message:"Not support webrtc on this platform"})})}},{key:"_checkPreview",value:function(){var e=this;return new Promise(function(t,r){e._checkSupport().then(function(){e.enableCamera?t():r({errorCode:g.default.ERROR_OPTIONS_ENABLECAMERA,message:"enableCamera is false, can not startPreview"})}).catch(function(e){r(e)})})}},{key:"_releaseCameraTrack",value:function(){this._cameraVideoTrack&&this._cameraVideoTrack.enabled&&(this._cameraEnabled=this._cameraVideoTrack.enabled),this._cameraVideoTrack&&(this._cameraVideoTrack.stop(),this._cameraVideoTrack=null),null==this._preViewStream&&this._releaseHoldCameraTrack()}},{key:"screenShareProfile",set:function(e){e&&(this._screenShareProfile.width=e.width,this._screenShareProfile.height=e.height,this._screenShareProfile.frameRate=e.frameRate||10,this._screenShareProfile.maxBitrate=this.computeMaxBitrate(e.width,e.height,e.frameRate||10),this._screenShareProfile.mediaSource=e.mediaSource)},get:function(){return this._screenShareProfile}},{key:"videoProfile",set:function(e){if(e&&Number(e.width)&&Number(e.height))this._videoProfile.width=e.width,this._videoProfile.height=e.height,this._videoProfile.frameRate=e.frameRate||15,this._videoProfile.maxBitrate=this.computeMaxBitrate(e.width,e.height,e.frameRate||15),this.dispatchEvent(T.default.VideoResolutionChange,this._videoProfile);else{var t={errorCode:g.default.ERROR_NOTSUPPORT_RESOLUTION_PARAMES,message:"分辨率参数格式不正确"};this._common.dispatchEvent(S.default.OnError,t)}},get:function(){return this._videoProfile}},{key:"audioProfile",set:function(e){e&&(this._audioProfile.maxBitrate=e.maxBitrate)},get:function(){return this._audioProfile}},{key:"currentCamera",set:function(e){var t=this;if(this._cameraInfo=e,this._cameraVideoTrack||this._preViewStream){var r=this._cameraVideoTrack&&this._cameraVideoTrack.enabled;this.getDevices().then(function(n){if(n.videoDevices.find(function(t){return t.deviceId===e.deviceId}))t._releasePreviewStream(),t._releaseCameraTrack(),t._getCameraVideoTrack().then(function(e){e.enabled=r;var n=t._publishStream.getVideoTracks();if(n.length)for(var i=0;i0&&(this._frameRate=e)},get:function(){return this._frameRate}},{key:"maxBitrate",set:function(e){e=Number(e),this._checkValueType(e)&&(this._maxBitrate=e)},get:function(){return this._maxBitrate}}]),e}();t.default=o},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},r.parseFmtp=function(e){for(var t,r={},n=e.substr(e.indexOf(" ")+1).split(";"),i=0;i-1?(r.attribute=e.substr(t+1,n-t-1),r.value=e.substr(n+1)):r.attribute=e.substr(t+1),r},r.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map(function(e){return parseInt(e,10)})}},r.getMid=function(e){var t=r.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},r.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},r.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:r.matchPrefix(e+t,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(e,t){var r="a=setup:"+t+"\r\n";return e.fingerprints.forEach(function(e){r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),r},r.parseCryptoLine=function(e){var t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},r.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"===t(e.keyParams)?r.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},r.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},r.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},r.getCryptoParameters=function(e,t){return r.matchPrefix(e+t,"a=crypto:").map(r.parseCryptoLine)},r.getIceParameters=function(e,t){var n=r.matchPrefix(e+t,"a=ice-ufrag:")[0],i=r.matchPrefix(e+t,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substr(12),password:i.substr(10)}:null},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e),i=n[0].split(" "),o=3;o0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map(function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType}).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach(function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)});var i=0;return t.codecs.forEach(function(e){e.maxptime>i&&(i=e.maxptime)}),i>0&&(n+="a=maxptime:"+i+"\r\n"),n+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach(function(e){n+=r.writeExtmap(e)}),n},r.parseRtpEncodingParameters=function(e){var t,n=[],i=r.parseRtpParameters(e),o=-1!==i.fecMechanisms.indexOf("RED"),a=-1!==i.fecMechanisms.indexOf("ULPFEC"),s=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),c=s.length>0&&s[0].ssrc,u=r.matchPrefix(e,"a=ssrc-group:FID").map(function(e){return e.substr(17).split(" ").map(function(e){return parseInt(e,10)})});u.length>0&&u[0].length>1&&u[0][0]===c&&(t=u[0][1]),i.codecs.forEach(function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&t&&(r.rtx={ssrc:t}),n.push(r),o&&(r=JSON.parse(JSON.stringify(r)),r.fec={ssrc:c,mechanism:a?"red+ulpfec":"red"},n.push(r))}}),0===n.length&&c&&n.push({ssrc:c});var l=r.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substr(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substr(5),10)*.95-16e3:void 0,n.forEach(function(e){e.maxBitrate=l})),n},r.parseRtcpParameters=function(e){var t={},n=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var i=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=i.length>0,t.compound=0===i.length;var o=r.matchPrefix(e,"a=rtcp-mux");return t.mux=o.length>0,t},r.parseMsid=function(e){var t,n=r.matchPrefix(e,"a=msid:");if(1===n.length)return t=n[0].substr(7).split(" "),{stream:t[0],track:t[1]};var i=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"msid"===e.attribute});return i.length>0?(t=i[0].value.split(" "),{stream:t[0],track:t[1]}):void 0},r.parseSctpDescription=function(e){var t,n=r.parseMLine(e),i=r.matchPrefix(e,"a=max-message-size:");i.length>0&&(t=parseInt(i[0].substr(19),10)),isNaN(t)&&(t=65536);var o=r.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substr(12),10),protocol:n.fmt,maxMessageSize:t};if(r.matchPrefix(e,"a=sctpmap:").length>0){var a=r.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(a[0],10),protocol:a[1],maxMessageSize:t}}},r.writeSctpDescription=function(e,t){var r=[];return r="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&r.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),r.join("")},r.generateSessionId=function(){return Math.random().toString().substr(2,21)},r.writeSessionBoilerplate=function(e,t,n){var i,o=void 0!==t?t:2;return i=e||r.generateSessionId(),"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,n,i){var o=r.writeRtpDescription(e.kind,t);if(o+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",e.direction?o+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var a="msid:"+i.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+a,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),o},r.getDirection=function(e,t){for(var n=r.splitLines(e),i=0;i1&&void 0!==arguments[1]&&arguments[1];return new Promise(function(n,i){if(M.ClientRole.Interactive==e||M.ClientRole.Live==e)if(t._hasJoinedChannel)if(e==t._channelProfileManager.clientRole&&n(),t._channelProfileManager.isChannelProfileInteractiveLive||t._channelProfileManager.isChannelProfileCdnLive)if(t._channelInfo.self.isPublishing)r?t.unPublish().then(function(){t.setClientRole(e,!1)}).catch(function(e){i(e)}):i();else{var o=(new Date).getTime();t._signalingManager.roleUpdate(e,t._channelProfileManager).then(function(a){var s=(new Date).getTime()-o,c=t._channelProfileManager.clientRole;t._channelProfileManager.clientRole=e,t._log.reportUpdateRole(c,e,s,0),t._common.dispatchEvent(h.default.OnUpdateRole,{oldRole:c,newRole:e}),t._channelInfo.dispatchMcuPublishInfo(),r?t.publish().then(function(){n()}).catch(function(e){i(e)}):n()}).catch(function(r){t._log.reportUpdateRole(oldRole,e,costtime,-1),i(r)})}else i();else t._channelProfileManager.clientRole=e,n();else i()})}},{key:"setVideoProfile",value:function(e,t){return R.default.CAMERA===t?(this._rtcDeviceManager.videoProfile=e,this._log.reportVideoProfile(e),!0):R.default.SCREEN===t&&(this._rtcDeviceManager.screenShareProfile=e,this._log.reportScreenShareProfile(e),!0)}},{key:"configRemoteCameraTrack",value:function(e,t,r){var n=this._channelInfo.getUser(e);return n?(n.configRemoteCameraTrack(t,r),this._log.reportRemoteCameraTrack(e,t,r,0),!0):(this._log.reportRemoteCameraTrack(e,t,r,1),!1)}},{key:"configRemoteScreenTrack",value:function(e,t){var r=this._channelInfo.getUser(e);return r?(r.configRemoteScreenTrack(t),this._log.reportRemoteScreenTrack(e,t,0),!0):(this._log.reportRemoteScreenTrack(e,t,1),!1)}},{key:"configRemoteAudio",value:function(e,t){var r=this._channelInfo.getUser(e);return r?(r.configRemoteAudio(t),this._log.reportRemoteAudioTrack(e,t,0),!0):(this._log.reportRemoteAudioTrack(e,t,1),!1)}},{key:"getUserList",value:function(){return this._channelInfo.getUserList()}},{key:"getUserInfo",value:function(e){var t=this._channelInfo.getUser(e);if(t){var r=t.getUserInfo();return r=this._channelInfo.filterUserInfo(r)}return null}},{key:"joinChannel",value:function(e,t){var r=this,n=(new Date).getTime();return new Promise(function(i,o){if(r._webtrackingclient.reportJoinChannel(e,t),r._authInfo.updateAuthInfo(e,t))r._signalingManager.getAdapt().then(function(e){return e&&e.data&&e.data.user_specified?(r._signalingManager.singlePort=1===e.data.user_specified.single_port,{log_type:e.data.user_specified.log_type,log_type_ratio:e.data.user_specified.log_type_ratio}):null}).catch(function(e){return null}).then(function(e){r._log.start(r._apiManager.getSTSRefreshUrl(r._authInfo.gslb),r._apiManager.serverUrl,e)}),r._signalingManager.joinChannel(r._channelProfileManager).then(function(e){var t=(new Date).getTime();r._webtrackingclient.reportJoinChannelRes(0,"",t-n),r._channelInfo.onJoinSuccess(e),r._hasJoinedChannel=!0,i()}).catch(function(e){var t=(new Date).getTime(),i=e.code||0===e.code?e.code:e.errorCode||0===e.errorCode?e.errorCode:-1;r._webtrackingclient.reportJoinChannelRes(i,e.message,t-n),o(e)});else{var a=r._authInfo.getErrorMessage();r.dispatchEvent(h.default.OnError,a);var s=(new Date).getTime();r._webtrackingclient.reportJoinChannelRes(-1,a,s-n),o({message:a})}})}},{key:"setAudioVolume",value:function(e,t){return!this._common.customPlay&&this._channelInfo.setAudioVolume(e,t)}},{key:"getAudioVolume",value:function(e){if(!this._common.customPlay){var t=this._channelInfo.getUser(e);if(t)return t.getAudioVolume()}return-1}},{key:"leaveChannel",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return new Promise(function(r,n){if(e._webtrackingclient.reportLeaveChannel(),!e._hasJoinedChannel)return e._log.stopPerformanceInterval(),e._log.stopUpdateToken(),void r();e._hasJoinedChannel=!1,e._channelInfo&&e._channelInfo.clear(t);var i=(new Date).getTime();e._signalingManager.leave().then(function(t){e._channelInfo.onLeaveChannelSuccess(),e._log.reportLeaveRoom((new Date).getTime()-i,0,t.tid),e._signalingManager.stop(),e._hasJoinedChannel=!1,e._log.stopPerformanceInterval(),e._log.stopUpdateToken(),r()}).catch(function(t){e._log.reportLeaveRoom((new Date).getTime()-i,t.code,t.tid),n(t)})})}},{key:"startPreview",value:function(e){var t=this;return new Promise(function(r,n){if(t._common.isAudioOnly)return void n(T.default.parseOptionError(P.default.ERROR_OPTIONS_AUDIO_ONLY));if(t._checkHtmlElement(e))t._rtcDeviceManager.getPreViewStream(e).then(function(){t._log.reportStartPreview(e.nodeName,0,""),r()}).catch(function(r){t._log.reportStartPreview(e.nodeName,-1,r.message),n(r)});else{var i="",o="";e?dom instanceof HTMLElement?(i=e.nodeName,o="wrong htmlelement"):(i=void 0===i?"undefined":s(i),o="video is not htmlelement"):(i="null",o="video is null"),t._log.reportStartPreview(i,-1,o),n({message:"htmlmediaelement error"})}})}},{key:"stopPreview",value:function(){var e=this;return new Promise(function(t,r){try{e._rtcDeviceManager.releasePreviewStream(),e._log.reportStopPreview(0),t()}catch(t){e._log.reportStopPreview(1),r(t)}})}},{key:"startScreenSharePreview",value:function(e){var t=this;return new Promise(function(r,n){if(t._channelProfileManager.isChannelProfileCdnLive&&t._channelProfileManager.isClientRoleLive)return void n(T.default.parseOptionError(P.default.ERROR_OPTIONS_CHANNELPROFILE_RTC));if(t._checkHtmlElement(e))t._rtcDeviceManager.getScreenShareStream(e).then(function(){r()}).catch(function(e){n(e)});else{var i="",o="";e?dom instanceof HTMLElement?(i=e.nodeName,o="wrong htmlelement"):(i=void 0===i?"undefined":s(i),o="video is not htmlelement"):(i="null",o="video is null"),t._log.reportStartPreview(i,-1,o),n({message:"htmlmediaelement error"})}})}},{key:"stopScreenSharePreview",value:function(){var e=this;return new Promise(function(t,r){if(e._channelProfileManager.isChannelProfileCdnLive&&e._channelProfileManager.isClientRoleLive)return void r(T.default.parseOptionError(P.default.ERROR_OPTIONS_CHANNELPROFILE_RTC));try{e._rtcDeviceManager.releaseScreenShareStream(),t()}catch(e){r(e)}})}},{key:"publish",value:function(){var e=this;return new Promise(function(t,r){if(e._channelProfileManager.isChannelProfileCdnLive){if(e._channelProfileManager.isClientRoleLive)return void r(T.default.parseOptionError(P.default.ERROR_OPTIONS_CHANNELPROFILE_RTC))}else if(e._channelProfileManager.isChannelProfileInteractiveLive&&e._channelProfileManager.isClientRoleLive)return void r({message:T.default.parseOptionError(P.default.ERROR_OPTIONS_LIVE_CANNOT_PUBLISH)});e._channelInfo.self.publish().then(function(e){t()}).catch(function(e){r(e)})})}},{key:"unPublish",value:function(){var e=this;return new Promise(function(t,r){if(e._channelProfileManager.isChannelProfileCdnLive&&e._channelProfileManager.isClientRoleLive)return void r(T.default.parseOptionError(P.default.ERROR_OPTIONS_CHANNELPROFILE_RTC));e._channelInfo.self.unPublish().then(function(){e._channelInfo.self.clear(),t()}).catch(function(e){r(e)})})}},{key:"subscribe",value:function(e){var t=this;return new Promise(function(r,n){var i=t._channelInfo.getUser(e);i?i.subscribe().then(function(t){r(e)}).catch(function(e){n(e)}):(t._log.reportSubscribe("","",!1,!1,!1,!1,P.default.ERROR_NO_USER,0,0),n({errorCode:P.default.ERROR_NO_USER,message:"user not exist"}))})}},{key:"unSubscribe",value:function(e){var t=this;return new Promise(function(r,n){var i=t._channelInfo.getUser(e);i?i.unSubscribe().then(function(){r()}).catch(function(e){n(e)}):(t._log.reportUnsubscribe("","",0,0,0,""),r())})}},{key:"setDisplayRemoteVideo",value:function(e,t,r){if(this._common.customPlay)return!1;var n=this._checkHtmlElement(t);if(n&&e&&(R.default.CAMERA===r||R.default.SCREEN===r))return this._log.reportSetDisplayRemoteVideo(e,t.nodeName,r,0,""),this._channelInfo.setDisplayRemoteVideo(e,t,r);var i="",o="";return n?(i=t.nodeName,o=e?"type is "+r:"userId is null"):t?dom instanceof HTMLElement?(i=t.nodeName,o="wrong htmlelement"):(i=void 0===i?"undefined":s(i),o="video is not htmlelement"):(i="null",o="video is null"),this._log.reportSetDisplayRemoteVideo(e,t?t.nodeName:"null",i,-1,o),!1}},{key:"getDevices",value:function(){return this._rtcDeviceManager.getDevices()}},{key:"setAudioOutput",value:function(e){return this._channelInfo.setAudioOutput(e)}},{key:"muteLocalCamera",value:function(e){if(!this._channelInfo.self||!this._channelInfo.self.isCameraPublishing)return!1;this._log.reportMuteLocalCamera(e);var t=this._channelInfo.self.muteLocalCamera(e);return t&&this._signalingManager.uploadStatus(D.StatusParser.getCurrentStatus(this._channelInfo.self.getMicStatus(),this._channelInfo.self.getCameraStatus(),!0)),t}},{key:"muteLocalMic",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this._channelInfo.self||!this._channelInfo.self.isAudioPublishing)return!1;this._log.reportMuteLocalMic(e,t);var r=this._channelInfo.self.muteLocalMic(e,t);return r&&this._signalingManager.uploadStatus(D.StatusParser.getCurrentStatus(this._channelInfo.self.getMicStatus(),this._channelInfo.self.getCameraStatus(),!0)),r}},{key:"muteRemoteAudioPlaying",value:function(e,t){if(!this._common.customPlay){var r=this._channelInfo.getUser(e);if(r)return r.muteAudioPlaying(t)}return!1}},{key:"muteAllRemoteAudioPlaying",value:function(e){return!this._common.customPlay&&this._channelInfo.muteAllAudioPlaying(e)}},{key:"startAudioMixing",value:function(e,t){this._channelInfo.self.startAudioMixing(e,t)}},{key:"stopAudioMixing",value:function(e){this._channelInfo.self.stopAudioMixing(e)}},{key:"pauseAudioMixing",value:function(e){this._channelInfo.self.pauseAudioMixing(e)}},{key:"resumeAudioMixing",value:function(e){this._channelInfo.self.resumeAudioMixing(e)}},{key:"adjustAudioMixingVolume",value:function(e){this._channelInfo.self.adjustAudioMixingVolume(e)}},{key:"setAudioMixingPosition",value:function(e,t){this._channelInfo.self.setAudioMixingPosition(e,t)}},{key:"getAudioMixingDuration",value:function(){return this._channelInfo.self.getAudioMixingDuration()}},{key:"getAudioMixingCurrentPosition",value:function(){return this._channelInfo.self.getAudioMixingCurrentPosition()}},{key:"on",value:function(e,t,r){this.replaceEventListener(e,t,r)}},{key:"off",value:function(e,t,r){this.removeEventListener(e,t,r)}},{key:"getAvailableResolutions",value:function(e){return this._rtcDeviceManager.getAvailableResolutions(e)}},{key:"dispose",value:function(){if(this._signalingManager.cancel(),this._hasJoinedChannel){this._hasJoinedChannel=!1,this._signalingManager.leaveSync();!function(e){for(var t=(new Date).getTime(),r=t;r1&&e[0]==h.default.OnError&&this._log.reportOnError(e[1]),1==e.length?u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dispatchEvent",this).call(this,e[0]):2==e.length?u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dispatchEvent",this).call(this,e[0],e[1]):3==e.length?u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dispatchEvent",this).call(this,e[0],e[1],e[2]):u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dispatchEvent",this).call(this,e)}},{key:"_checkHtmlElement",value:function(e){return!(!(e&&e instanceof HTMLElement)||"VIDEO"!==e.nodeName&&"AUDIO"!==e.nodeName)}},{key:"_tryToRejoinRoomAndPub",value:function(e){var t=this;if(this._common.retryInfo.current0&&this._users[r].startAudioInputLevel();this._audiotimeout||(this._audiotimeout=setInterval(function(){var e=[];t._self&&t._self.isPublishing&&t._self.isAudioPublishing&&(e.push({userId:"0",displayName:t._self.displayName,level:Math.round(100*t._self.level),buffer:t._self.buffer}),t._self.clearLevel());for(var r in t._users)t._users[r].getUserInfo().streamConfigs.filter(function(e){return e.label===y.default.Audio&&e.subscribed}).length>0&&(e.push({userId:t._users[r].userId,displayName:t._users[r].displayName,level:Math.round(100*t._users[r].level),buffer:t._users[r].buffer}),t._users[r].clearLevel());t._common.dispatchEvent(u.default.OnAudioLevel,e)},1e3))}else{if(this._self&&this._self.stopAudioInputLevel(),this._users)for(var n in this._users)this._users[n].stopAudioInputLevel();this._audiotimeout&&(clearInterval(this._audiotimeout),this._audiotimeout=null)}}},{key:"setDisplayRemoteVideo",value:function(e,t,r){var n=this.getUser(e);return!!n&&(n.setDisplayRemoteVideo(t,r),this._log.reportSetDisplayRemoteVideo(e,t.nodeName,r,0,""),!0)}},{key:"setAudioVolume",value:function(e,t){if(-1===e){for(var r in this._users)this._users[r].setAudioVolume(t);return!0}var n=this.getUser(e);return!!n&&n.setAudioVolume(t)}},{key:"onJoinSuccess",value:function(e){var t=this;this._self=new d.default(this._authInfo.userId,this._authInfo.userName,this._authInfo,this._signalingManager,this._common,this._log,this._deviceManager,this._apiManager),this._startNetworkQualityTimer(),this._signalingManager.uploadStatus(m.StatusParser.getCurrentStatus(this.self.getMicStatus(),this.self.getCameraStatus(),!1)),this._common.autoPublish&&this._self.publish().then(function(){}).catch(function(e){t._common.dispatchEvent(u.default.OnAutoPublishFail,e)})}},{key:"onLeaveChannelSuccess",value:function(){this._stopNetwrokQualityTimer()}},{key:"clear",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._self&&(this._self.unPublish(e).then(function(){}).catch(function(e){}),this._self.clear()),this._unSubscribeAll(),this._users={}}},{key:"setAudioOutput",value:function(e){var t=this;return new Promise(function(r,n){t._common.outputDeviceId=e;var i=!1;if(C.BrowserUtil.isSafari||C.SystemUtil.isIos)n({errorCode:b.default.ERROR_NOTSUPPORT_SETOUTPUTDEVICE,message:"not support set output device"});else{for(var o in t._users)if(t._users[o]&&t._users[o].checkAudio()){i=!0,t._users[o].setAudioOutput(e).then(function(){r()}).catch(function(e){n(e)});break}i||r()}})}},{key:"dispatchMcuPublishInfo",value:function(){if(this._channelProfileManager.isChannelProfileCdnLive)if(this._channelProfileManager.isClientRoleLive)for(var e in this._users){var t=this._users[e],r=t.getUserInfo();if(w.default.isMcuInfo(r.userId,r.displayName))this._common.dispatchEvent(u.default.OnPublisher,r);else{var n=!1,i=!1,o=!1,a=!1,s=!1,c=!1;r.streamConfigs.forEach(function(e){e.label==y.default.Audio?("active"==e.state&&(i=!0),e.subscribed&&(n=!0)):e.label==y.default.LargeVideo||e.label==y.default.SmallVideo?("active"==e.state&&(a=!0),e.subscribed&&(o=!0)):e.label==y.default.ScreenShareVideo&&("active"==e.state&&(c=!0),e.subscribed&&(s=!0))}),n&&t.configRemoteAudio(!1),o&&t.configRemoteCameraTrack(!0,!1),t.subscribe(),(i||a)&&(r=this.filterUserInfo(r),c?this._common.dispatchEvent(u.default.OnPublisher,r):this._common.dispatchEvent(u.default.OnUnPublisher,r))}}else for(var l in this._users){var d=this._users[l].getUserInfo();w.default.isMcuInfo(d.userId,d.displayName)&&(d.streamConfigs=[],this._users[l].unSubscribe(),this._common.dispatchEvent(u.default.OnUnPublisher,d))}}},{key:"filterUserInfo",value:function(e){return this._channelProfileManager.isChannelProfileCdnLive&&(this._channelProfileManager.isClientRoleLive?w.default.isMcuInfo(e.userId,e.displayName)||e.streamConfigs.forEach(function(e){e.label!==y.default.ScreenShareVideo&&(e.state="inactive")}):w.default.isMcuInfo(e.userId,e.displayName)&&(e.streamConfigs=[])),e}},{key:"_unSubscribeAll",value:function(){for(var e in this._users)this._users[e].unSubscribe().then(function(){}).catch(function(e){}),this._users[e].clear(),delete this._users[e]}},{key:"_addEventListener",value:function(){var e=this;this._signalingManager.addEventListener(_.default.Bye,function(t){e.clear(),e._log.reportOnBye(t.code),e._common.dispatchEvent(u.default.OnBye,t)}),this._signalingManager.addEventListener(_.default.Join,function(t){if(t.peers&&t.peers.length)for(var r=0;r0&&e._common.retryInfo.current-1&&n.rtt>-1&&(++e,t.lostrate+=n.lostrate,t.rtt+=n.rtt)}return e>0?(t.lostrate/=e,t.rtt/=e):(t.lostrate=-1,t.rtt=-1),t}},{key:"_getNetworkQuality",value:function(e){return e&&-1!=e.lostrate&&-1!=e.rtt?e.lostrate>50||e.rtt>500?S.NetworkQuality.NETWORK_QUALITY_VERYBAD:e.lostrate>30||e.rtt>350?S.NetworkQuality.NETWORK_QUALITY_BAD:e.lostrate>20||e.rtt>200?S.NetworkQuality.NETWORK_QUALITY_POOR:e.lostrate>10||e.rtt>100?S.NetworkQuality.NETWORK_QUALITY_GOOD:S.NetworkQuality.NETWORK_QUALITY_EXCELLENT:S.NetworkQuality.NETWORK_QUALITY_UNKNOWN}},{key:"self",get:function(){return this._self}}]),t}(E.default);t.default=T},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};return this._common.configLocalAudioPublish="boolean"==typeof t.audio?t.audio:this._common.configLocalAudioPublish,this._common.configLocalCameraPublish="boolean"==typeof t.camera?t.camera:this._common.configLocalCameraPublish,this._common.configLocalScreenPublish="boolean"==typeof t.screen?t.screen:this._common.configLocalScreenPublish,new Promise(function(t,r){var n=(new Date).getTime(),i=e._getStreamData();e._common.configLocalAudioPublish||e._common.configLocalCameraPublish||e._common.configLocalScreenPublish?e._conn?e._republish().then(function(r){if(e._publishStream){var n=e._publishStream.getAudioTracks();n&&n.length&&n[0].enabled&&e._muteLocalMic&&(n[0].enabled=!1)}e._common.enableAudioVolumeIndicator&&(e.stopAudioInputLevel(),e.startAudioInputLevel()),e._signalingManager.uploadStatus(I.StatusParser.getCurrentStatus(e.getMicStatus(),e.getCameraStatus(),!0)),e._dispatchPublishChange(e._streamConfig),t()}).catch(function(t){e._log.reportOnError(t),r(t)}):(e._videoResolutionChangeFunc=e._videoResolutionChange.bind(e),e._deviceManager.addEventListener(D.default.VideoResolutionChange,e._videoResolutionChangeFunc),e._videoDeivceChangeFunc=e._videoDeivceChange.bind(e),e._deviceManager.addEventListener(D.default.VideoDeivceChange,e._videoDeivceChangeFunc),e._deviceManager.getPublishStream().then(function(o){for(var a=!1,s=o.getTracks(),c=0;c1&&void 0!==arguments[1])||arguments[1];this._common.dispatchEvent(p.default.OnPublishChange,e.map(function(e){return{label:e.label,state:t?e.state:"inactive",type:e.type}}))}},{key:"unPublish",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._promiseQueue.clearQueue(),this._promiseQueue.add(this._executeUnPublish.bind(this),[e])}},{key:"_executeUnPublish",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return new Promise(function(r,n){e._status=k.default.UnPublishing;var i=(new Date).getTime(),o=e._streamConfig.slice();if(!e._conn)return e._status=k.default.Init,e._log.reportUnpublish(e._authInfo.publishCallId,(new Date).getTime()-i,0,0,"当前没有推流"),void r();e._signalingManager.unpublish().then(function(n){e._releaseMonitor(),e._conn.oniceconnectionstatechange=function(){},e.clear(),e._status=k.default.Init,t&&e._deviceManager.releasePublishStream(),e._log.reportUnpublish(e._authInfo.publishCallId,(new Date).getTime()-i,0,n.tid,""),e._dispatchPublishChange(o,!1),r()}).catch(function(r){var o=r.code||0===r.code?r.code:r.errorCode||0===r.errorCode?r.errorCode:-1;e._log.reportUnpublish(e._authInfo.publishCallId,(new Date).getTime()-i,o,r.tid,r.message||""),e._status=k.default.Published,t&&e._deviceManager.releasePublishStream(),n(r)})})}},{key:"startAudioInputLevel",value:function(){this._isPublishAudio&&this._publishStream&&this._audioUtil.startAudioInputLevel(this._publishStream)}},{key:"stopAudioInputLevel",value:function(e){this._audioUtil.stopAudioInputLevel(e)}},{key:"clearLevel",value:function(){this._audioUtil.clearLevel()}},{key:"clear",value:function(){c(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"clear",this).call(this),this._streamConfig=[],this._rtpSenderAudio=null,this._rtpSenderScreen=null,this._rtpSenderCameraLarge=null,this._pcReconnectIndex=0,this._pcReconnecting=!1,this._clearIceConnectionStateTimer(),this._videoResolutionChangeFunc&&(this._deviceManager.removeEventListener(D.default.VideoResolutionChange,this._videoResolutionChangeFunc),this._videoResolutionChangeFunc=null),this._videoDeivceChangeFunc&&(this._deviceManager.removeEventListener(D.default.VideoDeivceChange,this._videoDeivceChangeFunc),this._videoDeivceChangeFunc=null)}},{key:"startAudioMixing",value:function(e,t){this._audiomixing.startAudioMixing(e,t)}},{key:"stopAudioMixing",value:function(e){this._audiomixing.stopAudioMixing(e)}},{key:"pauseAudioMixing",value:function(e){this._audiomixing.pauseAudioMixing(e)}},{key:"resumeAudioMixing",value:function(e){this._audiomixing.resumeAudioMixing(e)}},{key:"adjustAudioMixingVolume",value:function(e){this._audiomixing.adjustAudioMixingVolume(e)}},{key:"setAudioMixingPosition",value:function(e,t){this._audiomixing.setAudioMixingPosition(e,t)}},{key:"getAudioMixingDuration",value:function(){return this._audiomixing.getAudioMixingDuration()}},{key:"getAudioMixingCurrentPosition",value:function(){return this._audiomixing.getAudioMixingCurrentPosition()}},{key:"_startMixing",value:function(){var e=this;if(this._audiomixing.bufferPlayer.state===U.default.Playing){var t=new MediaStream;if(this._publishStream&&this._publishStream.getAudioTracks()){var r=this._publishStream.getAudioTracks()[0];if(!r.enabled)return;t.addTrack(r)}this._audioMixer.stopMix(),this._audioMixer.startMix(t,this._audiomixing.bufferPlayer).then(function(t){if(t&&t.getAudioTracks&&t.getAudioTracks().length>0){var r=t.getAudioTracks()[0];r.enabled=e._rtpSenderAudio.track.enabled,e._rtpSenderAudio.replaceTrack(r)}}).catch(function(t){e._common.dispatchEvent({errorCode:A.default.ERROR_START_MIX_FAIL,message:"start mix fail"})})}}},{key:"_publish",value:function(e,t){var r=this;return new Promise(function(t,n){r._status=k.default.Publishing;(new Date).getTime(),r._getStreamData();r._startConnect(e).then(function(e){F.BrowserUtil.isFirefox&&(e.sdp=m.default.completionSDPSSRC(e.sdp));var i=[];r._updateStreamConfig(),r.pushWork(e,i).then(function(n){r._status=k.default.Published,t({offer:e,answer:n.jsep,tid:n.tid})}).catch(function(e){r._status=k.default.Init,e.errorCode=e.errorCode?e.errorCode:e.code,e.message=e.message?e.message:e.msg,n(e)})}).catch(function(e){r._status=k.default.Init;var t=e.code||0===e.code?e.code:e.errorCode||0===e.errorCode?e.errorCode:-1;e.errorCode=t,e.message=e.message?e.message:e.msg,e.tid=e.tid||0,n(e)})})}},{key:"pushWork",value:function(e,t){var r=this;return new Promise(function(n,i){r._setLocalDescription(e).then(function(){}).catch(function(e){e.errorCode=A.default.ERROR_SET_LOCAL_DESCRIPTION,e.code=e.errorCode?e.errorCode:e.code,e.tid=e.tid?e.tid:0,e.message=e.message?e.message:msg,i(e)}),r._allocate(t).then(function(){}).catch(function(e){var t=e.code||0===e.code?e.code:e.errorCode||0===e.errorCode?e.errorCode:-1;e.errorCode=t,e.tid=e.tid?e.tid:0,e.message=e.message?e.message:e.msg,i(e)}),r._startPublish(e,t).then(function(e){n(e)}).catch(function(e){var t=e.code||0===e.code?e.code:e.errorCode||0===e.errorCode?e.errorCode:-1;e.errorCode=t,e.tid=e.tid?e.tid:0,e.message=e.message?e.message:e.msg,i(e)})})}},{key:"_republish",value:function(){var e=this;return this._status=k.default.Publishing,new Promise(function(t,r){var n=(new Date).getTime();e._changeStreamState().then(function(i){var o=e._getStreamData();if(i){if(e._common.isAudioOnly){e._status=k.default.Published;var a=O.default.parseOptionError(A.default.ERROR_OPTIONS_AUDIO_ONLY);return e._log.reportRepublish(e._authInfo.publishCallId,o.isLargeVideo,!1,o.isAudio,a.errorCode,0,(new Date).getTime()-n,a.message),void r(a)}e._updateStreamConfig();var s=JSON.stringify({streams:e._streamConfig});e._signalingManager.republish(s).then(function(r){e._log.reportRepublish(e._authInfo.publishCallId,o.isLargeVideo,!1,o.isAudio,0,r.tid,(new Date).getTime()-n,""),t(r)}).catch(function(t){e._log.reportRepublish(e._authInfo.publishCallId,o.isLargeVideo,!1,o.isAudio,t.errorCode?t.errorCode:t.code,t.tid,(new Date).getTime()-n,t.message?t.message:t.msg),r(t)}).finally(function(){e._status=k.default.Published})}else e._status=k.default.Published,e._log.reportRepublish(e._authInfo.publishCallId,o.isLargeVideo,!1,o.isAudio,0,0,(new Date).getTime()-n,"流未变化,没有变更推流内容"),t()}).catch(function(t){e._status=k.default.Published;var i=t.code||0===t.code?t.code:t.errorCode||0===t.errorCode?t.errorCode:-1;e._log.reportRepublish(e._authInfo.publishCallId,!1,!1,!1,i,"",(new Date).getTime()-n,t.message?t.message:t.msg),r(t)})})}},{key:"_createOffer",value:function(e){var t=this;return new Promise(function(r,n){var i=m.default.mergeConstraints(m.default.DEFAULT_SDP_OFFER_OPTIONS,e);t.conn.createOffer(i).then(function(e){e.sdp=m.default.replace42e01fTo42001f(e.sdp),e.sdp=m.default.addAudioNack(e.sdp),e.sdp=m.default.removeAudioRed(e.sdp),t._common.bandwidthEstimation==E.default.GoogRemb?e.sdp=m.default.replaceTransportCC(e.sdp):t._common.bandwidthEstimation==E.default.TransportCC&&(e.sdp=m.default.replaceGoogRemb(e.sdp)),t.conn.setLocalDescription(e).then(function(){r(e)}).catch(function(e){n(e)})}).catch(function(e){n(e)})})}},{key:"_getStreamData",value:function(){return new f.default(this._streamConfig)}},{key:"_startConnect",value:function(e){var t=this;this._createPeerConnection(),this._streamId=e.id;var r=null,n=null,i=null;return e.getTracks().forEach(function(e){if("audio"==e.kind)r=e;else{var o=t._deviceManager.getVideoTrackType(e.id);C.default.ScreenShareVideo===o?i=e:C.default.LargeVideo===o&&(n=e)}}),r&&(this._rtpSenderAudio=this.conn.addTrack(r,e),this._startMixing()),n&&(this._rtpSenderCameraLarge=this.conn.addTrack(n,e)),i&&(this._rtpSenderScreen=this.conn.addTrack(i,e)),this._pcMonitor=new b.default(this.conn,this._common,this._log,this._userId,this._authInfo.publishCallId,this._rtpSenderAudio,this._rtpSenderCameraLarge,this._rtpSenderScreen),this._createOffer({})}},{key:"_updateStreamConfig",value:function(){if(this.conn)if(this._streamConfig.length)for(var e=0;e0?n(e):setTimeout(r,1e3)}()}).catch(function(e){i(e)})})}},{key:"_iceCandidateByOffer",value:function(e,t){var r=this;return new Promise(function(n,i){var o={completed:!!e};e||(o.candidate={sdpMLineIndex:t.sdpMLineIndex,sdpMid:t.sdpMid,candidate:t.candidate}),r._signalingManager.iceCandidate(null,null,JSON.stringify(o)).then(function(e){n(e)}).catch(function(e){i(e)})})}},{key:"_releaseMonitor",value:function(){this._pcMonitor&&(this._pcMonitor.releaseMonitor(),this._pcMonitor=null)}},{key:"_setEncodParams",value:function(){for(var e=this.conn.getSenders(),t=0;t=30||this._firstReport&&this._timerIndex>=5)&&(this._firstReport&&(this._firstReport=!1),this._reportPoint(),this._timerIndex=0),this._monitor){this._monitor.getStats();var e=this._monitorData.cacheData();this._common.dispatchEvent(m.default.OnMedia,{userId:"0",data:e})}++this._timerIndex}},{key:"_reportPoint",value:function(){var e=this._monitorData.callid,t=this._monitorData.getPublishAudioData();t&&this._log.reportPublishDataMonitor(e,t);var r=this._monitorData.getCameraLargeData();r&&this._log.reportPublishDataMonitor(e,r);var n=this._monitorData.getScreenData();n&&this._log.reportPublishDataMonitor(e,n);var i=this._monitorData.getNetworkData();i&&this._log.reportPublishNewtWorkMonitor(i)}},{key:"releaseMonitor",value:function(){this._reportPoint(),c(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"releaseMonitor",this).call(this)}}]),t}(l.default);t.default=v},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r0&&(t<=10?this._rtt=t:t<=1e4&&(this._rtt=t/1e3)),this._availableOutgoingBitrate=r,0!=this._lastTimeStamp){var o=(e-this._lastTimeStamp)/1e3;o>0&&(this._bytesReceivedPerSecond=Math.round((n-this._bytesReceived)/o),this._bytesSentPerSecond=Math.round((i-this._bytesSent)/o))}this._bytesReceived=n,this._bytesSent=i,this._lastTimeStamp=e}},{key:"updateNetworkInfo",value:function(e,t,r,n,i){this._ip=t,this._port=r,this._protocol=n,this._networkType=i}},{key:"updateAudioCodec",value:function(e){e&&(this._audioEncodeSampleRate=e.clockRate?e.clockRate:-1,this._senderAudioData.updateParameters(e))}},{key:"updateVideoCodec",value:function(e){this._senderVideoData.updateParameters(e)}},{key:"updateLocalCandidate",value:function(e){}},{key:"callid",get:function(){return this._callId}}]),e}();t.default=p},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r0&&(this._packetsLostPerSecond=Math.round((t-this._packetsLost)/r))}this._lastPacketLostTimeStamp=e,this._packetsLost=t}},{key:"updateDataSent",value:function(e,t,r,n,i){if(this._audioTrack?i&&this._audioTrack.id!==i.id&&this._updateAudioTrack(i):this._updateAudioTrack(i),this._ssrc=n,this._lastDataSentTimeStamp&&this._bytesSent&&this._packetsSent){var o=(e-this._lastDataSentTimeStamp)/1e3;o>0&&(isNaN(t)||isNaN(this._bytesSent)?this._bytesSentPerSecond=-1:this._bytesSentPerSecond=Math.round((t-this._bytesSent)/o*8),this._packetsSentPerSecond=Math.round((r-this._packetsSent)/o))}this._lastDataSentTimeStamp=e,this._bytesSent=t,this._packetsSent=r}},{key:"updateAudioInfo",value:function(e,t,r,n){this._audioLevel=t}},{key:"updateParameters",value:function(e){this._mimeType=e.mimeType?e.mimeType.replace("audio/",""):"",this._clockRate=e.clockRate?e.clockRate:0}},{key:"_updateAudioTrack",value:function(e){this._audioTrack=e;var t=new MediaStream;t.addTrack(this._audioTrack),this._audioUtil.startAudioInputLevel(t)}},{key:"ssrc",get:function(){return this._ssrc}},{key:"codec",get:function(){return this._mimeType}},{key:"packetsSent",get:function(){return this._packetsSent}},{key:"sampleRate",get:function(){return this._clockRate}},{key:"audioBuffer",get:function(){return this._audioUtil.buffer}},{key:"packetLostRate",get:function(){return this._packetsLostPerSecond>0?(this._packetsLostPerSecond/this._packetsLostPerSecond+this._packetsSentPerSecond).toFixed(4):0}}]),e}();t.default=s},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r0&&(this._packetLostPerSecond=Math.round((t-this._packetLost)/r))}this._lastDataSentTimeStamp=e,this._packetLost=t}},{key:"updateDataSent",value:function(e,t,r,n,i,a,s){if(a){var c=a.getSettings();c?(this._frameRate=c.frameRate,this._width=c.width?c.width:0,this._height=c.height?c.height:0):this._frameRate=0}if(s&&s.encodings&&s.encodings.length?this._bitrate=s.encodings[0].maxBitrate:this._bitrate=0,this._nackCount=i,this._ssrc=n,this._lastDataSentTimeStamp&&this._bytesSent&&this._packetsSent){var u=(e-this._lastDataSentTimeStamp)/1e3;u>0&&(o.BrowserUtil.browserMainVersion<67?(this._bytesSentPerSecond=Math.round(8*(t-this._bytesSent)),this._packetsSentPerSecond=Math.round(r-this._packetsSent)):(this._bytesSentPerSecond=Math.round((t-this._bytesSent)/u*8),this._packetsSentPerSecond=Math.round((r-this._packetsSent)/u)))}this._lastDataSentTimeStamp=e,this._bytesSent=t,this._packetsSent=r}},{key:"updateVideoTrack",value:function(e,t,r,n,i){if(this._lastVideoTrackTimeStamp){var o=(i-this._lastVideoTrackTimeStamp)/1e3;this._fps=Math.round((r-this._frameSent)/o)}this._frameWidth=e,this._frameHeight=t,this._frameSent=r,this._lastVideoTrackTimeStamp=i}},{key:"updateMedisSource",value:function(e,t,r,n){this._inputWidth=e||-1,this._inputHeight=t||-1,this._inputFps=r||-1}},{key:"updateParameters",value:function(e){this._mimeType=e.mimeType?e.mimeType.replace("video/",""):"",this._clockRate=e.clockRate?e.clockRate:0}},{key:"ssrc",get:function(){return this._ssrc}},{key:"nackCount",get:function(){return this._nackCount}},{key:"frameRate",get:function(){return this._frameRate}},{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"codec",get:function(){return this._mimeType}},{key:"packetsSent",get:function(){return this._packetsSent}},{key:"bitrate",get:function(){return this._bitrate}},{key:"packetLostRate",get:function(){return this._packetLostPerSecond>0?(this._packetLostPerSecond/this._packetLostPerSecond+this._packetsSentPerSecond).toFixed(4):0}}]),e}();t.default=a},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function e(t){n(this,e),this.calid=t,this.rtt=-1,this.raddr="",this.asb=1e3,this.nwt="",this.video={src:"",isv:!1,vfps:0,teb:0,vrn:0,codec:"",w:0,h:0,vps:0},this.audio={src:"",isa:!1,codec:"",aps:0}};t.default=i},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r=0&&s<=1e8))throw this._loading=!1,new Error("Invalid position: The value range is [0,100000000]. integer only");if(this._catcheResource.has(o)){var c=this._catcheResource.get(o).slice();this._startAudioMixingWithArrayBuffer(s,c,t)}else this.loadAudioBuffer(o).then(function(e){i&&r._catcheResource.set(o,e);var n=e.slice();r._startAudioMixingWithArrayBuffer(s,n,t)}).catch(function(e){r._loading=!1,t&&t({errorCode:h.default.ERROR_LOAD_AUDIO_FAILED,message:"load audio failed"})})}else t&&t({errorCode:h.default.ERROR_AUDIO_MIXING_MISSING_PARAME,message:"filePath cannot be empty"}),this._loading=!1}else t&&t({errorCode:h.default.ERROR_AUDIO_MIXING_MISSING_PARAME,message:"option cannot be empty"}),this._loading=!1}},{key:"_startAudioMixingWithArrayBuffer",value:function(e,t,r){var n=this;this._loading=!1,this._player.play(t,e).then(function(){n.dispatchEvent(u.default.AudioMixingPlayed),r&&r()}).catch(function(e){if(r){var t=void 0;t=e&&e.code?e.code===v.ERROR_NOTSUPPORT_AUDIOCONTEXT?{errorCode:h.default.ERROR_NOTSUPPORT_AUDIOCONTEXT,message:"not support audiocontext"}:e.code===v.ERROR_AUTOPLAY_FAIL?{errorCode:h.default.ERROR_AUTOPLAY_FAIL,message:"autoplay failed"}:e.code===v.ERROR_NOT_ARRAYBUFFER?{errorCode:h.default.ERROR_NOT_ARRAYBUFFER,message:"not arraybuffer"}:{errorCode:h.default.ERROR_AUDIOMIXING_UNKNOWN_ERROR,message:"audiomixing unknown error"}:{errorCode:h.default.ERROR_AUDIOMIXING_UNKNOWN_ERROR,message:"audiomixing unknown error"},r(t)}})}},{key:"stopAudioMixing",value:function(e){if(this._loading)return void(e&&e({errorCode:h.default.ERROR_INVALID_AUDIO_MIXING_STATE,message:"loading state can not use stopAudioMixing"}));this._player.state===m.default.Playing||this._player.state===m.default.Pause?(this._player.stop(),e&&e()):e&&e({errorCode:h.default.ERROR_INVALID_AUDIO_MIXING_STATE,message:"only playing or pause state can use stopAudioMixing"})}},{key:"pauseAudioMixing",value:function(e){if(this._loading)return void(e&&e({errorCode:h.default.ERROR_INVALID_AUDIO_MIXING_STATE,message:"loading state can not use pauseAudioMixing"}));this._player.state===m.default.Playing?(this._player.pause(),this.dispatchEvent(u.default.AudioMixingPaused),e&&e()):e&&e({errorCode:h.default.ERROR_INVALID_AUDIO_MIXING_STATE,message:"only playing state can use pauseAudioMixing"})}},{key:"resumeAudioMixing",value:function(e){var t=this;if(this._loading)return void(e&&e({errorCode:h.default.ERROR_INVALID_AUDIO_MIXING_STATE,message:"loading state can not use resumeAudioMixing"}));this._player.state===m.default.Pause?this._player.resume().then(function(){t.dispatchEvent(u.default.AudioMixingPlayed),e&&e()}).catch(function(t){e&&e({errorCode:h.default.ERROR_RESUME_AUDIO_FAIL,message:t&&t.message?t.message:"state error"})}):e&&e({errorCode:h.default.ERROR_INVALID_AUDIO_MIXING_STATE,message:"only pause state can use resumeAudioMixing"})}},{key:"adjustAudioMixingVolume",value:function(e){e=Number(e),e>100&&(e=100),e<0&&(e=0),this.volume=e/100}},{key:"setAudioMixingPosition",value:function(e,t){if(!("number"==typeof e&&e>=0&&e<=1e8))throw new Error("Invalid position: The value range is [0,100000000]. integer only");this._player.currentTime=e,this.dispatchEvent(u.default.SetAudioMixingPosition),t&&t()}},{key:"getAudioMixingDuration",value:function(){return Math.floor(this._player.duration)}},{key:"getAudioMixingCurrentPosition",value:function(){return Math.floor(this._player.currentTime)}},{key:"loadAudioBuffer",value:function(e){return new Promise(function(t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){if(n.status>400)r(n.status);else{var e=n.response;t(e)}},n.onerror=function(e){r(e)},n.ontimeout=function(){r("timeout")},n.send()})}},{key:"_onEnded",value:function(){this.dispatchEvent(u.default.AudioMixingFinished)}},{key:"bufferPlayer",get:function(){return this._player}},{key:"volume",set:function(e){this._player.volume=e}}]),t}(d.default);t.default=y},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0])||arguments[0],r={preferMaster:t},n=!1,o=(e={},i(e,f.default.ScreenShareVideo,"screen"),i(e,f.default.LargeVideo,"camera"),i(e,f.default.SmallVideo,"camera"),i(e,f.default.Audio,"audio"),e);return this._streamConfig.forEach(function(e){if(o[e.label]){var t="active"===e.state;r[o[e.label]]=r[o[e.label]]||t,t&&(n=!0)}}),n?this.subscribe(r):Promise.resolve()}},{key:"subscribe",value:function(e){return this._promiseQueue.add(this._executeSubscribe.bind(this),[e||{audio:this._configRemoteAudio,camera:this._configRemoteCameraTrack,screen:this._configRemoteScreenTrack,preferMaster:this._preferMaster}])}},{key:"_executeSubscribe",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._configRemoteAudio="boolean"==typeof t.audio?t.audio:this._configRemoteAudio,this._configRemoteCameraTrack="boolean"==typeof t.camera?t.camera:this._configRemoteCameraTrack,this._configRemoteScreenTrack="boolean"==typeof t.screen?t.screen:this._configRemoteScreenTrack,this._preferMaster="boolean"==typeof t.preferMaster?t.preferMaster:this._preferMaster,new Promise(function(t,r){var n=(new Date).getTime(),i=e._createSubscribeStreams();e._configRemoteCameraTrack||e._configRemoteScreenTrack||e._configRemoteAudio?(e._startSubTime=(new Date).getTime(),e.conn?e._reSubscribe().then(function(r){e._log.reportResubscribe(e._subscribeId,e._remoteId,i.isLargeVideo,i.isSmallVideo,i.isScreenShare,i.isAudio,0,r.tid,(new Date).getTime()-n,r.message),e._dispatchSubscribeChange(),t({subscribeCallId:r.subscribeCallId})}).catch(function(t){e._log.reportResubscribe(e._subscribeId,e._remoteId,i.isLargeVideo,i.isSmallVideo,i.isScreenShare,i.isAudio,t.errorCode,t.tid,(new Date).getTime()-n,t.message),e._log.reportOnError(t),r(t)}):e._subscribe().then(function(r){e._dispatchSubscribeChange(),t(r)}).catch(function(t){e._log.reportOnError(t),r(t)})):e._executeUnSubscribe().then(function(r){e._reset(),t(r)}).catch(function(t){e._log.reportOnError(t),r(t)})})}},{key:"_dispatchSubscribeChange",value:function(){var e={streamConfigs:this._streamConfig.map(function(e){return{label:e.label,state:e.state,type:e.type,subscribed:e.subscribed,muted:e.muted}}),userId:this._userId,displayName:this._displayName};this._common.dispatchEvent(k.default.OnSubscribeChange,e)}},{key:"unSubscribe",value:function(){return this._promiseQueue.clearQueue(),this._promiseQueue.add(this._executeUnSubscribe.bind(this))}},{key:"_executeUnSubscribe",value:function(){var e=this;return new Promise(function(t,r){var n=(new Date).getTime();e.conn?(e._mediastream=null,e._signalingManager.unsubscribe(e._subscribeId).then(function(r){e._releaseMonitor(),e._log.reportUnsubscribe(e._subscribeId,e._remoteId,(new Date).getTime()-n,0,r.tid,""),e.stopAudioInputLevel(!0),e.clear(),e._dispatchSubscribeChange(),t()}).catch(function(t){e._log.reportUnsubscribe(e._subscribeId,e._remoteId,(new Date).getTime()-n,t.code,t.tid,t.message),r(t)})):(e._log.reportUnsubscribe(e._subscribeId,e._remoteId,(new Date).getTime()-n,0,0,"当前没有订阅,直接返回取消订阅成功"),t())})}},{key:"setAudioOutput",value:function(e){var t=this;return new Promise(function(r,n){t._cameraManager.hasAudioTrack?t._cameraManager.setAudioOutput(e).then(function(){r()}).catch(function(e){n(e)}):t._screenManager.hasAudioTrack?t._screenManager.setAudioOutput(e).then(function(){r()}).catch(function(e){n(e)}):n()})}},{key:"updateStreams",value:function(e){var t=this;if(this._streamConfig.length){for(var r=!1,n=!1,i=!1,o=!1,a=!0,s=!0,c=!0,u=!0,l=0;l-1?Object.assign(t._streamConfig[p],e[l]):t._streamConfig.push(e[l])}}(l);if(a||s||c||u)for(var l=0;l-1&&t>-1)return this._preferMaster?(this._subscribeStreams.push({mslabel:this._streamConfig[e].mslabel,label:this._streamConfig[e].label,type:this._streamConfig[e].type,temporalLayer:Math.max(this._streamConfig[e].temporalLayers-1,0),substream:Math.max(this._streamConfig[e].substreams-1,0)}),this._largeVideo=!0,f.default.LargeVideo):(this._subscribeStreams.push({mslabel:this._streamConfig[t].mslabel,label:this._streamConfig[t].label,type:this._streamConfig[t].type,temporalLayer:Math.max(this._streamConfig[t].temporalLayers-1,0),substream:Math.max(this._streamConfig[t].substreams-1,0)}),this._smallVideo=!0,f.default.SmallVideo);if(e>-1)return this._subscribeStreams.push({mslabel:this._streamConfig[e].mslabel,label:this._streamConfig[e].label,type:this._streamConfig[e].type,temporalLayer:Math.max(this._streamConfig[e].temporalLayers-1,0),substream:Math.max(this._streamConfig[e].substreams-1,0)}),this._largeVideo=!0,f.default.LargeVideo;if(t>-1)return this._subscribeStreams.push({mslabel:this._streamConfig[t].mslabel,label:this._streamConfig[t].label,type:this._streamConfig[t].type,temporalLayer:Math.max(this._streamConfig[t].temporalLayers-1,0),substream:Math.max(this._streamConfig[t].substreams-1,0)}),this._smallVideo=!0,f.default.SmallVideo;if(this._streamConfig.length<=2)for(var n=0;n-1)}},{key:"remoteId",set:function(e){this._remoteId=e}},{key:"subscribeId",get:function(){return this._subscribeId}},{key:"level",get:function(){return this._common.customPlay?this._pcMonitor.audioLevel:L.BrowserUtil.isSafari||!this._cameraManager.isSameElement(null)?this._cameraManager.level:this._screenManager.isSameElement(null)?0:this._screenManager.level}},{key:"buffer",get:function(){return L.BrowserUtil.isSafari||!this._cameraManager.isSameElement(null)?this._cameraManager.buffer:this._screenManager.isSameElement(null)?0:this._screenManager.buffer}}]),t}(y.default);t.default=N},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r=30||this._firstReport&&this._timerIndex>=5)&&(this._firstReport&&(this._firstReport=!1),this._reportPoint(),this._timerIndex=0),this._monitor){this._monitor.getStats();var e=this._monitorData.cacheData();this._audioLevel=e.audio?e.audio.level:0,this._common.dispatchEvent(m.default.OnMedia,{userId:this._userId,data:e})}++this._timerIndex}},{key:"_reportPoint",value:function(){var e=this._monitor._receiverMonitorData.callId,t=this._monitor._receiverMonitorData.remoteid,r=this._monitorData.getSubscribeAudioData();r&&this._log.reportSubscribeDataMonitor(e,t,r);var n=this._monitorData.getSubscribeCameraSmallData();n&&this._log.reportSubscribeDataMonitor(e,t,n);var i=this._monitorData.getSubscribeCameraLargeData();i&&this._log.reportSubscribeDataMonitor(e,t,i);var o=this._monitorData.getSubscribeScreenData();o&&this._log.reportSubscribeDataMonitor(e,t,o);var a=this._monitorData.getNetworkData();a&&this._log.reportSubscribeNetworkMonitor(e,t,a)}},{key:"releaseMonitor",value:function(){this._reportPoint(),c(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"releaseMonitor",this).call(this)}},{key:"audioLevel",get:function(){return this._audioLevel}},{key:"callId",set:function(e){this._monitor._receiverMonitorData.callId=e}},{key:"subscribeAudio",set:function(e){this._monitorData.subscribeAudio=e}},{key:"subscribeSmallVideo",set:function(e){this._monitorData.subscribeSmallVideo=e}},{key:"subscribeLargeVideo",set:function(e){this._monitorData.subscribeLargeVideo=e}},{key:"subscribeScreenVideo",set:function(e){this._monitorData.subscribeScreenVideo=e}}]),t}(l.default);t.default=S},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r0&&0===t.dfps&&-1!==this._videoLargeDecodeErrorIndex&&++this._videoLargeDecodeErrorIndex>3&&(this._videoLargeDecodeErrorIndex=-1,this.dispatchEvent(_.default.DecodeError,h.default.LargeVideo)),this._videoSmallDecodeErrorIndex=0):this._hasCameraSmall?(e.rw&&e.rh&&(o.camera={fps:e.dfps,width:e.rw,height:e.rh}),e.rfps>0&&0===e.dfps&&-1!==this._videoSmallDecodeErrorIndex&&++this._videoSmallDecodeErrorIndex>3&&(this._videoSmallDecodeErrorIndex=-1,this.dispatchEvent(_.default.DecodeError,h.default.LargeVideo)),this._videoLargeDecodeErrorIndex=0):(this._videoLargeDecodeErrorIndex=0,this._videoSmallDecodeErrorIndex=0),this._hasScreen?(r.rw&&r.rh&&(o.screen={fps:r.dfps,width:r.rw,height:r.rh}),r.rfps>0&&0===r.dfps&&-1!==this._screenDecodeErrorIndex&&++this._screenDecodeErrorIndex>3&&(this._screenDecodeErrorIndex=-1,this.dispatchEvent(_.default.DecodeError,h.default.ScreenShareVideo))):this._screenDecodeErrorIndex=0,o}},{key:"updateCommonInfo",value:function(e,t,r,n){if(t>0&&(t<=10?this._rtt=t:t<=1e4&&(this._rtt=t/1e3)),0!=this._lastTimeStamp){var i=(e-this._lastTimeStamp)/1e3;i>0&&(this._bytesReceivedPerSecond=Math.round((r-this._bytesReceived)/i),this._bytesSentPerSecond=Math.round((n-this._bytesSent)/i))}this._lastTimeStamp=e,this._bytesReceived=r,this._bytesSent=n}},{key:"updateNetworkInfo",value:function(e,t,r,n,i){this._ip=t,this._port=r,this._protocol=n,this._networkType=i}},{key:"updateAudioCodec",value:function(e,t){this._receiverAudioData.updateAudioCodec(e,t)}},{key:"updateAudioDataReceived",value:function(e,t,r,n,i,o,a){var s=a.getSettings();s&&(this._audioSampleRate=s.sampleRate?s.sampleRate:-1,this._audioSampleSize=s.sampleSize?s.sampleSize:-1);var c=this._receiverAudioData.updateDataReceived(e,t,r,n,i,o,a);0!==c&&this.dispatchEvent(_.default.FirstPackage,{callid:this._callId,remoteid:this._remoteId,tm:c,trackid:h.default.Audio})}},{key:"onAudioTrack",value:function(e,t,r){this._receiverAudioData.onAudioTrack(e,t,r)}},{key:"updateVideoCodec",value:function(e,t,r){h.default.SmallVideo===r?this._receiverVideoSmallData.updateVideoCodec(e,t):h.default.ScreenShareVideo===r?this._receiverVideoScreenShareData.updateVideoCodec(e,t):h.default.SuperVideo!==r&&this._receiverVideoLargeData.updateVideoCodec(e,t)}},{key:"updateVideoDataReceived",value:function(e,t,r,n,i,o,a,s,c,u,l){h.default.SmallVideo===l?this._receiverVideoSmallData.updateDataReceived(e,t,r,n,i,o,a,s,c,u):h.default.ScreenShareVideo===l?this._receiverVideoScreenShareData.updateDataReceived(e,t,r,n,i,o,a,s,c,u):h.default.SuperVideo!==l&&this._receiverVideoLargeData.updateDataReceived(e,t,r,n,i,o,a,s,c,u)}},{key:"onVideoTrack",value:function(e,t,r,n,i,o,a,s,c,u){var l=0,d="";h.default.SmallVideo===a?(l=this._receiverVideoSmallData.onVideoTrack(e,t,r,n,i,o,s,c),d=h.default.SmallVideo):h.default.ScreenShareVideo===a?(l=this._receiverVideoScreenShareData.onVideoTrack(e,t,r,n,i,o,s,c),d=h.default.ScreenShareVideo):h.default.SuperVideo!==a&&(l=this._receiverVideoLargeData.onVideoTrack(e,t,r,n,i,o,s,c),d=h.default.LargeVideo),0!==l&&""!==d&&this.dispatchEvent(_.default.FirstFrame,{callid:this._callId,remoteid:this._remoteId,tm:l,trackid:d})}},{key:"onVideoCandidatePair",value:function(e,t){h.default.SmallVideo===t?this._receiverVideoSmallData.onVideoCandidatePair(e):h.default.ScreenShareVideo===t?this._receiverVideoScreenShareData.onVideoCandidatePair(e):h.default.SuperVideo!==t&&this._receiverVideoLargeData.onVideoCandidatePair(e)}},{key:"callId",set:function(e){this._callId=e},get:function(){return this._callId}},{key:"remoteid",get:function(){return this._remoteId}},{key:"subscribeAudio",set:function(e){this._hasAudioData=e}},{key:"subscribeSmallVideo",set:function(e){this._hasCameraSmall=e}},{key:"subscribeLargeVideo",set:function(e){this._hasCameraLarge=e}},{key:"subscribeScreenVideo",set:function(e){this._hasScreen=e}},{key:"videoSsrc",get:function(){return this._receiverVideoLargeData.isVideo?this._receiverVideoLargeData.ssrc:this._receiverVideoSmallData.isVideo?this._receiverVideoSmallData.ssrc:""}},{key:"isVideo",get:function(){return this._receiverVideoSmallData.isVideo||this._receiverVideoLargeData.isVideo}},{key:"isVideoScreenShare",get:function(){return this._receiverVideoScreenShareData.isVideo}},{key:"videoPacketsLostRate",get:function(){return this._receiverVideoLargeData.isVideo?this._receiverVideoLargeData.packetsLostRate:this._receiverVideoSmallData.isVideo?this._receiverVideoSmallData.packetsLostRate:0}},{key:"videoFrameRate",get:function(){return this._receiverVideoLargeData.isVideo?this._receiverVideoLargeData.frameRate:this._receiverVideoSmallData.isVideo?this._receiverVideoSmallData.frameRate:0}},{key:"videoCodec",get:function(){return this._receiverVideoLargeData.isVideo?this._receiverVideoLargeData.mimeType:this._receiverVideoSmallData.isVideo?this._receiverVideoSmallData.mimeType:this._receiverVideoScreenShareData.mimeType}},{key:"videoNackCount",get:function(){return this._receiverVideoLargeData.isVideo?this._receiverVideoLargeData.nackCount:this._receiverVideoSmallData.isVideo?this._receiverVideoSmallData.nackCount:0}},{key:"videoPliCount",get:function(){return this._receiverVideoLargeData.isVideo?this._receiverVideoLargeData.pliCount:this._receiverVideoSmallData.isVideo?this._receiverVideoSmallData.pliCount:0}},{key:"videoFirCount",get:function(){return this._receiverVideoLargeData.isVideo?this._receiverVideoLargeData.firCount:this._receiverVideoSmallData.isVideo?this._receiverVideoSmallData.firCount:0}},{key:"videoBytesReceivedPerSecond",get:function(){return this._receiverVideoLargeData.isVideo?this._receiverVideoLargeData.bytesReceivedPerSecond:this._receiverVideoSmallData.isVideo?this._receiverVideoSmallData.bytesReceivedPerSecond:0}},{key:"availableBandwidth",get:function(){return this._receiverVideoLargeData.isVideo?this._receiverVideoLargeData.availableBandwidth:this._receiverVideoSmallData.isVideo?this._receiverVideoSmallData.availableBandwidth:this._receiverVideoScreenShareData.isVideo?this._receiverVideoScreenShareData.availableBandwidth:0}}]),t}(v.default);t.default=y},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r0?(new Date).getTime():0,c=(e-this._lastDataReceivedTimeStamp)/1e3;if(c>0&&this._lastDataReceivedTimeStamp&&this._bytesReceived&&this._packetsReceived&&(this._bytesReceivedPerSecond=Math.round((t-this._bytesReceived)/c*8),this._packetsReceivedPerSecond=Math.round((r-this._packetsReceived)/c),this._startAudioInputLevel||(this._startAudioInputLevel=!0,this._audioTrack?a&&this._audioTrack.id!==a.id&&this._updateAudioTrack(a):this._updateAudioTrack(a))),i>this._packetsLost){var u=i-this._packetsLost,l=r-this._packetsReceived;this._packetsLostRate=u>0?(u/(l+u)).toFixed(4):0,c>0&&(this._packetsLostPerSecond=Math.round((i-this._packetsLost)/c))}else this._packetsLostPerSecond=0,this._packetsLostRate=0;return this._packetsLost=i,this._lastDataReceivedTimeStamp=e,this._bytesReceived=t,this._packetsReceived=r,s}},{key:"onAudioTrack",value:function(e,t,r){}},{key:"_updateAudioTrack",value:function(e){this._audioTrack=e;var t=new MediaStream;t.addTrack(this._audioTrack),this._audioUtil.startAudioInputLevel(t)}},{key:"ssrc",get:function(){return this._ssrc}},{key:"packetsLostRate",get:function(){return this._packetsLostRate}},{key:"mimeType",get:function(){return this._mimeType}},{key:"bytesReceivedPerSecond",get:function(){return this._bytesReceivedPerSecond.toFixed(1)}},{key:"packetsReceivedPerSecond",get:function(){return this._packetsReceivedPerSecond}},{key:"audioBuffer",get:function(){this._audioUtil.buffer}}]),e}();t.default=s},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r0&&(this._bytesReceivedPerSecond=Math.round((t-this._bytesReceived)/l*8),this._packetsReceivedPerSecond=Math.round((r-this._packetsReceived)/l)),i>this._packetsLost){var d=i-this._packetsLost,f=r-this._packetsReceived;this._packetsLostRate=d>0?(d/(f+d)).toFixed(4):0,l>0&&(this._packetsLostPerSecond=Math.round(d/l))}else this._packetsLostRate=0,this._packetsLostPerSecond=0;this._packetsLost=i,this._lastDataReceivedTimeStamp=e,this._bytesReceived=t,this._packetsReceived=r}},{key:"onVideoTrack",value:function(e,t,r,n,i,o,a,s){this._jitter=s>0?Math.round(a/s*1e3):0;var c=0===this._framesDecoded&&i>0?(new Date).getTime():0;if(this._width=void 0==r?this._width:r,this._height=void 0==n?this._height:n,this._lastFrameReceivedTimeStamp&&this._framesReceived){var u=(e-this._lastFrameReceivedTimeStamp)/1e3;this._framesReceivedPerSecond=Math.round((t-this._framesReceived)/u),this._framesDecodedPerSecond=Math.round((i-this._framesDecoded)/u)}return r&&n&&(this._isVideo=!0),this._lastFrameReceivedTimeStamp=e,this._framesReceived=t,this._framesDecoded=i,this._framesDropped=o,c}},{key:"onVideoCandidatePair",value:function(e){this._availableBandwidth=e}},{key:"isVideo",get:function(){return this._isVideo}},{key:"frameRate",get:function(){return this._frameRate}},{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"ssrc",get:function(){return this._ssrc}},{key:"codec",get:function(){return this._mimeType}},{key:"packetsReceived",get:function(){return this._packetsReceived}},{key:"packetsLostRate",get:function(){return this._packetsLostRate}},{key:"mimeType",get:function(){return this._mimeType}},{key:"nackCount",get:function(){return this._nackCount}},{key:"pliCount",get:function(){return this._pliCount}},{key:"firCount",get:function(){return this._firCount}},{key:"bytesReceivedPerSecond",get:function(){return this._bytesReceivedPerSecond}},{key:"packetsReceivedPerSecond",get:function(){return this._packetsReceivedPerSecond}},{key:"availableBandwidth",get:function(){return this._availableBandwidth}}]),e}();t.default=s},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function e(){n(this,e),this.trackid="",this.src="",this.fps=0,this.teb=0,this.vrn=0,this.codec="",this.w=0,this.h=0,this.vps=0};t.default=i},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=_.CHROME)return!0}else if(f.BrowserUtil.isEdge&&f.BrowserUtil.browserMainVersion>=_.EDGE)return!0;return!1}},{key:"_checkIosSystemVersion",value:function(){var e=f.SystemUtil.systemVersion,t=e.split(".");return!!(t&&t.length>=2&&"14"==t[0]&&"2"==t[1])}},{key:"supportH264",get:function(){return this._supportH264}},{key:"hasVideoDevice",get:function(){return this._hasVideoDevice}},{key:"needSDPUnified",get:function(){return this._needSDPUnified}},{key:"checkresult",get:function(){var e={isSupported:this._isSupport,system:f.SystemUtil.systemName,browser:f.BrowserUtil.browserName,browser_version:f.BrowserUtil.browserVersion,audioDevice:this._hasAudioDevice,supportScreenShare:p.default.isSupportScreenShare(),supportMixBackgroundAudio:this._isSupportMixBackgroundAudio(),isElectron:f.BrowserUtil.isElectron,supportH264:this._supportH264};return this._isAudioOnly||(e.videoDevice=this._hasVideoDevice),this._isSupport||(e.message=this._message,e.errorCode=this._errorCode),e}}]),e}()},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r=700?e._performanceState?++e._performanceCount>=3&&(e._performanceState=!1,e._performanceCount=0,e._visibilitychangeEvent()):e._performanceCount=0:e._performanceState?e._performanceCount=0:++e._performanceCount>=3&&(e._performanceCount=0,e._performanceState=!0,e._visibilitychangeEvent()),e._oldTimestamp=t},500),document.addEventListener("visibilitychange",this._visibilitychangeEvent)}},{key:"stopPerformanceInterval",value:function(){this._performanceInterval&&(clearInterval(this._performanceInterval),this._performanceInterval=null,this._performanceState=!0,this._performanceCount=0),document.removeEventListener("visibilitychange",this._visibilitychangeEvent)}},{key:"_visibilitychangeEvent",value:function(){this._log({evetid:a.default.MINIMIZE,args:this._data2String({vc:"visible"===document.visibilityState?1:0,pfm:this._performanceState?1:0})})}},{key:"_log",value:function(e){e&&(e.tm=(new Date).getTime()),this._logClient.sendReport(e)}},{key:"_data2String",value:function(e){var t="";for(var r in e)t.length&&(t+="&"),t+=r+"="+e[r];return t}}]),e}();t.default=c},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.LogClient=void 0;var o=function(){function e(e,t){for(var r=0;r=parseInt(this._config.log_type_ratio))this._config.log_type=0;else{var n=void 0;n=window&&window.location&&window.location.protocol&&"http:"===window.location.protocol?"ws:":"wss:",n+="logprod.aliyuncs.com/binlog",this._wsClient=new d.LogReporter({wsUrl:n,product:1}),this._wsClient.on("onReconnect",function(){t.sendReport({evetid:h.default.LOGGATE_FAIL,tm:(new Date).getTime(),args:t._data2String({state:1})})}),this._wsClient.on("onError",function(e){t._config.log_type=0,t.sendReport({evetid:h.default.LOGGATE_FAIL,tm:(new Date).getTime(),args:t._data2String({state:0})}),e&&e.length&&e.forEach(function(e){t._sendReport(e)})})}}else this._config.log_type=0}},{key:"_initParam",value:function(){this._param||(this._param={osn:a.SystemUtil.systemName,osv:a.SystemUtil.systemVersion,udid:a.LocalStorage.uuid,statsvrs:"0.6.1",sdkvrs:c.default.version,dm:a.BrowserUtil.domain,bt:a.BrowserUtil.browserName,envir:c.default.evn,bv:a.BrowserUtil.browserVersion})}},{key:"_realSendReport",value:function(e){var t={};for(var r in this._param)t[r]=this._param[r];for(var n in e)t[n]=e[n];t.idx=this._index,this._sendReport(t),++this._index}},{key:"_sendReport",value:function(e){1===this._config.log_type?this._wsClient&&this._wsClient.send(e):this._slsClient&&this._slsClient.sendReport(e)}}]),e}()},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.SlsClient=void 0;var a=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]&&arguments[0];if(this._ready){var t=e?this._messageCache.getAllCache():this._messageCache.getCache(10);if(t.length){var r=null,n=Date.parse(new Date).toString();n=parseInt(n.substr(0,10));var i={Logs:[],Topic:"Event Track"};if(t.forEach(function(e){i.Logs.push({Time:n,Contents:Object.keys(e).map(function(t){var r=String(e[t]),n={Key:t,Value:r},i=C.verify(n);if(i)throw i;return n})})}),r=R.verify(i))throw new Error(r);var o=R.create(i),a=R.encode(o).finish(),s=h.deflate(a),c=a.byteLength,u="/logstores/"+this._tokenManager.log_store_stats+"/shards/lb";return this._postSlsLog("POST",this._tokenManager.project,u,{},s,c)}}}},{key:"_postSlsLog",value:function(e,t,r,n,i,o){var a=t?t+".":"",s=(n?"?"+S.stringify(n):"").replace(/\?$/,""),c=window.location.href.indexOf("file://")>-1?"http://":"//",u=""+c+a+this._tokenManager.endPoint+r+s,l=(new Date).toUTCString(),d={"Content-Type":"application/x-protobuf","x-log-compresstype":"deflate","x-log-bodyrawsize":o,Date:l,Host:""+a+this._tokenManager.endPoint,"x-log-apiversion":"0.6.0","x-log-signaturemethod":"hmac-sha1",Authorization:"","x-acs-security-token":this._tokenManager.security_token};i&&(d["Content-MD5"]=(0,g.default)(i).toUpperCase(),d["Content-Length"]=i.length),d.Authorization=this._sign(e,r,n,d),d["x-log-date"]=l;var f={method:e,body:i,headers:d};this._excuteFetch(u,f,0)}},{key:"_excuteFetch",value:function(e,t,r){var n=this;return new Promise(function(i,o){fetch(e,t).then(function(e){i(e)}).catch(function(i){++r<=3&&setTimeout(function(){n._excuteFetch(e,t,r)},500*(r+1))})})}},{key:"_sign",value:function(e,t,r,n){var i=n["Content-MD5"]||"",o=n["Content-Type"]||"",a=n.Date,s=this._getCanonicalizedHeaders(n),c=this._getCanonicalizedResource(t,r),u=[e,i,o,a,""+s+c].join("\n"),l=v.default.stringify(k.HmacSHA1(u,this._tokenManager.access_key_secret));return"LOG "+this._tokenManager.access_key_id+":"+l}},{key:"_onUploadTimer",value:function(){this._uploadSlsLog()}},{key:"clear",value:function(){this._uploadTimerId&&(clearInterval(this._uploadTimerId),this._uploadTimerId=0)}},{key:"_getCanonicalizedHeaders",value:function(e){for(var t=Object.keys(e),r=[],n=0;n0&&void 0!==arguments[0]?arguments[0]:3e4;this._delayTimerId||(this._delayTimerId=setTimeout(function(){e._stopRequest(),e._requestStsToken()},t))}},{key:"_stopDelayTimer",value:function(){this._delayTimerId&&(clearTimeout(this._delayTimerId),this._delayTimerId=0)}},{key:"_updateNewStsData",value:function(e){this._stsData.updateData(e),this._checkToken()}},{key:"_checkToken",value:function(){var e=this;if(this._updateState)if(this._stsData.expiration){var t=(new Date).getTime()/1e3,r=this._stsData.expiration-t;r<=600?this._requestStsToken():this._checkTokenTimerId||(this._checkTokenTimerId=setTimeout(function(){e._stopCheckTokenTimer(),e._checkToken()},3e5)),r<0?this._callback({state:0}):this._callback({state:1})}else this._requestStsToken()}},{key:"_stopCheckTokenTimer",value:function(){this._checkTokenTimerId&&(clearTimeout(this._checkTokenTimerId),this._checkTokenTimerId=0)}},{key:"security_token",get:function(){return this._stsData.security_token}},{key:"endPoint",get:function(){return this._stsData.region_endpoint}},{key:"project",get:function(){return this._stsData.project}},{key:"log_store_stats",get:function(){return this._stsData.log_store_stats}},{key:"access_key_id",get:function(){return this._stsData.access_key_id}},{key:"access_key_secret",get:function(){return this._stsData.access_key_secret}}]),e}()},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r0){return(new Date).getTime()/1e3-this._expiration>0}return!1}}]),e}()},function(e,t,r){"use strict";e.exports=r(140)},function(e,t,r){"use strict";var n=e.exports=r(141);n.build="full",n.tokenize=r(68),n.parse=r(155),n.common=r(156),n.Root._configure(n.Type,n.parse,n.common)},function(e,t,r){"use strict";function n(e,t,r){return"function"==typeof t?(r=t,t=new o.Root):t||(t=new o.Root),t.load(e,r)}function i(e,t){return t||(t=new o.Root),t.loadSync(e)}var o=e.exports=r(142);o.build="light",o.load=n,o.loadSync=i,o.encoder=r(63),o.decoder=r(64),o.verifier=r(65),o.converter=r(66),o.ReflectionObject=r(19),o.Namespace=r(25),o.Root=r(44),o.Enum=r(13),o.Type=r(39),o.Field=r(18),o.OneOf=r(26),o.MapField=r(40),o.Service=r(41),o.Method=r(42),o.Message=r(43),o.wrappers=r(67),o.types=r(20),o.util=r(3),o.ReflectionObject._configure(o.Root),o.Namespace._configure(o.Type,o.Service,o.Enum),o.Root._configure(o.Type),o.Field._configure(o.Type)},function(e,t,r){"use strict";function n(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}var i=t;i.build="minimal",i.Writer=r(37),i.BufferWriter=r(149),i.Reader=r(38),i.BufferReader=r(150),i.util=r(14),i.rpc=r(61),i.roots=r(62),i.configure=n,n()},function(e,t,r){"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var i=new Array(64),o=new Array(123),a=0;a<64;)o[i[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;n.encode=function(e,t,r){for(var n,o=null,a=[],s=0,c=0;t>2],n=(3&u)<<4,c=1;break;case 1:a[s++]=i[n|u>>4],n=(15&u)<<2,c=2;break;case 2:a[s++]=i[n|u>>6],a[s++]=i[63&u],c=0}s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),s=0)}return c&&(a[s++]=i[n],a[s++]=61,1===c&&(a[s++]=61)),o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join("")):String.fromCharCode.apply(String,a.slice(0,s))};n.decode=function(e,t,r){for(var n,i=r,a=0,s=0;s1)break;if(void 0===(c=o[c]))throw Error("invalid encoding");switch(a){case 0:n=c,a=1;break;case 1:t[r++]=n<<2|(48&c)>>4,n=c,a=2;break;case 2:t[r++]=(15&n)<<4|(60&c)>>2,n=c,a=3;break;case 3:t[r++]=(3&n)<<6|c,a=0}}if(1===a)throw Error("invalid encoding");return r-i},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},function(e,t,r){"use strict";function n(){this._listeners={}}e.exports=n,n.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},n.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>3.4028234663852886e38)e((i<<31|2139095040)>>>0,r,n);else if(t<1.1754943508222875e-38)e((i<<31|Math.round(t/1.401298464324817e-45))>>>0,r,n);else{var o=Math.floor(Math.log(t)/Math.LN2),a=8388607&Math.round(t*Math.pow(2,-o)*8388608);e((i<<31|o+127<<23|a)>>>0,r,n)}}function r(e,t,r){var n=e(t,r),i=2*(n>>31)+1,o=n>>>23&255,a=8388607&n;return 255===o?a?NaN:i*(1/0):0===o?1.401298464324817e-45*i*a:i*Math.pow(2,o-150)*(a+8388608)}e.writeFloatLE=t.bind(null,i),e.writeFloatBE=t.bind(null,o),e.readFloatLE=r.bind(null,a),e.readFloatBE=r.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){function t(e,t,r){o[0]=e,t[r]=a[0],t[r+1]=a[1],t[r+2]=a[2],t[r+3]=a[3],t[r+4]=a[4],t[r+5]=a[5],t[r+6]=a[6],t[r+7]=a[7]}function r(e,t,r){o[0]=e,t[r]=a[7],t[r+1]=a[6],t[r+2]=a[5],t[r+3]=a[4],t[r+4]=a[3],t[r+5]=a[2],t[r+6]=a[1],t[r+7]=a[0]}function n(e,t){return a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],o[0]}function i(e,t){return a[7]=e[t],a[6]=e[t+1],a[5]=e[t+2],a[4]=e[t+3],a[3]=e[t+4],a[2]=e[t+5],a[1]=e[t+6],a[0]=e[t+7],o[0]}var o=new Float64Array([-0]),a=new Uint8Array(o.buffer),s=128===a[7];e.writeDoubleLE=s?t:r,e.writeDoubleBE=s?r:t,e.readDoubleLE=s?n:i,e.readDoubleBE=s?i:n}():function(){function t(e,t,r,n,i,o){var a=n<0?1:0;if(a&&(n=-n),0===n)e(0,i,o+t),e(1/n>0?0:2147483648,i,o+r);else if(isNaN(n))e(0,i,o+t),e(2146959360,i,o+r);else if(n>1.7976931348623157e308)e(0,i,o+t),e((a<<31|2146435072)>>>0,i,o+r);else{var s;if(n<2.2250738585072014e-308)s=n/5e-324,e(s>>>0,i,o+t),e((a<<31|s/4294967296)>>>0,i,o+r);else{var c=Math.floor(Math.log(n)/Math.LN2);1024===c&&(c=1023),s=n*Math.pow(2,-c),e(4503599627370496*s>>>0,i,o+t),e((a<<31|c+1023<<20|1048576*s&1048575)>>>0,i,o+r)}}}function r(e,t,r,n,i){var o=e(n,i+t),a=e(n,i+r),s=2*(a>>31)+1,c=a>>>20&2047,u=4294967296*(1048575&a)+o;return 2047===c?u?NaN:s*(1/0):0===c?5e-324*s*u:s*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,i,0,4),e.writeDoubleBE=t.bind(null,o,4,0),e.readDoubleLE=r.bind(null,a,0,4),e.readDoubleBE=r.bind(null,s,4,0)}(),e}function i(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function o(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function a(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=n(n)},function(e,t,r){"use strict";var n=t;n.length=function(e){for(var t=0,r=0,n=0;n191&&n<224?o[a++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[a++]=55296+(n>>10),o[a++]=56320+(1023&n)):o[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join("")):String.fromCharCode.apply(String,o.slice(0,a))},n.write=function(e,t,r){for(var n,i,o=r,a=0;a>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(i=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&i),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-o}},function(e,t,r){"use strict";function n(e,t,r){var n=r||8192,i=n>>>1,o=null,a=n;return function(r){if(r<1||r>i)return e(r);a+r>n&&(o=e(n),a=0);var s=t.call(o,a,a+=r);return 7&a&&(a=1+(7|a)),s}}e.exports=n},function(e,t,r){"use strict";function n(e,t){this.lo=e>>>0,this.hi=t>>>0}e.exports=n;var i=r(14),o=n.zero=new n(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var a=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var r=e>>>0,i=(e-r)/4294967296>>>0;return t&&(i=~i>>>0,r=~r>>>0,++r>4294967295&&(r=0,++i>4294967295&&(i=0))),new n(r,i)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if(i.isString(e)){if(!i.Long)return n.fromNumber(parseInt(e,10));e=i.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):o},n.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},n.prototype.toLong=function(e){return i.Long?new i.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;n.fromHash=function(e){return e===a?o:new n((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},n.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},n.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},n.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},function(e,t,r){"use strict";function n(){o.call(this)}function i(e,t,r){e.length<40?a.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}e.exports=n;var o=r(37);(n.prototype=Object.create(o.prototype)).constructor=n;var a=r(14);n._configure=function(){n.alloc=a._Buffer_allocUnsafe,n.writeBytesBuffer=a.Buffer&&a.Buffer.prototype instanceof Uint8Array&&"set"===a.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n>>0;return this.uint32(t),t&&this._push(n.writeBytesBuffer,t,e),this},n.prototype.string=function(e){var t=a.Buffer.byteLength(e);return this.uint32(t),t&&this._push(i,t,e),this},n._configure()},function(e,t,r){"use strict";function n(e){i.call(this,e)}e.exports=n;var i=r(38);(n.prototype=Object.create(i.prototype)).constructor=n;var o=r(14);n._configure=function(){o.Buffer&&(n.prototype._slice=o.Buffer.prototype.slice)},n.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},n._configure()},function(e,t,r){"use strict";function n(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}e.exports=n;var i=r(14);(n.prototype=Object.create(i.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function e(t,r,n,o,a){if(!o)throw TypeError("request must be specified");var s=this;if(!a)return i.asPromise(e,s,t,r,n,o);if(!s.rpcImpl)return void setTimeout(function(){a(Error("already ended"))},0);try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](o).finish(),function(e,r){if(e)return s.emit("error",e,t),a(e);if(null===r)return void s.end(!0);if(!(r instanceof n))try{r=n[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",r,t),a(null,r)})}catch(e){return s.emit("error",e,t),void setTimeout(function(){a(e)},0)}},n.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},function(e,t,r){"use strict";function n(e,t){function r(e){if("string"!=typeof e){var t=i();if(n.verbose&&console.log("codegen: "+t),t="return "+t,e){for(var a=Object.keys(e),s=new Array(a.length+1),c=new Array(a.length),u=0;u0&&".."!==t[o-1]?t.splice(--o,2):r?t.splice(o,1):++o:"."===t[o]?t.splice(o,1):++o;return n+t.join("/")};n.resolve=function(e,t,r){return r||(t=o(t)),i(t)?t:(r||(e=o(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?o(e+"/"+t):t)}},function(e,t,r){"use strict";function n(e,t,r){function R(e,t,r){var i=n.filename;return r||(n.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(i?i+", ":"")+"line "+ee.line+")")}function E(){var e,t=[];do{if('"'!==(e=te())&&"'"!==e)throw R(e);t.push(te()),ie(e),e=ne()}while('"'===e||"'"===e);return t.join("")}function T(e){var t=te();switch(t){case"'":case'"':return re(t),E();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return P(t,!0)}catch(r){if(e&&w.test(t))return t;throw R(t,"value")}}function O(e,t){var r,n;do{!t||'"'!==(r=ne())&&"'"!==r?e.push([n=A(te()),ie("to",!0)?A(te()):n]):e.push(E())}while(ie(",",!0));ie(";")}function P(e,t){var r=1;switch("-"===e.charAt(0)&&(r=-1,e=e.substring(1)),e){case"inf":case"INF":case"Inf":return r*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(_.test(e))return r*parseInt(e,10);if(v.test(e))return r*parseInt(e,16);if(g.test(e))return r*parseInt(e,8);if(S.test(e))return r*parseFloat(e);throw R(e,"number",t)}function A(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw R(e,"id");if(m.test(e))return parseInt(e,10);if(y.test(e))return parseInt(e,16);if(b.test(e))return parseInt(e,8);throw R(e,"id")}function I(e,t){switch(t){case"option":return U(e,t),ie(";"),!0;case"message":return D(e,t),!0;case"enum":return V(e,t),!0;case"service":return G(e,t),!0;case"extend":return q(e,t),!0}return!1}function M(e,t,r){var i=ee.line;if(e&&("string"!=typeof e.comment&&(e.comment=oe()),e.filename=n.filename),ie("{",!0)){for(var o;"}"!==(o=te());)t(o);ie(";",!0)}else r&&r(),ie(";"),e&&("string"!=typeof e.comment||$)&&(e.comment=oe(i)||e.comment)}function D(e,t){if(!k.test(t=te()))throw R(t,"type name");var r=new a(t);M(r,function(e){if(!I(r,e))switch(e){case"map":N(r);break;case"required":case"repeated":x(r,e);break;case"optional":se?x(r,"proto3_optional"):x(r,"optional");break;case"oneof":j(r,e);break;case"extensions":O(r.extensions||(r.extensions=[]));break;case"reserved":O(r.reserved||(r.reserved=[]),!0);break;default:if(!se||!w.test(e))throw R(e);re(e),x(r,"optional")}}),e.add(r)}function x(e,t,r){var n=te();if("group"===n)return void L(e,t);if(!w.test(n))throw R(n,"type");var i=te();if(!k.test(i))throw R(i,"name");i=ue(i),ie("=");var o=new s(i,A(te()),n,t,r);if(M(o,function(e){if("option"!==e)throw R(e);U(o,e),ie(";")},function(){W(o)}),"proto3_optional"===t){var a=new u("_"+i);o.setOption("proto3_optional",!0),a.add(o),e.add(a)}else e.add(o);se||!o.repeated||void 0===h.packed[n]&&void 0!==h.basic[n]||o.setOption("packed",!1,!0)}function L(e,t){var r=te();if(!k.test(r))throw R(r,"name");var i=p.lcFirst(r);r===i&&(r=p.ucFirst(r)),ie("=");var o=A(te()),c=new a(r);c.group=!0;var u=new s(i,o,r,t);u.filename=n.filename,M(c,function(e){switch(e){case"option":U(c,e),ie(";");break;case"required":case"repeated":x(c,e);break;case"optional":se?x(c,"proto3_optional"):x(c,"optional");break;default:throw R(e)}}),e.add(c).add(u)}function N(e){ie("<");var t=te();if(void 0===h.mapKey[t])throw R(t,"type");ie(",");var r=te();if(!w.test(r))throw R(r,"type");ie(">");var n=te();if(!k.test(n))throw R(n,"name");ie("=");var i=new c(ue(n),A(te()),t,r);M(i,function(e){if("option"!==e)throw R(e);U(i,e),ie(";")},function(){W(i)}),e.add(i)}function j(e,t){if(!k.test(t=te()))throw R(t,"name");var r=new u(ue(t));M(r,function(e){"option"===e?(U(r,e),ie(";")):(re(e),x(r,"optional"))}),e.add(r)}function V(e,t){if(!k.test(t=te()))throw R(t,"name");var r=new l(t);M(r,function(e){switch(e){case"option":U(r,e),ie(";");break;case"reserved":O(r.reserved||(r.reserved=[]),!0);break;default:B(r,e)}}),e.add(r)}function B(e,t){if(!k.test(t))throw R(t,"name");ie("=");var r=A(te(),!0),n={};M(n,function(e){if("option"!==e)throw R(e);U(n,e),ie(";")},function(){W(n)}),e.add(t,r,n.comment)}function U(e,t){var r=ie("(",!0);if(!w.test(t=te()))throw R(t,"name");var n,i=t,o=i;r&&(ie(")"),i="("+i+")",o=i,t=ne(),C.test(t)&&(n=t.substr(1),i+=t,te())),ie("="),z(e,o,F(e,i),n)}function F(e,t){if(ie("{",!0)){for(var r={};!ie("}",!0);){if(!k.test(Z=te()))throw R(Z,"name");var n,i=Z;"{"===ne()?n=F(e,t+"."+Z):(ie(":"),"{"===ne()?n=F(e,t+"."+Z):(n=T(!0),H(e,t+"."+Z,n)));var o=r[i];o&&(n=[].concat(o).concat(n)),r[i]=n,ie(",",!0)}return r}var a=T(!0);return H(e,t,a),a}function H(e,t,r){e.setOption&&e.setOption(t,r)}function z(e,t,r,n){e.setParsedOption&&e.setParsedOption(t,r,n)}function W(e){if(ie("[",!0)){do{U(e,"option")}while(ie(",",!0));ie("]")}return e}function G(e,t){if(!k.test(t=te()))throw R(t,"service name");var r=new d(t);M(r,function(e){if(!I(r,e)){if("rpc"!==e)throw R(e);J(r,e)}}),e.add(r)}function J(e,t){var r=oe(),n=t;if(!k.test(t=te()))throw R(t,"name");var i,o,a,s,c=t;if(ie("("),ie("stream",!0)&&(o=!0),!w.test(t=te()))throw R(t);if(i=t,ie(")"),ie("returns"),ie("("),ie("stream",!0)&&(s=!0),!w.test(t=te()))throw R(t);a=t,ie(")");var u=new f(c,n,i,a,o,s);u.comment=r,M(u,function(e){if("option"!==e)throw R(e);U(u,e),ie(";")}),e.add(u)}function q(e,t){if(!w.test(t=te()))throw R(t,"reference");var r=t;M(null,function(t){switch(t){case"required":case"repeated":x(e,t,r);break;case"optional":se?x(e,"proto3_optional",r):x(e,"optional",r);break;default:if(!se||!w.test(t))throw R(t);re(t),x(e,"optional",r)}})}t instanceof o||(r=t,t=new o),r||(r=n.defaults);for(var X,K,Q,Y,Z,$=r.preferTrailingComment||!1,ee=i(e,r.alternateCommentMode||!1),te=ee.next,re=ee.push,ne=ee.peek,ie=ee.skip,oe=ee.cmnt,ae=!0,se=!1,ce=t,ue=r.keepCase?function(e){return e}:p.camelCase;null!==(Z=te());)switch(Z){case"package":if(!ae)throw R(Z);!function(){if(void 0!==X)throw R("package");if(X=te(),!w.test(X))throw R(X,"name");ce=ce.define(X),ie(";")}();break;case"import":if(!ae)throw R(Z);!function(){var e,t=ne();switch(t){case"weak":e=Q||(Q=[]),te();break;case"public":te();default:e=K||(K=[])}t=E(),ie(";"),e.push(t)}();break;case"syntax":if(!ae)throw R(Z);!function(){if(ie("="),Y=E(),!(se="proto3"===Y)&&"proto2"!==Y)throw R(Y,"syntax");ie(";")}();break;case"option":U(ce,Z),ie(";");break;default:if(I(ce,Z)){ae=!1;continue}throw R(Z)}return n.filename=null,{package:X,imports:K,weakImports:Q,syntax:Y,root:t}}e.exports=n,n.filename=null,n.defaults={keepCase:!1};var i=r(68),o=r(44),a=r(39),s=r(18),c=r(40),u=r(26),l=r(13),d=r(41),f=r(42),h=r(20),p=r(3),_=/^[1-9][0-9]*$/,m=/^-?[1-9][0-9]*$/,v=/^0[x][0-9a-fA-F]+$/,y=/^-?0[x][0-9a-fA-F]+$/,g=/^0[0-7]+$/,b=/^-?0[0-7]+$/,S=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,k=/^[a-zA-Z_][a-zA-Z_0-9]*$/,w=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,C=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/},function(e,t,r){"use strict";function n(e,t){i.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),n[e]=t}e.exports=n;var i=/\/|\./;n("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var o;n("duration",{Duration:o={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),n("timestamp",{Timestamp:o}),n("empty",{Empty:{fields:{}}}),n("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),n("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),n("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),n.get=function(e){return n[e]||null}},function(e,t,r){"use strict";var n=r(16).assign,i=r(158),o=r(161),a=r(73),s={};n(s,i,o,a),e.exports=s},function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.options=c.assign({level:p,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:_,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var r=s.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==h)throw new Error(l[r]);if(t.header&&s.deflateSetHeader(this.strm,t.header),t.dictionary){var i;if(i="string"==typeof t.dictionary?u.string2buf(t.dictionary):"[object ArrayBuffer]"===f.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=s.deflateSetDictionary(this.strm,i))!==h)throw new Error(l[r]);this._dict_set=!0}}function i(e,t){var r=new n(t);if(r.push(e,!0),r.err)throw r.msg||l[r.err];return r.result}function o(e,t){return t=t||{},t.raw=!0,i(e,t)}function a(e,t){return t=t||{},t.gzip=!0,i(e,t)}var s=r(159),c=r(16),u=r(71),l=r(45),d=r(72),f=Object.prototype.toString,h=0,p=-1,_=0,m=8;n.prototype.push=function(e,t){var r,n,i=this.strm,o=this.options.chunkSize;if(this.ended)return!1;n=t===~~t?t:!0===t?4:0,"string"==typeof e?i.input=u.string2buf(e):"[object ArrayBuffer]"===f.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new c.Buf8(o),i.next_out=0,i.avail_out=o),1!==(r=s.deflate(i,n))&&r!==h)return this.onEnd(r),this.ended=!0,!1;0!==i.avail_out&&(0!==i.avail_in||4!==n&&2!==n)||("string"===this.options.to?this.onData(u.buf2binstring(c.shrinkBuf(i.output,i.next_out))):this.onData(c.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&1!==r);return 4===n?(r=s.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===h):2!==n||(this.onEnd(h),i.avail_out=0,!0)},n.prototype.onData=function(e){this.chunks.push(e)},n.prototype.onEnd=function(e){e===h&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=c.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=n,t.deflate=i,t.deflateRaw=o,t.gzip=a},function(e,t,r){"use strict";function n(e,t){return e.msg=x[t],t}function i(e){return(e<<1)-(e>4?9:0)}function o(e){for(var t=e.length;--t>=0;)e[t]=0}function a(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(A.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function s(e,t){I._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,a(e.strm)}function c(e,t){e.pending_buf[e.pending++]=t}function u(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function l(e,t,r,n){var i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,A.arraySet(t,e.input,e.next_in,i,r),1===e.state.wrap?e.adler=M(e.adler,t,i,r):2===e.state.wrap&&(e.adler=D(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function d(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-ue?e.strstart-(e.w_size-ue):0,u=e.window,l=e.w_mask,d=e.prev,f=e.strstart+ce,h=u[o+a-1],p=u[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(r=t,u[r+a]===p&&u[r+a-1]===h&&u[r]===u[o]&&u[++r]===u[o+1]){o+=2,r++;do{}while(u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&oa){if(e.match_start=t,a=n,n>=s)break;h=u[o+a-1],p=u[o+a]}}}while((t=d[t&l])>c&&0!=--i);return a<=e.lookahead?a:e.lookahead}function f(e){var t,r,n,i,o,a=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=a+(a-ue)){A.arraySet(e.window,e.window,a,a,0),e.match_start-=a,e.strstart-=a,e.block_start-=a,r=e.hash_size,t=r;do{n=e.head[--t],e.head[t]=n>=a?n-a:0}while(--r);r=a,t=r;do{n=e.prev[--t],e.prev[t]=n>=a?n-a:0}while(--r);i+=a}if(0===e.strm.avail_in)break;if(r=l(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=r,e.lookahead+e.insert>=se)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(f(e),0===e.lookahead&&t===L)return ye;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,s(e,!1),0===e.strm.avail_out))return ye;if(e.strstart-e.block_start>=e.w_size-ue&&(s(e,!1),0===e.strm.avail_out))return ye}return e.insert=0,t===V?(s(e,!0),0===e.strm.avail_out?be:Se):(e.strstart>e.block_start&&(s(e,!1),e.strm.avail_out),ye)}function p(e,t){for(var r,n;;){if(e.lookahead=se&&(e.ins_h=(e.ins_h<=se)if(n=I._tr_tally(e,e.strstart-e.match_start,e.match_length-se),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=se){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=se&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=se-1)),e.prev_length>=se&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-se,n=I._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-se),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<=se&&e.strstart>0&&(i=e.strstart-1,(n=a[i])===a[++i]&&n===a[++i]&&n===a[++i])){o=e.strstart+ce;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=se?(r=I._tr_tally(e,1,e.match_length-se),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=I._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(s(e,!1),0===e.strm.avail_out))return ye}return e.insert=0,t===V?(s(e,!0),0===e.strm.avail_out?be:Se):e.last_lit&&(s(e,!1),0===e.strm.avail_out)?ye:ge}function v(e,t){for(var r;;){if(0===e.lookahead&&(f(e),0===e.lookahead)){if(t===L)return ye;break}if(e.match_length=0,r=I._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(s(e,!1),0===e.strm.avail_out))return ye}return e.insert=0,t===V?(s(e,!0),0===e.strm.avail_out?be:Se):e.last_lit&&(s(e,!1),0===e.strm.avail_out)?ye:ge}function y(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function g(e){e.window_size=2*e.w_size,o(e.head),e.max_lazy_match=P[e.level].max_lazy,e.good_match=P[e.level].good_length,e.nice_match=P[e.level].nice_length,e.max_chain_length=P[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=se-1,e.match_available=0,e.ins_h=0}function b(){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=Z,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 A.Buf16(2*oe),this.dyn_dtree=new A.Buf16(2*(2*ne+1)),this.bl_tree=new A.Buf16(2*(2*ie+1)),o(this.dyn_ltree),o(this.dyn_dtree),o(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new A.Buf16(ae+1),this.heap=new A.Buf16(2*re+1),o(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new A.Buf16(2*re+1),o(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 S(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=Y,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?de:me,e.adler=2===t.wrap?0:1,t.last_flush=L,I._tr_init(t),U):n(e,H)}function k(e){var t=S(e);return t===U&&g(e.state),t}function w(e,t){return e&&e.state?2!==e.state.wrap?H:(e.state.gzhead=t,U):H}function C(e,t,r,i,o,a){if(!e)return H;var s=1;if(t===G&&(t=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),o<1||o>$||r!==Z||i<8||i>15||t<0||t>9||a<0||a>K)return n(e,H);8===i&&(i=9);var c=new b;return e.state=c,c.strm=e,c.wrap=s,c.gzhead=null,c.w_bits=i,c.w_size=1<B||t<0)return e?n(e,H):H;if(s=e.state,!e.output||!e.input&&0!==e.avail_in||s.status===ve&&t!==V)return n(e,0===e.avail_out?W:H);if(s.strm=e,r=s.last_flush,s.last_flush=t,s.status===de)if(2===s.wrap)e.adler=0,c(s,31),c(s,139),c(s,8),s.gzhead?(c(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),c(s,255&s.gzhead.time),c(s,s.gzhead.time>>8&255),c(s,s.gzhead.time>>16&255),c(s,s.gzhead.time>>24&255),c(s,9===s.level?2:s.strategy>=q||s.level<2?4:0),c(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(c(s,255&s.gzhead.extra.length),c(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(e.adler=D(e.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=fe):(c(s,0),c(s,0),c(s,0),c(s,0),c(s,0),c(s,9===s.level?2:s.strategy>=q||s.level<2?4:0),c(s,ke),s.status=me);else{var f=Z+(s.w_bits-8<<4)<<8,h=-1;h=s.strategy>=q||s.level<2?0:s.level<6?1:6===s.level?2:3,f|=h<<6,0!==s.strstart&&(f|=le),f+=31-f%31,s.status=me,u(s,f),0!==s.strstart&&(u(s,e.adler>>>16),u(s,65535&e.adler)),e.adler=1}if(s.status===fe)if(s.gzhead.extra){for(l=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>l&&(e.adler=D(e.adler,s.pending_buf,s.pending-l,l)),a(e),l=s.pending,s.pending!==s.pending_buf_size));)c(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>l&&(e.adler=D(e.adler,s.pending_buf,s.pending-l,l)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=he)}else s.status=he;if(s.status===he)if(s.gzhead.name){l=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>l&&(e.adler=D(e.adler,s.pending_buf,s.pending-l,l)),a(e),l=s.pending,s.pending===s.pending_buf_size)){d=1;break}d=s.gzindexl&&(e.adler=D(e.adler,s.pending_buf,s.pending-l,l)),0===d&&(s.gzindex=0,s.status=pe)}else s.status=pe;if(s.status===pe)if(s.gzhead.comment){l=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>l&&(e.adler=D(e.adler,s.pending_buf,s.pending-l,l)),a(e),l=s.pending,s.pending===s.pending_buf_size)){d=1;break}d=s.gzindexl&&(e.adler=D(e.adler,s.pending_buf,s.pending-l,l)),0===d&&(s.status=_e)}else s.status=_e;if(s.status===_e&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&a(e),s.pending+2<=s.pending_buf_size&&(c(s,255&e.adler),c(s,e.adler>>8&255),e.adler=0,s.status=me)):s.status=me),0!==s.pending){if(a(e),0===e.avail_out)return s.last_flush=-1,U}else if(0===e.avail_in&&i(t)<=i(r)&&t!==V)return n(e,W);if(s.status===ve&&0!==e.avail_in)return n(e,W);if(0!==e.avail_in||0!==s.lookahead||t!==L&&s.status!==ve){var p=s.strategy===q?v(s,t):s.strategy===X?m(s,t):P[s.level].func(s,t);if(p!==be&&p!==Se||(s.status=ve),p===ye||p===be)return 0===e.avail_out&&(s.last_flush=-1),U;if(p===ge&&(t===N?I._tr_align(s):t!==B&&(I._tr_stored_block(s,0,0,!1),t===j&&(o(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),a(e),0===e.avail_out))return s.last_flush=-1,U}return t!==V?U:s.wrap<=0?F:(2===s.wrap?(c(s,255&e.adler),c(s,e.adler>>8&255),c(s,e.adler>>16&255),c(s,e.adler>>24&255),c(s,255&e.total_in),c(s,e.total_in>>8&255),c(s,e.total_in>>16&255),c(s,e.total_in>>24&255)):(u(s,e.adler>>>16),u(s,65535&e.adler)),a(e),s.wrap>0&&(s.wrap=-s.wrap),0!==s.pending?U:F)}function T(e){var t;return e&&e.state?(t=e.state.status)!==de&&t!==fe&&t!==he&&t!==pe&&t!==_e&&t!==me&&t!==ve?n(e,H):(e.state=null,t===me?n(e,z):U):H}function O(e,t){var r,n,i,a,s,c,u,l,d=t.length;if(!e||!e.state)return H;if(r=e.state,2===(a=r.wrap)||1===a&&r.status!==de||r.lookahead)return H;for(1===a&&(e.adler=M(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===a&&(o(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new A.Buf8(r.w_size),A.arraySet(l,t,d-r.w_size,r.w_size,0),t=l,d=r.w_size),s=e.avail_in,c=e.next_in,u=e.input,e.avail_in=d,e.next_in=0,e.input=t,f(r);r.lookahead>=se;){n=r.strstart,i=r.lookahead-(se-1);do{r.ins_h=(r.ins_h<=0;)e[t]=0}function i(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function o(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function a(e){return e<256?oe[e]:oe[256+(e>>>7)]}function s(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function c(e,t,r){e.bi_valid>q-r?(e.bi_buf|=t<>q-e.bi_valid,e.bi_valid+=r-q):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function d(e){16===e.bi_valid?(s(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}function f(e,t){var r,n,i,o,a,s,c=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,p=t.stat_desc.max_length,_=0;for(o=0;o<=J;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rp&&(o=p,_++),c[2*n+1]=o,n>u||(e.bl_count[o]++,a=0,n>=h&&(a=f[n-h]),s=c[2*n],e.opt_len+=s*(o+a),d&&(e.static_len+=s*(l[2*n+1]+a)));if(0!==_){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,_-=2}while(_>0);for(o=p;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>u||(c[2*i+1]!==o&&(e.opt_len+=(o-c[2*i+1])*c[2*i],c[2*i+1]=o),n--)}}function h(e,t,r){var n,i,o=new Array(J+1),a=0;for(n=1;n<=J;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=l(o[s]++,s))}}function p(){var e,t,r,n,o,a=new Array(J+1);for(r=0,n=0;n>=7;n8?s(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function v(e,t,r,n){m(e),n&&(s(e,r),s(e,~r)),M.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function y(e,t,r,n){var i=2*t,o=2*r;return e[i]>1;r>=1;r--)g(e,o,r);i=c;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],g(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,g(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],f(e,t),h(o,u,e.bl_count)}function k(e,t,r){var n,i,o=-1,a=t[1],s=0,c=7,u=4;for(0===a&&(c=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s=3&&0===e.bl_tree[2*re[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}function R(e,t,r,n){var i;for(c(e,t-257,5),c(e,r-1,5),c(e,n-4,4),i=0;i>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return x;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return L;for(t=32;t0?(e.strm.data_type===N&&(e.strm.data_type=E(e)),S(e,e.l_desc),S(e,e.d_desc),a=C(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?O(e,t,r,n):e.strategy===D||o===i?(c(e,(V<<1)+(n?1:0),3),b(e,ne,ie)):(c(e,(B<<1)+(n?1:0),3),R(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),b(e,e.dyn_ltree,e.dyn_dtree)),_(e),n&&m(e)}function I(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(ae[r]+F+1)]++,e.dyn_dtree[2*a(t)]++),e.last_lit===e.lit_bufsize-1}var M=r(16),D=4,x=0,L=1,N=2,j=0,V=1,B=2,U=29,F=256,H=F+1+U,z=30,W=19,G=2*H+1,J=15,q=16,X=7,K=256,Q=16,Y=17,Z=18,$=[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],ee=[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],te=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],re=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ne=new Array(2*(H+2));n(ne);var ie=new Array(2*z);n(ie);var oe=new Array(512);n(oe);var ae=new Array(256);n(ae);var se=new Array(U);n(se);var ce=new Array(z);n(ce);var ue,le,de,fe=!1;t._tr_init=T,t._tr_stored_block=O,t._tr_flush_block=A,t._tr_tally=I,t._tr_align=P},function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var r=a.inflateInit2(this.strm,t.windowBits);if(r!==u.Z_OK)throw new Error(l[r]);if(this.header=new f,a.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=c.string2buf(t.dictionary):"[object ArrayBuffer]"===h.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=a.inflateSetDictionary(this.strm,t.dictionary))!==u.Z_OK))throw new Error(l[r])}function i(e,t){var r=new n(t);if(r.push(e,!0),r.err)throw r.msg||l[r.err];return r.result}function o(e,t){return t=t||{},t.raw=!0,i(e,t)}var a=r(162),s=r(16),c=r(71),u=r(73),l=r(45),d=r(72),f=r(165),h=Object.prototype.toString;n.prototype.push=function(e,t){var r,n,i,o,l,d=this.strm,f=this.options.chunkSize,p=this.options.dictionary,_=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?u.Z_FINISH:u.Z_NO_FLUSH,"string"==typeof e?d.input=c.binstring2buf(e):"[object ArrayBuffer]"===h.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new s.Buf8(f),d.next_out=0,d.avail_out=f),r=a.inflate(d,u.Z_NO_FLUSH),r===u.Z_NEED_DICT&&p&&(r=a.inflateSetDictionary(this.strm,p)),r===u.Z_BUF_ERROR&&!0===_&&(r=u.Z_OK,_=!1),r!==u.Z_STREAM_END&&r!==u.Z_OK)return this.onEnd(r),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&r!==u.Z_STREAM_END&&(0!==d.avail_in||n!==u.Z_FINISH&&n!==u.Z_SYNC_FLUSH)||("string"===this.options.to?(i=c.utf8border(d.output,d.next_out),o=d.next_out-i,l=c.buf2string(d.output,i),d.next_out=o,d.avail_out=f-o,o&&s.arraySet(d.output,d.output,i,o,0),this.onData(l)):this.onData(s.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(_=!0)}while((d.avail_in>0||0===d.avail_out)&&r!==u.Z_STREAM_END);return r===u.Z_STREAM_END&&(n=u.Z_FINISH),n===u.Z_FINISH?(r=a.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===u.Z_OK):n!==u.Z_SYNC_FLUSH||(this.onEnd(u.Z_OK),d.avail_out=0,!0)},n.prototype.onData=function(e){this.chunks.push(e)},n.prototype.onEnd=function(e){e===u.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=n,t.inflate=i,t.inflateRaw=o,t.ungzip=i},function(e,t,r){"use strict";function n(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function i(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,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 y.Buf16(320),this.work=new y.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),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 y.Buf32(_e),t.distcode=t.distdyn=new y.Buf32(me),t.sane=1,t.back=-1,P):M}function a(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,o(e)):M}function s(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?M:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,a(e))):M}function c(e,t){var r,n;return e?(n=new i,e.state=n,n.window=null,r=s(e,t),r!==P&&(e.state=null),r):M}function u(e){return c(e,ve)}function l(e){if(ye){var t;for(m=new y.Buf32(512),v=new y.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(k(C,e.lens,0,288,m,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;k(R,e.lens,0,32,v,0,e.work,{bits:5}),ye=!1}e.lencode=m,e.lenbits=9,e.distcode=v,e.distbits=5}function d(e,t,r,n){var i,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(y.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),y.arraySet(o.window,t,r-n,i,o.wnext),n-=i,n?(y.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=b(r.check,Te,2,0),f=0,h=0,r.mode=V;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&f)<<8)+(f>>8))%31){e.msg="incorrect header check",r.mode=fe;break}if((15&f)!==N){e.msg="unknown compression method",r.mode=fe;break}if(f>>>=4,h-=4,ke=8+(15&f),0===r.wbits)r.wbits=ke;else if(ke>r.wbits){e.msg="invalid window size",r.mode=fe;break}r.dmax=1<>8&1),512&r.flags&&(Te[0]=255&f,Te[1]=f>>>8&255,r.check=b(r.check,Te,2,0)),f=0,h=0,r.mode=B;case B:for(;h<32;){if(0===c)break e;c--,f+=i[a++]<>>8&255,Te[2]=f>>>16&255,Te[3]=f>>>24&255,r.check=b(r.check,Te,4,0)),f=0,h=0,r.mode=U;case U:for(;h<16;){if(0===c)break e;c--,f+=i[a++]<>8),512&r.flags&&(Te[0]=255&f,Te[1]=f>>>8&255,r.check=b(r.check,Te,2,0)),f=0,h=0,r.mode=F;case F:if(1024&r.flags){for(;h<16;){if(0===c)break e;c--,f+=i[a++]<>>8&255,r.check=b(r.check,Te,2,0)),f=0,h=0}else r.head&&(r.head.extra=null);r.mode=H;case H:if(1024&r.flags&&(m=r.length,m>c&&(m=c),m&&(r.head&&(ke=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),y.arraySet(r.head.extra,i,a,m,ke)),512&r.flags&&(r.check=b(r.check,i,m,a)),c-=m,a+=m,r.length-=m),r.length))break e;r.length=0,r.mode=z;case z:if(2048&r.flags){if(0===c)break e;m=0;do{ke=i[a+m++],r.head&&ke&&r.length<65536&&(r.head.name+=String.fromCharCode(ke))}while(ke&&m>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=X;break;case J:for(;h<32;){if(0===c)break e;c--,f+=i[a++]<>>=7&h,h-=7&h,r.mode=ue;break}for(;h<3;){if(0===c)break e;c--,f+=i[a++]<>>=1,h-=1,3&f){case 0:r.mode=Q;break;case 1:if(l(r),r.mode=re,t===O){f>>>=2,h-=2;break e}break;case 2:r.mode=$;break;case 3:e.msg="invalid block type",r.mode=fe}f>>>=2,h-=2;break;case Q:for(f>>>=7&h,h-=7&h;h<32;){if(0===c)break e;c--,f+=i[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=fe;break}if(r.length=65535&f,f=0,h=0,r.mode=Y,t===O)break e;case Y:r.mode=Z;case Z:if(m=r.length){if(m>c&&(m=c),m>u&&(m=u),0===m)break e;y.arraySet(o,i,a,m,s),c-=m,a+=m,u-=m,s+=m,r.length-=m;break}r.mode=X;break;case $:for(;h<14;){if(0===c)break e;c--,f+=i[a++]<>>=5,h-=5,r.ndist=1+(31&f),f>>>=5,h-=5,r.ncode=4+(15&f),f>>>=4,h-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=fe;break}r.have=0,r.mode=ee;case ee:for(;r.have>>=3,h-=3}for(;r.have<19;)r.lens[Oe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Ce={bits:r.lenbits},we=k(w,r.lens,0,19,r.lencode,0,r.work,Ce),r.lenbits=Ce.bits,we){e.msg="invalid code lengths set",r.mode=fe;break}r.have=0,r.mode=te;case te:for(;r.have>>24,ve=Ee>>>16&255,ye=65535&Ee,!(me<=h);){if(0===c)break e;c--,f+=i[a++]<>>=me,h-=me,r.lens[r.have++]=ye;else{if(16===ye){for(Re=me+2;h>>=me,h-=me,0===r.have){e.msg="invalid bit length repeat",r.mode=fe;break}ke=r.lens[r.have-1],m=3+(3&f),f>>>=2,h-=2}else if(17===ye){for(Re=me+3;h>>=me,h-=me,ke=0,m=3+(7&f),f>>>=3,h-=3}else{for(Re=me+7;h>>=me,h-=me,ke=0,m=11+(127&f),f>>>=7,h-=7}if(r.have+m>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=fe;break}for(;m--;)r.lens[r.have++]=ke}}if(r.mode===fe)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=fe;break}if(r.lenbits=9,Ce={bits:r.lenbits},we=k(C,r.lens,0,r.nlen,r.lencode,0,r.work,Ce),r.lenbits=Ce.bits,we){e.msg="invalid literal/lengths set",r.mode=fe;break}if(r.distbits=6,r.distcode=r.distdyn,Ce={bits:r.distbits},we=k(R,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Ce),r.distbits=Ce.bits,we){e.msg="invalid distances set",r.mode=fe;break}if(r.mode=re,t===O)break e;case re:r.mode=ne;case ne:if(c>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=a,e.avail_in=c,r.hold=f,r.bits=h,S(e,_),s=e.next_out,o=e.output,u=e.avail_out,a=e.next_in,i=e.input,c=e.avail_in,f=r.hold,h=r.bits,r.mode===X&&(r.back=-1);break}for(r.back=0;Ee=r.lencode[f&(1<>>24,ve=Ee>>>16&255,ye=65535&Ee,!(me<=h);){if(0===c)break e;c--,f+=i[a++]<>ge)],me=Ee>>>24,ve=Ee>>>16&255,ye=65535&Ee,!(ge+me<=h);){if(0===c)break e;c--,f+=i[a++]<>>=ge,h-=ge,r.back+=ge}if(f>>>=me,h-=me,r.back+=me,r.length=ye,0===ve){r.mode=ce;break}if(32&ve){r.back=-1,r.mode=X;break}if(64&ve){e.msg="invalid literal/length code",r.mode=fe;break}r.extra=15&ve,r.mode=ie;case ie:if(r.extra){for(Re=r.extra;h>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=oe;case oe:for(;Ee=r.distcode[f&(1<>>24,ve=Ee>>>16&255,ye=65535&Ee,!(me<=h);){if(0===c)break e;c--,f+=i[a++]<>ge)],me=Ee>>>24,ve=Ee>>>16&255,ye=65535&Ee,!(ge+me<=h);){if(0===c)break e;c--,f+=i[a++]<>>=ge,h-=ge,r.back+=ge}if(f>>>=me,h-=me,r.back+=me,64&ve){e.msg="invalid distance code",r.mode=fe;break}r.offset=ye,r.extra=15&ve,r.mode=ae;case ae:if(r.extra){for(Re=r.extra;h>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=fe;break}r.mode=se;case se:if(0===u)break e;if(m=_-u,r.offset>m){if((m=r.offset-m)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=fe;break}m>r.wnext?(m-=r.wnext,v=r.wsize-m):v=r.wnext-m,m>r.length&&(m=r.length),_e=r.window}else _e=o,v=s-r.offset,m=r.length;m>u&&(m=u),u-=m,r.length-=m;do{o[s++]=_e[v++]}while(--m);0===r.length&&(r.mode=ne);break;case ce:if(0===u)break e;o[s++]=r.length,u--,r.mode=ne;break;case ue:if(r.wrap){for(;h<32;){if(0===c)break e;c--,f|=i[a++]<>>24,h>>>=b,p-=b,0===(b=g>>>16&255))E[o++]=65535&g;else{if(!(16&b)){if(0==(64&b)){g=_[(65535&g)+(h&(1<>>=b,p-=b),p<15&&(h+=R[n++]<>>24,h>>>=b,p-=b,!(16&(b=g>>>16&255))){if(0==(64&b)){g=m[(65535&g)+(h&(1<c){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=b,p-=b,b=o-a,k>b){if((b=k-b)>l&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(w=0,C=f,0===d){if(w+=u-b,b2;)E[o++]=C[w++],E[o++]=C[w++],E[o++]=C[w++],S-=3;S&&(E[o++]=C[w++],S>1&&(E[o++]=C[w++]))}else{w=o-k;do{E[o++]=E[w++],E[o++]=E[w++],E[o++]=E[w++],S-=3}while(S>2);S&&(E[o++]=E[w++],S>1&&(E[o++]=E[w++]))}break}}break}}while(n>3,n-=S,p-=S<<3,h&=(1<=1&&0===L[E];E--);if(T>E&&(T=E),0===E)return u[l++]=20971520,u[l++]=20971520,f.bits=1,0;for(R=1;R0&&(0===e||1!==E))return-1;for(N[1]=0,w=1;w<15;w++)N[w+1]=N[w]+L[w];for(C=0;C852||2===e&&I>592)return 1;for(;;){g=w-P,d[C]y?(b=j[V+d[C]],S=D[x+d[C]]):(b=96,S=0),h=1<>P)+p]=g<<24|b<<16|S|0}while(0!==p);for(h=1<>=1;if(0!==h?(M&=h-1,M+=h):M=0,C++,0==--L[w]){if(w===E)break;w=t[r+d[C]]}if(w>T&&(M&m)!==_){for(0===P&&(P=T),v+=R,O=w-P,A=1<852||2===e&&I>592)return 1;_=M&m,u[_]=T<<24|O<<16|v-l|0}}return 0!==M&&(u[v+M]=w-P<<24|64<<16|0),f.bits=T,0}},function(e,t,r){"use strict";function n(){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=!1}e.exports=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={nested:{sls:{nested:{Log:{fields:{Time:{rule:"required",type:"uint32",id:1},Contents:{rule:"repeated",type:"Content",id:2}},nested:{Content:{fields:{Key:{rule:"required",type:"string",id:1},Value:{rule:"required",type:"string",id:2}}}}},LogTag:{fields:{Key:{rule:"required",type:"string",id:1},Value:{rule:"required",type:"string",id:2}}},LogGroup:{fields:{Logs:{rule:"repeated",type:"Log",id:1},Reserved:{type:"string",id:2},Topic:{type:"string",id:3},Source:{type:"string",id:4},LogTags:{rule:"repeated",type:"LogTag",id:6}}},LogGroupList:{fields:{logGroupList:{rule:"repeated",type:"LogGroup",id:1}}}}}}}},function(e,t){},function(module,exports,__webpack_require__){"use strict";(function(process,global,module){var __WEBPACK_AMD_DEFINE_RESULT__,_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};/** * [js-md5]{@link https://github.com/emn178/js-md5} * * @namespace md5 * @version 0.7.3 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2014-2017 * @license MIT */ !function(){function Md5(e){if(e)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}var ERROR="input is invalid type",WINDOW="object"===("undefined"==typeof window?"undefined":_typeof(window)),root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"===("undefined"==typeof self?"undefined":_typeof(self)),NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"===(void 0===process?"undefined":_typeof(process))&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&"object"===_typeof(module)&&module.exports,AMD=__webpack_require__(170),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===(void 0===e?"undefined":_typeof(e))&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t){return new Md5(!0).update(t)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.create=function(){return new Md5},e.update=function(t){return e.create().update(t)};for(var t=0;t>2]|=e[o]<>6,c[i++]=128|63&n):n<55296||n>=57344?(c[i++]=224|n>>12,c[i++]=128|n>>6&63,c[i++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++o)),c[i++]=240|n>>18,c[i++]=128|n>>12&63,c[i++]=128|n>>6&63,c[i++]=128|63&n);else for(i=this.start;o>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(s[i>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=64?(this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,r,n,i,o,a=this.blocks;this.first?(e=a[0]-680876937,e=(e<<7|e>>>25)-271733879<<0,n=(-1732584194^2004318071&e)+a[1]-117830708,n=(n<<12|n>>>20)+e<<0,r=(-271733879^n&(-271733879^e))+a[2]-1126478375,r=(r<<17|r>>>15)+n<<0,t=(e^r&(n^e))+a[3]-1316259209,t=(t<<22|t>>>10)+r<<0):(e=this.h0,t=this.h1,r=this.h2,n=this.h3,e+=(n^t&(r^n))+a[0]-680876936,e=(e<<7|e>>>25)+t<<0,n+=(r^e&(t^r))+a[1]-389564586,n=(n<<12|n>>>20)+e<<0,r+=(t^n&(e^t))+a[2]+606105819,r=(r<<17|r>>>15)+n<<0,t+=(e^r&(n^e))+a[3]-1044525330,t=(t<<22|t>>>10)+r<<0),e+=(n^t&(r^n))+a[4]-176418897,e=(e<<7|e>>>25)+t<<0,n+=(r^e&(t^r))+a[5]+1200080426,n=(n<<12|n>>>20)+e<<0,r+=(t^n&(e^t))+a[6]-1473231341,r=(r<<17|r>>>15)+n<<0,t+=(e^r&(n^e))+a[7]-45705983,t=(t<<22|t>>>10)+r<<0,e+=(n^t&(r^n))+a[8]+1770035416,e=(e<<7|e>>>25)+t<<0,n+=(r^e&(t^r))+a[9]-1958414417,n=(n<<12|n>>>20)+e<<0,r+=(t^n&(e^t))+a[10]-42063,r=(r<<17|r>>>15)+n<<0,t+=(e^r&(n^e))+a[11]-1990404162,t=(t<<22|t>>>10)+r<<0,e+=(n^t&(r^n))+a[12]+1804603682,e=(e<<7|e>>>25)+t<<0,n+=(r^e&(t^r))+a[13]-40341101,n=(n<<12|n>>>20)+e<<0,r+=(t^n&(e^t))+a[14]-1502002290,r=(r<<17|r>>>15)+n<<0,t+=(e^r&(n^e))+a[15]+1236535329,t=(t<<22|t>>>10)+r<<0,e+=(r^n&(t^r))+a[1]-165796510,e=(e<<5|e>>>27)+t<<0,n+=(t^r&(e^t))+a[6]-1069501632,n=(n<<9|n>>>23)+e<<0,r+=(e^t&(n^e))+a[11]+643717713,r=(r<<14|r>>>18)+n<<0,t+=(n^e&(r^n))+a[0]-373897302,t=(t<<20|t>>>12)+r<<0,e+=(r^n&(t^r))+a[5]-701558691,e=(e<<5|e>>>27)+t<<0,n+=(t^r&(e^t))+a[10]+38016083,n=(n<<9|n>>>23)+e<<0,r+=(e^t&(n^e))+a[15]-660478335,r=(r<<14|r>>>18)+n<<0,t+=(n^e&(r^n))+a[4]-405537848,t=(t<<20|t>>>12)+r<<0,e+=(r^n&(t^r))+a[9]+568446438,e=(e<<5|e>>>27)+t<<0,n+=(t^r&(e^t))+a[14]-1019803690,n=(n<<9|n>>>23)+e<<0,r+=(e^t&(n^e))+a[3]-187363961,r=(r<<14|r>>>18)+n<<0,t+=(n^e&(r^n))+a[8]+1163531501,t=(t<<20|t>>>12)+r<<0,e+=(r^n&(t^r))+a[13]-1444681467,e=(e<<5|e>>>27)+t<<0,n+=(t^r&(e^t))+a[2]-51403784,n=(n<<9|n>>>23)+e<<0,r+=(e^t&(n^e))+a[7]+1735328473,r=(r<<14|r>>>18)+n<<0,t+=(n^e&(r^n))+a[12]-1926607734,t=(t<<20|t>>>12)+r<<0,i=t^r,e+=(i^n)+a[5]-378558,e=(e<<4|e>>>28)+t<<0,n+=(i^e)+a[8]-2022574463,n=(n<<11|n>>>21)+e<<0,o=n^e,r+=(o^t)+a[11]+1839030562,r=(r<<16|r>>>16)+n<<0,t+=(o^r)+a[14]-35309556,t=(t<<23|t>>>9)+r<<0,i=t^r,e+=(i^n)+a[1]-1530992060,e=(e<<4|e>>>28)+t<<0,n+=(i^e)+a[4]+1272893353,n=(n<<11|n>>>21)+e<<0,o=n^e,r+=(o^t)+a[7]-155497632,r=(r<<16|r>>>16)+n<<0,t+=(o^r)+a[10]-1094730640,t=(t<<23|t>>>9)+r<<0,i=t^r,e+=(i^n)+a[13]+681279174,e=(e<<4|e>>>28)+t<<0,n+=(i^e)+a[0]-358537222,n=(n<<11|n>>>21)+e<<0,o=n^e,r+=(o^t)+a[3]-722521979,r=(r<<16|r>>>16)+n<<0,t+=(o^r)+a[6]+76029189,t=(t<<23|t>>>9)+r<<0,i=t^r,e+=(i^n)+a[9]-640364487,e=(e<<4|e>>>28)+t<<0,n+=(i^e)+a[12]-421815835,n=(n<<11|n>>>21)+e<<0,o=n^e,r+=(o^t)+a[15]+530742520,r=(r<<16|r>>>16)+n<<0,t+=(o^r)+a[2]-995338651,t=(t<<23|t>>>9)+r<<0,e+=(r^(t|~n))+a[0]-198630844,e=(e<<6|e>>>26)+t<<0,n+=(t^(e|~r))+a[7]+1126891415,n=(n<<10|n>>>22)+e<<0,r+=(e^(n|~t))+a[14]-1416354905,r=(r<<15|r>>>17)+n<<0,t+=(n^(r|~e))+a[5]-57434055,t=(t<<21|t>>>11)+r<<0,e+=(r^(t|~n))+a[12]+1700485571,e=(e<<6|e>>>26)+t<<0,n+=(t^(e|~r))+a[3]-1894986606,n=(n<<10|n>>>22)+e<<0,r+=(e^(n|~t))+a[10]-1051523,r=(r<<15|r>>>17)+n<<0,t+=(n^(r|~e))+a[1]-2054922799,t=(t<<21|t>>>11)+r<<0,e+=(r^(t|~n))+a[8]+1873313359,e=(e<<6|e>>>26)+t<<0,n+=(t^(e|~r))+a[15]-30611744,n=(n<<10|n>>>22)+e<<0,r+=(e^(n|~t))+a[6]-1560198380,r=(r<<15|r>>>17)+n<<0,t+=(n^(r|~e))+a[13]+1309151649,t=(t<<21|t>>>11)+r<<0,e+=(r^(t|~n))+a[4]-145523070,e=(e<<6|e>>>26)+t<<0,n+=(t^(e|~r))+a[11]-1120210379,n=(n<<10|n>>>22)+e<<0,r+=(e^(n|~t))+a[2]+718787259,r=(r<<15|r>>>17)+n<<0,t+=(n^(r|~e))+a[9]-343485551,t=(t<<21|t>>>11)+r<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=r-1732584194<<0,this.h3=n+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+r<<0,this.h3=this.h3+n<<0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,r,n="",i=this.array(),o=0;o<15;)e=i[o++],t=i[o++],r=i[o++],n+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|r>>>6)]+BASE64_ENCODE_CHAR[63&r];return e=i[o],n+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}()}).call(exports,__webpack_require__(169),__webpack_require__(32),__webpack_require__(23)(module))},function(e,t,r){"use strict";function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(e){if(d===setTimeout)return setTimeout(e,0);if((d===n||!d)&&setTimeout)return d=setTimeout,setTimeout(e,0);try{return d(e,0)}catch(t){try{return d.call(null,e,0)}catch(t){return d.call(this,e,0)}}}function a(e){if(f===clearTimeout)return clearTimeout(e);if((f===i||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function s(){m&&p&&(m=!1,p.length?_=p.concat(_):v=-1,_.length&&c())}function c(){if(!m){var e=o(s);m=!0;for(var t=_.length;t;){for(p=_,_=[];++v1)for(var r=1;r0&&u>c&&(u=c);for(var l=0;l=0?(d=_.substr(0,m),f=_.substr(m+1)):(d=_,f=""),h=decodeURIComponent(d),p=decodeURIComponent(f),n(a,h)?i(a[h])?a[h].push(p):a[h]=[a[h],p]:a[h]=p}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){"use strict";function n(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n=e.secondMax&&e.excuteRetry()},1e3))},t.prototype.stop=function(){this.timerId&&(clearInterval(this.timerId),this.timerId=0)},t.prototype.reconnectedFailed=function(){var e=this;this.stop(),setTimeout(function(){e.excuteRetry()},5e3)},t.prototype.recvHeartbeatAck=function(){this.secondIndex=0,this.retryIndex=0},t.prototype.excuteRetry=function(){this.emit("onReconnect",!(this.retryIndex<3)),++this.retryIndex},t}(r(768).default);t.HeartBeatManager=o},570:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MessageCenter=void 0;var r=function(){function e(){this.messageArr=[]}return Object.defineProperty(e.prototype,"allMessage",{get:function(){return this.messageArr},enumerable:!1,configurable:!0}),e.prototype.addMessage=function(e){this.messageArr.push(e)},e.prototype.getMessage=function(){return this.messageArr.splice(0)},e}();t.MessageCenter=r},901:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.Packager=t.MessageType=void 0;var n,i=r(873);!function(e){e[e.Heartbeat=0]="Heartbeat",e[e.Heartbact_ack=1]="Heartbact_ack",e[e.Log=2]="Log"}(n=t.MessageType||(t.MessageType={}));var o=function(){function e(e){this.encoder=new TextEncoder,this.reader=new FileReader,this.product=e.product?e.product:i.ProductType.RTC,this.compressType=void 0!==e.compressType?e.compressType:i.CompressType.NO_COMPRESS}return e.prototype.getStringLogPackage=function(e,t){var r=new Uint8Array(14);r[0]=n.Log,r[1]=i.ProtocolType.JSON,r[2]=this.product,r[3]=this.compressType,r[4]=1,r[5]=1,this.set4ByteNumber(r,t,6);var o=this.encoder.encode(e);this.set4ByteNumber(r,o.byteLength,10);var a=new Uint8Array(o.byteLength+r.length);return a.set(r,0),a.set(o,r.length),a.buffer},e.prototype.getHeartBeatPackage=function(){var e=new Uint8Array(10);return e[0]=n.Heartbeat,e[1]=i.ProtocolType.JSON,e[2]=this.product,e.buffer},e.prototype.parsePackage=function(e){var t=this;return new Promise(function(r,i){t.parsePackageData(e).then(function(e){if(e&&e.byteLength>=10){var o={cmd:0},a=new Uint8Array(e);a[0]===n.Heartbact_ack?(o.cmd=n.Heartbact_ack,o.lastIndex=t.get4ByteNumber(a,3),r(o)):i({code:-1,reason:"message type:"+a[0]})}else i({code:-1,reason:"buffer length "+e.byteLength})})})},e.prototype.set4ByteNumber=function(e,t,r){var n=t.toString(16);r+=4;for(var i=0;i<4;++i){if(!(n.length>=2)){if(n.length){var o=parseInt(n,16);e[r-i-1]=o}break}var a=parseInt(n.slice(n.length-2,n.length),16);n=n.substring(0,n.length-2),e[r-i-1]=a}},e.prototype.get4ByteNumber=function(e,t){for(var r="",n=t;n=e.lastIndex){t.messageCenter.allMessage[r].index===e.lastIndex&&(r+=1),t.messageCenter.allMessage.splice(0,r);break}}).catch(function(e){console.log("error pkg",e)})},t.prototype.onClose=function(e){this.uninitEvent(),this.wsState,o.Connecting,this.heartBeatManager.reconnectedFailed(),this.wsState=o.Disconnected,this.emit("onConnectStateChange")},t.prototype.onError=function(e){console.log("onError:",e)},t.prototype.initEvent=function(){this.ws.addEventListener("open",this.onOpen.bind(this)),this.ws.addEventListener("message",this.onMesssage.bind(this)),this.ws.addEventListener("close",this.onClose.bind(this)),this.ws.addEventListener("error",this.onError.bind(this))},t.prototype.uninitEvent=function(){var e,t,r,n;null===(e=this.ws)||void 0===e||e.removeEventListener("open",this.onOpen.bind(this)),null===(t=this.ws)||void 0===t||t.removeEventListener("message",this.onMesssage.bind(this)),null===(r=this.ws)||void 0===r||r.removeEventListener("close",this.onClose.bind(this)),null===(n=this.ws)||void 0===n||n.removeEventListener("error",this.onError.bind(this))},t.prototype.sendPackage=function(e){this.ws.send(e)},t.prototype.sendHeartBeatPackage=function(){this.sendPackage(this.packager.getHeartBeatPackage())},t.prototype.onReconnect=function(e){if(this.close(),e){var t=this.messageCenter.getMessage(),r=[];t.forEach(function(e){r.push(e.log)}),console.warn("onConnectFail",r),this.emit("onConnectFail",r)}else this.ws=new WebSocket(this.wsUrl),this.initEvent(),this.wsState=o.Connecting,this.emit("onConnectStateChange"),this.emit("onReconnect")},t}(c.default);t.WebsocketClient=l},116:function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.WsReporter=void 0;var o=r(873),a=r(815),s=r(570),c=function(e){function t(t,r){var n=e.call(this)||this;return n.logIndex=1,n.messageCache=new s.MessageCenter,n.config=r||{product:o.ProductType.RTC,defaultProtocol:o.ProtocolType.JSON},n.wsUrl=t,n.wsClient=new a.WebsocketClient(n.wsUrl,n.config),n.wsClient.on("onConnectStateChange",n.onWebsocketStateChange.bind(n)),n.wsClient.on("onConnectFail",n.onWebsocketConnectFail.bind(n)),n.wsClient.on("onReconnect",n.onWebsocketReconnect.bind(n)),n}return i(t,e),t.prototype.send=function(e){this.wsClient.state===a.ConnectState.Connected?this.realSendLog(e):this.messageCache.addMessage(e)},t.prototype.onWebsocketStateChange=function(){if(this.wsClient.state===a.ConnectState.Connected){var e=this.messageCache.getMessage();if(e.length>0)for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"";return!(!e||(this._message=this._validateAuthInfo(e),this._message))&&(this._sessionId=o.Guid.create(32),this._userId=e.userid,this._channel=e.channel,this._appid=e.appid,this._nonce=e.nonce,this._timestamp=e.timestamp,this._gslb=s.default.prefixAPI(e.gslb),this._token=e.token,this._publishCallid=s.default.random(32),this._type="alirtc",this._clientip=e.clientip,this._userName=t||this._userId,e.turn?this._turn={username:this._userId+"?appid="+this._appid+"&session="+this._sessionId+"&channel="+this._channel+"&nonce="+this._nonce+"×tamp="+this._timestamp,credential:e.turn.password}:this._turn={username:this._userId+"?appid="+this._appid+"&session="+this._sessionId+"&channel="+this._channel+"&nonce="+this._nonce+"×tamp="+this._timestamp+"&tokensid=false",credential:"hello1234"},!0)}},{key:"getErrorMessage",value:function(){return this._message}},{key:"_validateAuthInfo",value:function(e){var t="Channel authentication token parameter # cannot be empty",r="";return e.appid?e.channel?e.nonce?e.userid?e.timestamp?e.token?e.gslb||(r="gslb"):r="token":r="timestamp":r="userid":r="nonce":r="channel":r="appid",r?t=t.replace("#",r):/[^\d^\w^\-]+/.test(e.userid)?"Username(userid) can only be letters or numbers":""}},{key:"userName",get:function(){return this._userName}},{key:"userId",get:function(){return this._userId}},{key:"channel",get:function(){return this._channel}},{key:"appid",get:function(){return this._appid}},{key:"nonce",get:function(){return this._nonce}},{key:"timestamp",get:function(){return this._timestamp}},{key:"gslb",get:function(){return this._gslb}},{key:"token",get:function(){return this._token}},{key:"publishCallId",get:function(){return this._publishCallid}},{key:"sessionId",get:function(){return this._sessionId}},{key:"turn",get:function(){return this._turn}},{key:"type",get:function(){return this._type}},{key:"isGrtn",get:function(){return"grtn"===this._type}},{key:"clientip",get:function(){return this._clientip}}]),e}();t.default=c},function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t=this._logLevel){var r;(r=console).log.apply(r,[t].concat(n(e)))}}},{key:"info",value:function(){var e=Array.prototype.slice.call(arguments),t=this._getNowTime()+"[INFO] ";if(this.saveLocalMemory(t+JSON.stringify(e)),a.INFO>=this._logLevel){var r;(r=console).log.apply(r,[t].concat(n(e)))}}},{key:"warning",value:function(){var e=Array.prototype.slice.call(arguments),t=this._getNowTime()+" [WARNING] ";if(this.saveLocalMemory(t+JSON.stringify(e)),a.WARNING>=this._logLevel){var r;(r=console).log.apply(r,[t,"color:#F0E68C;"].concat(n(e)))}}},{key:"error",value:function(){var e=Array.prototype.slice.call(arguments),t=this._getNowTime()+" [ERROR] ";if(this.saveLocalMemory(t+JSON.stringify(e)),a.ERROR>=this._logLevel){var r;(r=console).log.apply(r,[t,"color:#FF0000;"].concat(n(e)))}}},{key:"setLogLevel",value:function(e){this._logLevel=e}},{key:"getLogLevel",value:function(){return this._logLevel}},{key:"enableLogUpload",value:function(){}},{key:"disableLogUpload",value:function(){}},{key:"saveLocalMemory",value:function(e){this._isSaveLocalLog()&&this._localLogList.push(e)}},{key:"exportLocalLog",value:function(){this._exportRaw((new Date).getTime(),JSON.stringify(this._localLogList))}},{key:"_isSaveLocalLog",value:function(){return!(!window.localStorage.getItem("AliRtcLogFlag")&&this._logLevel!=a.TRACE)}},{key:"_getNowTime",value:function(){return"%c ["+(new Date).toISOString()+"] AliRTC-SDK "}},{key:"_exportRaw",value:function(e,t){var r=window.URL||window.webkitURL||window,n=new Blob([t]),i=document.createElementNS("http://www.w3.org/1999/xhtml","a");i.href=r.createObjectURL(n),i.download=e,this._fakeClick(i)}},{key:"_fakeClick",value:function(e){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}]),e}();t.Logger=s,t.LogLevel=a},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.SignalingManager=void 0;var s=function(){function e(e,t){for(var r=0;r=0;--t){var r=e[t];if(-1!=r.indexOf("udp")){var n=r.indexOf(":",5),i=r.indexOf("?"),o=r.substring(0,n+1),a=r.substring(i,r.length);this._singlePort?e.splice(t,1,o+"3478"+a):e.splice(t,1,o+"80"+a,o+"443"+a,o+"3478"+a)}}return e}},{key:"singlePort",set:function(e){this._singlePort=e}},{key:"reqFialdIndex",get:function(){return this._signaling?this._signaling.reqFialdIndex:0}}]),t}(h.default)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.HttpSignaling=void 0;var s=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:100;this.cancel(),this._canceled=!1,this._longPollingHandle=setTimeout(function(){e._listen()},t)}},{key:"_restart",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;this._canceled||this.start(e)}},{key:"_listen",value:function(){var e=this;new Promise(function(t,r){return e._disposed?void r({errorCode:0}):e._authInfo.userId&&e._authInfo.token?(++e._seq,void d.default.get(e._apiManager.PollingUrl,{appid:e._authInfo.appid,session:e._authInfo.sessionId,server:e._apiManager.serverUrl,token:e._authInfo.token,merge:!0,seq:e._seq}).then(function(e){return e}).catch(function(e){return e}).then(function(r){r&&void 0!==r.datalist?(r.datalist?e._onSignalingDataList(r.datalist):e._onSignalingData(r),e._resetHeartBeatTimer(),e._restart(0),e._reqFialdIndex=0):r&&33620229==r.code?(e._stopHeartBeatTimer(),e._disposed=!0,e.cancel(),e.dispatchEvent(u.default.TimeOut,{sessionId:e._authInfo.sessionId})):(++e._reqFialdIndex,e._reqFialdIndex<=10?e._restart(0):e._reqFialdIndex<=100?e._restart(1e3):e._restart(5e3)),t()})):void t(null)})}},{key:"_resetHeartBeatTimer",value:function(){this._stopHeartBeatTimer(),this._canceled||this._startHeartBeatTimer()}},{key:"_stopHeartBeatTimer",value:function(){this._heartBeatTimerIndex&&clearTimeout(this._heartBeatTimerIndex),this._heartBeatTimerIndex=0}},{key:"_startHeartBeatTimer",value:function(){var e=this;this._heartBeatTimerIndex=setTimeout(function(t){e._disposed=!0,e.cancel(),e.dispatchEvent(u.default.TimeOut,{sessionId:e._authInfo.sessionId})},9e4)}},{key:"_onSignalingDataList",value:function(e){var t=this;e&&e.forEach(function(e){if(e)if(0==e.code)t._onSignalingData(e.data);else{var r=e.data;r.code=r.code?r.code:e.code,r.description=r.description?r.description:e.description,t._onSignalingData(r)}})}},{key:"_onSignalingData",value:function(e){e.event&&this.dispatchEvent(e.event,e),e.tid&&this.dispatchEvent(e.tid,e)}},{key:"reqFialdIndex",get:function(){return this._reqFialdIndex}}]),t}(h.default)},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.SignalingBase=void 0;var a=function(){function e(e,t){for(var r=0;r-1?"http://":"//";this._baseUrl=t+"alirtc.cn-shanghai.log.aliyuncs.com/logstores/client_h5/track",this._index=0,this._initParam()}return o(e,[{key:"uploadCreateInstance",value:function(){var e={evetid:70011};this._report(e),a.BrowserUtil.isUnknow&&this.reportUnknowBrowser()}},{key:"reportJoinChannel",value:function(e,t){var r={evetid:70012,args:JSON.stringify({jnnonce:e?e.nonce:"",jntoken:e?e.token:"",jntm:e?e.timestamp:""})};this._param=i({},this._param,{apid:e?e.appid:"",usrid:e?e.userid:"",channelid:e?e.channel:"",usrn:t||""}),this._report(r)}},{key:"reportJoinChannelRes",value:function(e,t,r){var n={evetid:70013,args:JSON.stringify({rslt:e,message:t,ct:r})};this._report(n)}},{key:"reportGetAuthInfo",value:function(e,t,r){this._param.sesid=r;var n={evetid:70014,args:JSON.stringify({asty:e,rslt:t})};this._report(n)}},{key:"reportLeaveChannel",value:function(){var e={evetid:70015};this._report(e)}},{key:"reportUnknowBrowser",value:function(){var e={evetid:70016,args:JSON.stringify({ua:navigator.userAgent})};this._report(e)}},{key:"_initParam",value:function(){this._param||(this._param={APIVersion:"0.6.0",apid:"",usrid:"",statsvrs:"0.1.0",sesid:"",channelid:"",usrn:"",osn:a.SystemUtil.systemName,osv:a.SystemUtil.systemVersion,udid:a.LocalStorage.uuid,sdkv:c.default.version,bt:a.BrowserUtil.browserName,bv:a.BrowserUtil.browserVersion})}},{key:"_report",value:function(e){++this._index;var t=i({},this._param,{tm:(new Date).getTime(),idx:this._index},e);(new Image).src=this._baseUrl+"?"+this._data2String(t)}},{key:"_data2String",value:function(e){var t="";for(var r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=r+"="+e[r]);return t}}]),e}()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.RtcMediaDeviceFactory=void 0;var o=function(){function e(e,t){for(var r=0;rthis._timerGap)if(this._lastTimeStamp=e,this._cameraVideo&&this._cameraVideo.srcObject){var t=this._cameraVideo.srcObject.getVideoTracks()[0].getSettings();t.width==this._cameraVideoCanvas.width&&t.height==this._cameraVideoCanvas.height||(this._cameraVideoCanvas.width=t.width,this._cameraVideoCanvas.height=t.height),this._context.drawImage(this._cameraVideo,0,0,this._cameraVideoCanvas.width,this._cameraVideoCanvas.height)}else this._context.clearRect(0,0,this._cameraVideoCanvas.width,this._cameraVideoCanvas.height)}}]),e}());t.default=a},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r-1?(n.push({kind:"videoinput",facingMode:"user",label:"前置摄像头"}),e._videoDeviceMap.user=t.deviceId):t.label.indexOf("back")>-1&&(n.push({kind:"videoinput",facingMode:"environment",label:"后置摄像头"}),e._videoDeviceMap.environment=t.deviceId)):"audiooutput"===t.kind&&o.push(t)});var a={videoDevices:n,audioDevices:i,audioOutputDevices:o};e._log.reportGetDevice(a),t(a)}).catch(function(t){e._log.reportGetDevice(t),r(t)})})}}]),t}(c.default);t.default=u},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;rthis._timerGap){this._lastTimeStamp=e,this._context.clearRect(0,0,this._screenShareCanvas.width,this._screenShareCanvas.height);var t=this._screenShareVideo.videoWidth,r=this._screenShareVideo.videoHeight,n=(t/r).toFixed(3);if(n==this._aspectRatio)this._context.drawImage(this._screenShareVideo,0,0);else if(this._aspectRatio>n)if(Math.abs(this._screenShareCanvas.height-r)>5){var i=this._screenShareCanvas.height/r,o=t*i;this._context.drawImage(this._screenShareVideo,.5*(this._screenShareCanvas.width-o),0,o,this._screenShareCanvas.height)}else this._context.drawImage(this._screenShareVideo,.5*(this._screenShareCanvas.width-t),0);else if(Math.abs(this._screenShareCanvas.width-t)>5){var a=this._screenShareCanvas.width/t,s=r*a;this._context.drawImage(this._screenShareVideo,0,.5*(this._screenShareCanvas.height-s),this._screenShareCanvas.width,s)}else this._context.drawImage(this._screenShareVideo,0,.5*(this._screenShareCanvas.height-r))}}},{key:"_excuteScreenShareErrorCallback",value:function(e){this._errorCallback&&this._errorCallback(e)}},{key:"_startBackgroundAudio",value:function(){var e=this;this._video||navigator.mediaDevices.getUserMedia({audio:!0}).then(function(t){e._video=document.createElement("video"),e._video.autoplay=!0,e._video.volume=0,e._video.srcObject=t}).catch(function(e){})}},{key:"_startElectronScreenShare",value:function(e,t,r){var n=this;return new Promise(function(r,i){navigator.mediaDevices.getUserMedia({audio:!1,video:{mandatory:{chromeMediaSource:"screen",minWidth:e,maxWidth:e,minHeight:t,maxHeight:t}}}).then(function(e){n._screenShareTrack=e.getVideoTracks()[0],n._screenShareTrack.onended=function(e){n._excuteScreenShareErrorCallback(c.default.parseScreenShareDeviceError(e))},n._screenShareVideo.srcObject=e,n._startTimer(),r()}).catch(function(e){i(e)})})}},{key:"_startElectronDesktopAudio",value:function(){return new Promise(function(e,t){navigator.mediaDevices.getUserMedia({video:{mandatory:{chromeMediaSource:"desktop"}},audio:{mandatory:{chromeMediaSource:"desktop"}}}).then(function(e){}).catch(function(e){})})}},{key:"_startChromeScreenShare",value:function(e,t,r){var n=this;return new Promise(function(i,o){navigator.mediaDevices.getDisplayMedia({video:{width:e,height:t,frameRate:r},audio:!0}).then(function(e){n._screenShareAudioTrack=e.getAudioTracks()[0],n._screenShareTrack=e.getVideoTracks()[0],n._screenShareTrack.onended=function(e){n._excuteScreenShareErrorCallback(c.default.parseScreenShareDeviceError(e))},n._screenShareAudioTrack&&e.removeTrack(n._screenShareAudioTrack),n._screenShareVideo.srcObject=e,n._workerTimer.isSupport||n._startBackgroundAudio(),n._startTimer(),i()}).catch(function(e){n._excuteScreenShareErrorCallback(c.default.parseScreenShareDeviceError(e)),o(e)})})}},{key:"_startFirefoxScreenShare",value:function(e,t,r){var n=this;navigator.mediaDevices.getUserMedia({video:{mediaSource:"screen"}}).then(function(e){n._screenShareTrack=e.getVideoTracks()[0],n._screenShareTrack.onended=function(e){},n._screenShareVideo.srcObject=e,n._startTimer(),resolve()}).catch(function(e){n._excuteScreenShareErrorCallback(c.default.parseScreenShareDeviceError(e)),reject(e)})}},{key:"_startSafariScreenShare",value:function(e,t,r){var n=this;return new Promise(function(i,o){navigator.mediaDevices.getDisplayMedia({video:{width:e,height:t,frameRate:r}}).then(function(e){n._screenShareTrack=e.getVideoTracks()[0],n._screenShareTrack.onended=function(e){n._excuteScreenShareErrorCallback(c.default.parseScreenShareDeviceError(e))},n._screenShareVideo.srcObject=e,n._workerTimer.isSupport||n._startBackgroundAudio(),n._startTimer(),i()}).catch(function(e){n._excuteScreenShareErrorCallback(c.default.parseScreenShareDeviceError(e)),o(e)})})}}]),e}();t.default=d},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r0&&arguments[0]instanceof e.MediaStreamTrack){var r,n,i,o=arguments[0];return t.getSenders().forEach(function(e){e.track===o&&(r?i=!0:r=e)}),t.getReceivers().forEach(function(e){return e.track===o&&(n?i=!0:n=e),e.track===o}),i||r&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):r?r.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return s.apply(t,arguments)}}}},shimSourceObject:function(e){var t=e&&e.URL;"object"===(void 0===e?"undefined":o(e))&&(!e.HTMLMediaElement||"srcObject"in e.HTMLMediaElement.prototype||Object.defineProperty(e.HTMLMediaElement.prototype,"srcObject",{get:function(){return this._srcObject},set:function(e){var r=this;if(this._srcObject=e,this.src&&t.revokeObjectURL(this.src),!e)return void(this.src="");this.src=t.createObjectURL(e),e.addEventListener("addtrack",function(){r.src&&t.revokeObjectURL(r.src),r.src=t.createObjectURL(e)}),e.addEventListener("removetrack",function(){r.src&&t.revokeObjectURL(r.src),r.src=t.createObjectURL(e)})}}))},shimAddTrackRemoveTrackWithNative:function(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(function(t){return e._shimmedLocalStreams[t][0]})};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){if(!r)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var n=t.apply(this,arguments);return this._shimmedLocalStreams[r.id]?-1===this._shimmedLocalStreams[r.id].indexOf(n)&&this._shimmedLocalStreams[r.id].push(n):this._shimmedLocalStreams[r.id]=[r,n],n};var r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach(function(e){if(t.getSenders().find(function(t){return t.track===e}))throw new DOMException("Track already exists.","InvalidAccessError")});var n=t.getSenders();r.apply(this,arguments);var i=t.getSenders().filter(function(e){return-1===n.indexOf(e)});this._shimmedLocalStreams[e.id]=[e].concat(i)};var n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],n.apply(this,arguments)};var i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach(function(r){var n=t._shimmedLocalStreams[r].indexOf(e);-1!==n&&t._shimmedLocalStreams[r].splice(n,1),1===t._shimmedLocalStreams[r].length&&delete t._shimmedLocalStreams[r]}),i.apply(this,arguments)}},shimAddTrackRemoveTrack:function(e){function t(e,t){var r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(function(t){var n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(i.id,"g"),n.id)}),new RTCSessionDescription({type:t.type,sdp:r})}function r(e,t){var r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(function(t){var n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(n.id,"g"),i.id)}),new RTCSessionDescription({type:t.type,sdp:r})}if(e.RTCPeerConnection){var n=a.detectBrowser(e);if(e.RTCPeerConnection.prototype.addTrack&&n.version>=65)return this.shimAddTrackRemoveTrackWithNative(e);var i=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=i.apply(this);return e._reverseStreams=e._reverseStreams||{},t.map(function(t){return e._reverseStreams[t.id]})};var o=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var r=this;if(r._streams=r._streams||{},r._reverseStreams=r._reverseStreams||{},t.getTracks().forEach(function(e){if(r.getSenders().find(function(t){return t.track===e}))throw new DOMException("Track already exists.","InvalidAccessError")}),!r._reverseStreams[t.id]){var n=new e.MediaStream(t.getTracks());r._streams[t.id]=n,r._reverseStreams[n.id]=t,t=n}o.apply(r,[t])};var s=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;t._streams=t._streams||{},t._reverseStreams=t._reverseStreams||{},s.apply(t,[t._streams[e.id]||e]),delete t._reverseStreams[t._streams[e.id]?t._streams[e.id].id:e.id],delete t._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,r){var n=this;if("closed"===n.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find(function(e){return e===t}))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(n.getSenders().find(function(e){return e.track===t}))throw new DOMException("Track already exists.","InvalidAccessError");n._streams=n._streams||{},n._reverseStreams=n._reverseStreams||{};var o=n._streams[r.id];if(o)o.addTrack(t),Promise.resolve().then(function(){n.dispatchEvent(new Event("negotiationneeded"))});else{var a=new e.MediaStream([t]);n._streams[r.id]=a,n._reverseStreams[a.id]=r,n.addStream(a)}return n.getSenders().find(function(e){return e.track===t})},["createOffer","createAnswer"].forEach(function(r){var n=e.RTCPeerConnection.prototype[r];e.RTCPeerConnection.prototype[r]=function(){var e=this,r=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(e,[function(n){var i=t(e,n);r[0].apply(null,[i])},function(e){r[1]&&r[1].apply(null,e)},arguments[2]]):n.apply(e,arguments).then(function(r){return t(e,r)})}});var c=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){var e=this;return arguments.length&&arguments[0].type?(arguments[0]=r(e,arguments[0]),c.apply(e,arguments)):c.apply(e,arguments)};var u=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=this,r=u.get.apply(this);return""===r.type?r:t(e,r)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;if("closed"===t.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==t)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");t._streams=t._streams||{};var r;Object.keys(t._streams).forEach(function(n){t._streams[n].getTracks().find(function(t){return e.track===t})&&(r=t._streams[n])}),r&&(1===r.getTracks().length?t.removeStream(t._reverseStreams[r.id]):r.removeTrack(e.track),t.dispatchEvent(new Event("negotiationneeded")))}}},shimPeerConnection:function(e){var t=a.detectBrowser(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=function(t,r){return s("PeerConnection"),t&&t.iceTransportPolicy&&(t.iceTransports=t.iceTransportPolicy),new e.webkitRTCPeerConnection(t,r)},e.RTCPeerConnection.prototype=e.webkitRTCPeerConnection.prototype,e.webkitRTCPeerConnection.generateCertificate&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return e.webkitRTCPeerConnection.generateCertificate}})),e.RTCPeerConnection){var r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(e,t,n){var i=this,o=arguments;if(arguments.length>0&&"function"==typeof e)return r.apply(this,arguments);if(0===r.length&&(0===arguments.length||"function"!=typeof arguments[0]))return r.apply(this,[]);var a=function(e){var t={};return e.result().forEach(function(e){var r={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach(function(t){r[t]=e.stat(t)}),t[r.id]=r}),t},s=function(e){return new Map(Object.keys(e).map(function(t){return[t,e[t]]}))};if(arguments.length>=2){var c=function(e){o[1](s(a(e)))};return r.apply(this,[c,arguments[0]])}return new Promise(function(e,t){r.apply(i,[function(t){e(s(a(t)))},t])}).then(t,n)},t.version<51&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var r=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){var e=arguments,t=this,n=new Promise(function(n,i){r.apply(t,[e[0],n,i])});return e.length<2?n:n.then(function(){e[1].apply(null,[])},function(t){e.length>=3&&e[2].apply(null,[t])})}}),t.version<52&&["createOffer","createAnswer"].forEach(function(t){var r=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){var e=this;if(arguments.length<1||1===arguments.length&&"object"===o(arguments[0])){var t=1===arguments.length?arguments[0]:void 0;return new Promise(function(n,i){r.apply(e,[n,i,t])})}return r.apply(this,arguments)}}),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var r=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}});var n=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}},fixNegotiationNeeded:function(e){a.wrapPeerConnectionEvent(e,"negotiationneeded",function(e){if("stable"===e.target.signalingState)return e})},shimGetDisplayMedia:function(e,t){if(e.navigator&&e.navigator.mediaDevices&&!("getDisplayMedia"in e.navigator.mediaDevices)){if("function"!=typeof t)return void console.error("shimGetDisplayMedia: getSourceId argument is not a function");e.navigator.mediaDevices.getDisplayMedia=function(r){return t(r).then(function(t){var n=r.video&&r.video.width,i=r.video&&r.video.height,o=r.video&&r.video.frameRate;return r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},n&&(r.video.mandatory.maxWidth=n),i&&(r.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(r)})},e.navigator.getDisplayMedia=function(t){return a.deprecated("navigator.getDisplayMedia","navigator.mediaDevices.getDisplayMedia"),e.navigator.mediaDevices.getDisplayMedia(t)}}}}},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(15),o=i.log;e.exports=function(e){var t=i.detectBrowser(e),r=e&&e.navigator,a=function(e){if("object"!==(void 0===e?"undefined":n(e))||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach(function(r){if("require"!==r&&"advanced"!==r&&"mediaSource"!==r){var i="object"===n(e[r])?e[r]:{ideal:e[r]};void 0!==i.exact&&"number"==typeof i.exact&&(i.min=i.max=i.exact);var o=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==i.ideal){t.optional=t.optional||[];var a={};"number"==typeof i.ideal?(a[o("min",r)]=i.ideal,t.optional.push(a),a={},a[o("max",r)]=i.ideal,t.optional.push(a)):(a[o("",r)]=i.ideal,t.optional.push(a))}void 0!==i.exact&&"number"!=typeof i.exact?(t.mandatory=t.mandatory||{},t.mandatory[o("",r)]=i.exact):["min","max"].forEach(function(e){void 0!==i[e]&&(t.mandatory=t.mandatory||{},t.mandatory[o(e,r)]=i[e])})}}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},s=function(e,i){if(t.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"===n(e.audio)){var s=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])};e=JSON.parse(JSON.stringify(e)),s(e.audio,"autoGainControl","googAutoGainControl"),s(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=a(e.audio)}if(e&&"object"===n(e.video)){var c=e.video.facingMode;c=c&&("object"===(void 0===c?"undefined":n(c))?c:{ideal:c});var u=t.version<66;if(c&&("user"===c.exact||"environment"===c.exact||"user"===c.ideal||"environment"===c.ideal)&&(!r.mediaDevices.getSupportedConstraints||!r.mediaDevices.getSupportedConstraints().facingMode||u)){delete e.video.facingMode;var l;if("environment"===c.exact||"environment"===c.ideal?l=["back","rear"]:"user"!==c.exact&&"user"!==c.ideal||(l=["front"]),l)return r.mediaDevices.enumerateDevices().then(function(t){t=t.filter(function(e){return"videoinput"===e.kind});var r=t.find(function(e){return l.some(function(t){return-1!==e.label.toLowerCase().indexOf(t)})});return!r&&t.length&&-1!==l.indexOf("back")&&(r=t[t.length-1]),r&&(e.video.deviceId=c.exact?{exact:r.deviceId}:{ideal:r.deviceId}),e.video=a(e.video),o("chrome: "+JSON.stringify(e)),i(e)})}e.video=a(e.video)}return o("chrome: "+JSON.stringify(e)),i(e)},c=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},u=function(e,t,n){s(e,function(e){r.webkitGetUserMedia(e,t,function(e){n&&n(c(e))})})};r.getUserMedia=u;var l=function(e){return new Promise(function(t,n){r.getUserMedia(e,t,n)})};if(r.mediaDevices||(r.mediaDevices={getUserMedia:l,enumerateDevices:function(){return new Promise(function(t){var r={audio:"audioinput",video:"videoinput"};return e.MediaStreamTrack.getSources(function(e){t(e.map(function(e){return{label:e.label,kind:r[e.kind],deviceId:e.id,groupId:""}}))})})},getSupportedConstraints:function(){return{deviceId:!0,echoCancellation:!0,facingMode:!0,frameRate:!0,height:!0,width:!0}}}),r.mediaDevices.getUserMedia){var d=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(e){return s(e,function(e){return d(e).then(function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach(function(e){e.stop()}),new DOMException("","NotFoundError");return t},function(e){return Promise.reject(c(e))})})}}else r.mediaDevices.getUserMedia=function(e){return l(e)};void 0===r.mediaDevices.addEventListener&&(r.mediaDevices.addEventListener=function(){o("Dummy mediaDevices.addEventListener called.")}),void 0===r.mediaDevices.removeEventListener&&(r.mediaDevices.removeEventListener=function(){o("Dummy mediaDevices.removeEventListener called.")})}},function(e,t,r){"use strict";var n=r(15),i=r(203),o=r(204);e.exports={shimGetUserMedia:r(205),shimPeerConnection:function(e){var t=n.detectBrowser(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){var r=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){r.set.call(this,e);var t=new Event("enabled");t.enabled=e,this.dispatchEvent(t)}})}!e.RTCRtpSender||"dtmf"in e.RTCRtpSender.prototype||Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);var a=o(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=i(e.iceServers)),new a(e)},e.RTCPeerConnection.prototype=a.prototype},shimReplaceTrack:function(e){!e.RTCRtpSender||"replaceTrack"in e.RTCRtpSender.prototype||(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)},shimGetDisplayMedia:function(e,t){if("getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&!("getDisplayMedia"in e.navigator.mediaDevices)){var r=e.navigator.getDisplayMedia;e.navigator.mediaDevices.getDisplayMedia=function(t){return r.call(e.navigator,t)},e.navigator.getDisplayMedia=function(t){return n.deprecated("navigator.getDisplayMedia","navigator.mediaDevices.getDisplayMedia"),r.call(e.navigator,t)}}}}},function(e,t,r){"use strict";var n=r(15);e.exports=function(e,t){var r=!1;return e=JSON.parse(JSON.stringify(e)),e.filter(function(e){if(e&&(e.urls||e.url)){var i=e.urls||e.url;e.url&&!e.urls&&n.deprecated("RTCIceServer.url","RTCIceServer.urls");var o="string"==typeof i;return o&&(i=[i]),i=i.filter(function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||r?0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp"):(r=!0,!0)}),delete e.url,e.urls=o?i[0]:i,!!i.length}})}},function(e,t,r){"use strict";function n(e){return{inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type}function i(e,t,r,n,i){var o=l.writeRtpDescription(e.kind,t);if(o+=l.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=l.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===r?"actpass":i||"active"),o+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var a=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=a;var s="msid:"+(n?n.id:"-")+" "+a+"\r\n";o+="a="+s,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+s,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+l.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+l.localCName+"\r\n"),o}function o(e,t){var r=!1;return e=JSON.parse(JSON.stringify(e)),e.filter(function(e){if(e&&(e.urls||e.url)){var n=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var i="string"==typeof n;return i&&(n=[n]),n=n.filter(function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||r?0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp"):(r=!0,!0)}),delete e.url,e.urls=i?n[0]:n,!!n.length}})}function a(e,t){var r={codecs:[],headerExtensions:[],fecMechanisms:[]},n=function(e,t){e=parseInt(e,10);for(var r=0;r0;a--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:r.iceServers,gatherPolicy:r.iceTransportPolicy}));else r.iceCandidatePoolSize=0;this._config=r,this.transceivers=[],this._sdpSessionId=l.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(h.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(h.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),h.prototype.onicecandidate=null,h.prototype.onaddstream=null,h.prototype.ontrack=null,h.prototype.onremovestream=null,h.prototype.onsignalingstatechange=null,h.prototype.oniceconnectionstatechange=null,h.prototype.onconnectionstatechange=null,h.prototype.onicegatheringstatechange=null,h.prototype.onnegotiationneeded=null,h.prototype.ondatachannel=null,h.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},h.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},h.prototype.getConfiguration=function(){return this._config},h.prototype.getLocalStreams=function(){return this.localStreams},h.prototype.getRemoteStreams=function(){return this.remoteStreams},h.prototype._createTransceiver=function(e,t){var r=this.transceivers.length>0,n={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&r)n.iceTransport=this.transceivers[0].iceTransport,n.dtlsTransport=this.transceivers[0].dtlsTransport;else{var i=this._createIceAndDtlsTransports();n.iceTransport=i.iceTransport,n.dtlsTransport=i.dtlsTransport}return t||this.transceivers.push(n),n},h.prototype.addTrack=function(t,r){if(this._isClosed)throw u("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");if(this.transceivers.find(function(e){return e.track===t}))throw u("InvalidAccessError","Track already exists.");for(var n,i=0;i=15025)e.getTracks().forEach(function(t){r.addTrack(t,e)});else{var n=e.clone();e.getTracks().forEach(function(e,t){var r=n.getTracks()[t];e.addEventListener("enabled",function(e){r.enabled=e.enabled})}),n.getTracks().forEach(function(e){r.addTrack(e,n)})}},h.prototype.removeTrack=function(t){if(this._isClosed)throw u("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var r=this.transceivers.find(function(e){return e.rtpSender===t});if(!r)throw u("InvalidAccessError","Sender was not created by this connection.");var n=r.stream;r.rtpSender.stop(),r.rtpSender=null,r.track=null,r.stream=null,-1===this.transceivers.map(function(e){return e.stream}).indexOf(n)&&this.localStreams.indexOf(n)>-1&&this.localStreams.splice(this.localStreams.indexOf(n),1),this._maybeFireNegotiationNeeded()},h.prototype.removeStream=function(e){var t=this;e.getTracks().forEach(function(e){var r=t.getSenders().find(function(t){return t.track===e});r&&t.removeTrack(r)})},h.prototype.getSenders=function(){return this.transceivers.filter(function(e){return!!e.rtpSender}).map(function(e){return e.rtpSender})},h.prototype.getReceivers=function(){return this.transceivers.filter(function(e){return!!e.rtpReceiver}).map(function(e){return e.rtpReceiver})},h.prototype._createIceGatherer=function(t,r){var n=this;if(r&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var i=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(i,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var r=!e.candidate||0===Object.keys(e.candidate).length;i.state=r?"completed":"gathering",null!==n.transceivers[t].bufferedCandidateEvents&&n.transceivers[t].bufferedCandidateEvents.push(e)},i.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),i},h.prototype._gather=function(t,r){var n=this,i=this.transceivers[r].iceGatherer;if(!i.onlocalcandidate){var o=this.transceivers[r].bufferedCandidateEvents;this.transceivers[r].bufferedCandidateEvents=null,i.removeEventListener("localcandidate",this.transceivers[r].bufferCandidates),i.onlocalcandidate=function(e){if(!(n.usingBundle&&r>0)){var o=new Event("icecandidate");o.candidate={sdpMid:t,sdpMLineIndex:r};var a=e.candidate,s=!a||0===Object.keys(a).length;if(s)"new"!==i.state&&"gathering"!==i.state||(i.state="completed");else{"new"===i.state&&(i.state="gathering"),a.component=1,a.ufrag=i.getLocalParameters().usernameFragment;var c=l.writeCandidate(a);o.candidate=Object.assign(o.candidate,l.parseCandidate(c)),o.candidate.candidate=c,o.candidate.toJSON=function(){return{candidate:o.candidate.candidate,sdpMid:o.candidate.sdpMid,sdpMLineIndex:o.candidate.sdpMLineIndex,usernameFragment:o.candidate.usernameFragment}}}var u=l.getMediaSections(n._localDescription.sdp);u[o.candidate.sdpMLineIndex]+=s?"a=end-of-candidates\r\n":"a="+o.candidate.candidate+"\r\n",n._localDescription.sdp=l.getDescription(n._localDescription.sdp)+u.join("");var d=n.transceivers.every(function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state});"gathering"!==n.iceGatheringState&&(n.iceGatheringState="gathering",n._emitGatheringStateChange()),s||n._dispatchEvent("icecandidate",o),d&&(n._dispatchEvent("icecandidate",new Event("icecandidate")),n.iceGatheringState="complete",n._emitGatheringStateChange())}},e.setTimeout(function(){o.forEach(function(e){i.onlocalcandidate(e)})},0)}},h.prototype._createIceAndDtlsTransports=function(){var t=this,r=new e.RTCIceTransport(null);r.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var n=new e.RTCDtlsTransport(r);return n.ondtlsstatechange=function(){t._updateConnectionState()},n.onerror=function(){Object.defineProperty(n,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:r,dtlsTransport:n}},h.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var r=this.transceivers[e].iceTransport;r&&(delete r.onicestatechange,delete this.transceivers[e].iceTransport);var n=this.transceivers[e].dtlsTransport;n&&(delete n.ondtlsstatechange,delete n.onerror,delete this.transceivers[e].dtlsTransport)},h.prototype._transceive=function(e,r,n){var i=a(e.localCapabilities,e.remoteCapabilities);r&&e.rtpSender&&(i.encodings=e.sendEncodingParameters,i.rtcp={cname:l.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(i.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(i)),n&&e.rtpReceiver&&i.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach(function(e){delete e.rtx}),e.recvEncodingParameters.length?i.encodings=e.recvEncodingParameters:i.encodings=[{}],i.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(i.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(i.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(i))},h.prototype.setLocalDescription=function(e){var t=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(u("TypeError",'Unsupported type "'+e.type+'"'));if(!s("setLocalDescription",e.type,t.signalingState)||t._isClosed)return Promise.reject(u("InvalidStateError","Can not set local "+e.type+" in state "+t.signalingState));var r,n;if("offer"===e.type)r=l.splitSections(e.sdp),n=r.shift(),r.forEach(function(e,r){var n=l.parseRtpParameters(e);t.transceivers[r].localCapabilities=n}),t.transceivers.forEach(function(e,r){t._gather(e.mid,r)});else if("answer"===e.type){r=l.splitSections(t._remoteDescription.sdp),n=r.shift();var i=l.matchPrefix(n,"a=ice-lite").length>0;r.forEach(function(e,r){var o=t.transceivers[r],s=o.iceGatherer,c=o.iceTransport,u=o.dtlsTransport,d=o.localCapabilities,f=o.remoteCapabilities;if(!(l.isRejected(e)&&0===l.matchPrefix(e,"a=bundle-only").length||o.rejected)){var h=l.getIceParameters(e,n),p=l.getDtlsParameters(e,n);i&&(p.role="server"),t.usingBundle&&0!==r||(t._gather(o.mid,r),"new"===c.state&&c.start(s,h,i?"controlling":"controlled"),"new"===u.state&&u.start(p));var _=a(d,f);t._transceive(o,_.codecs.length>0,!1)}})}return t._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?t._updateSignalingState("have-local-offer"):t._updateSignalingState("stable"),Promise.resolve()},h.prototype.setRemoteDescription=function(n){var i=this;if(-1===["offer","answer"].indexOf(n.type))return Promise.reject(u("TypeError",'Unsupported type "'+n.type+'"'));if(!s("setRemoteDescription",n.type,i.signalingState)||i._isClosed)return Promise.reject(u("InvalidStateError","Can not set remote "+n.type+" in state "+i.signalingState));var o={};i.remoteStreams.forEach(function(e){o[e.id]=e});var h=[],p=l.splitSections(n.sdp),_=p.shift(),m=l.matchPrefix(_,"a=ice-lite").length>0,v=l.matchPrefix(_,"a=group:BUNDLE ").length>0;i.usingBundle=v;var y=l.matchPrefix(_,"a=ice-options:")[0];return i.canTrickleIceCandidates=!!y&&y.substr(14).split(" ").indexOf("trickle")>=0,p.forEach(function(s,u){var f=l.splitLines(s),p=l.getKind(s),y=l.isRejected(s)&&0===l.matchPrefix(s,"a=bundle-only").length,g=f[0].substr(2).split(" ")[2],b=l.getDirection(s,_),S=l.parseMsid(s),k=l.getMid(s)||l.generateIdentifier();if(y||"application"===p&&("DTLS/SCTP"===g||"UDP/DTLS/SCTP"===g))return void(i.transceivers[u]={mid:k,kind:p,protocol:g,rejected:!0});!y&&i.transceivers[u]&&i.transceivers[u].rejected&&(i.transceivers[u]=i._createTransceiver(p,!0));var w,C,R,E,T,O,P,A,I,M,D,x=l.parseRtpParameters(s);y||(M=l.getIceParameters(s,_),D=l.getDtlsParameters(s,_),D.role="client"),P=l.parseRtpEncodingParameters(s);var L=l.parseRtcpParameters(s),N=l.matchPrefix(s,"a=end-of-candidates",_).length>0,j=l.matchPrefix(s,"a=candidate:").map(function(e){return l.parseCandidate(e)}).filter(function(e){return 1===e.component});if(("offer"===n.type||"answer"===n.type)&&!y&&v&&u>0&&i.transceivers[u]&&(i._disposeIceAndDtlsTransports(u),i.transceivers[u].iceGatherer=i.transceivers[0].iceGatherer,i.transceivers[u].iceTransport=i.transceivers[0].iceTransport,i.transceivers[u].dtlsTransport=i.transceivers[0].dtlsTransport,i.transceivers[u].rtpSender&&i.transceivers[u].rtpSender.setTransport(i.transceivers[0].dtlsTransport),i.transceivers[u].rtpReceiver&&i.transceivers[u].rtpReceiver.setTransport(i.transceivers[0].dtlsTransport)),"offer"!==n.type||y){if("answer"===n.type&&!y){w=i.transceivers[u],C=w.iceGatherer,R=w.iceTransport,E=w.dtlsTransport,T=w.rtpReceiver,O=w.sendEncodingParameters,A=w.localCapabilities,i.transceivers[u].recvEncodingParameters=P,i.transceivers[u].remoteCapabilities=x,i.transceivers[u].rtcpParameters=L,j.length&&"new"===R.state&&(!m&&!N||v&&0!==u?j.forEach(function(e){c(w.iceTransport,e)}):R.setRemoteCandidates(j)),v&&0!==u||("new"===R.state&&R.start(C,M,"controlling"),"new"===E.state&&E.start(D));var V=a(w.localCapabilities,w.remoteCapabilities),B=V.codecs.filter(function(e){return"rtx"===e.name.toLowerCase()}).length;!B&&w.sendEncodingParameters[0].rtx&&delete w.sendEncodingParameters[0].rtx,i._transceive(w,"sendrecv"===b||"recvonly"===b,"sendrecv"===b||"sendonly"===b),!T||"sendrecv"!==b&&"sendonly"!==b?delete w.rtpReceiver:(I=T.track,S?(o[S.stream]||(o[S.stream]=new e.MediaStream),r(I,o[S.stream]),h.push([I,T,o[S.stream]])):(o.default||(o.default=new e.MediaStream),r(I,o.default),h.push([I,T,o.default])))}}else{w=i.transceivers[u]||i._createTransceiver(p),w.mid=k,w.iceGatherer||(w.iceGatherer=i._createIceGatherer(u,v)),j.length&&"new"===w.iceTransport.state&&(!N||v&&0!==u?j.forEach(function(e){c(w.iceTransport,e)}):w.iceTransport.setRemoteCandidates(j)),A=e.RTCRtpReceiver.getCapabilities(p),t<15019&&(A.codecs=A.codecs.filter(function(e){return"rtx"!==e.name})),O=w.sendEncodingParameters||[{ssrc:1001*(2*u+2)}];var U=!1;if("sendrecv"===b||"sendonly"===b){if(U=!w.rtpReceiver,T=w.rtpReceiver||new e.RTCRtpReceiver(w.dtlsTransport,p),U){var F;I=T.track,S&&"-"===S.stream||(S?(o[S.stream]||(o[S.stream]=new e.MediaStream,Object.defineProperty(o[S.stream],"id",{get:function(){return S.stream}})),Object.defineProperty(I,"id",{get:function(){return S.track}}),F=o[S.stream]):(o.default||(o.default=new e.MediaStream),F=o.default)),F&&(r(I,F),w.associatedRemoteMediaStreams.push(F)),h.push([I,T,F])}}else w.rtpReceiver&&w.rtpReceiver.track&&(w.associatedRemoteMediaStreams.forEach(function(e){var t=e.getTracks().find(function(e){return e.id===w.rtpReceiver.track.id});t&&d(t,e)}),w.associatedRemoteMediaStreams=[]);w.localCapabilities=A,w.remoteCapabilities=x,w.rtpReceiver=T,w.rtcpParameters=L,w.sendEncodingParameters=O,w.recvEncodingParameters=P,i._transceive(i.transceivers[u],!1,U)}}),void 0===i._dtlsRole&&(i._dtlsRole="offer"===n.type?"active":"passive"),i._remoteDescription={type:n.type,sdp:n.sdp},"offer"===n.type?i._updateSignalingState("have-remote-offer"):i._updateSignalingState("stable"),Object.keys(o).forEach(function(t){var r=o[t];if(r.getTracks().length){if(-1===i.remoteStreams.indexOf(r)){i.remoteStreams.push(r);var n=new Event("addstream");n.stream=r,e.setTimeout(function(){i._dispatchEvent("addstream",n)})}h.forEach(function(e){var t=e[0],n=e[1];r.id===e[2].id&&f(i,t,n,[r])})}}),h.forEach(function(e){e[2]||f(i,e[0],e[1],[])}),e.setTimeout(function(){i&&i.transceivers&&i.transceivers.forEach(function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))})},4e3),Promise.resolve()},h.prototype.close=function(){this.transceivers.forEach(function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()}),this._isClosed=!0,this._updateSignalingState("closed")},h.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},h.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout(function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}},0))},h.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach(function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++}),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var r=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",r)}},h.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach(function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)}),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var r=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",r)}},h.prototype.createOffer=function(){var r=this;if(r._isClosed)return Promise.reject(u("InvalidStateError","Can not call createOffer after close"));var n=r.transceivers.filter(function(e){return"audio"===e.kind}).length,o=r.transceivers.filter(function(e){return"video"===e.kind}).length,a=arguments[0];if(a){if(a.mandatory||a.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==a.offerToReceiveAudio&&(n=!0===a.offerToReceiveAudio?1:!1===a.offerToReceiveAudio?0:a.offerToReceiveAudio),void 0!==a.offerToReceiveVideo&&(o=!0===a.offerToReceiveVideo?1:!1===a.offerToReceiveVideo?0:a.offerToReceiveVideo)}for(r.transceivers.forEach(function(e){"audio"===e.kind?--n<0&&(e.wantReceive=!1):"video"===e.kind&&--o<0&&(e.wantReceive=!1)});n>0||o>0;)n>0&&(r._createTransceiver("audio"),n--),o>0&&(r._createTransceiver("video"),o--);var s=l.writeSessionBoilerplate(r._sdpSessionId,r._sdpSessionVersion++);r.transceivers.forEach(function(n,i){var o=n.track,a=n.kind,s=n.mid||l.generateIdentifier();n.mid=s,n.iceGatherer||(n.iceGatherer=r._createIceGatherer(i,r.usingBundle));var c=e.RTCRtpSender.getCapabilities(a);t<15019&&(c.codecs=c.codecs.filter(function(e){return"rtx"!==e.name})),c.codecs.forEach(function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),n.remoteCapabilities&&n.remoteCapabilities.codecs&&n.remoteCapabilities.codecs.forEach(function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)})}),c.headerExtensions.forEach(function(e){(n.remoteCapabilities&&n.remoteCapabilities.headerExtensions||[]).forEach(function(t){e.uri===t.uri&&(e.id=t.id)})});var u=n.sendEncodingParameters||[{ssrc:1001*(2*i+1)}];o&&t>=15019&&"video"===a&&!u[0].rtx&&(u[0].rtx={ssrc:u[0].ssrc+1}),n.wantReceive&&(n.rtpReceiver=new e.RTCRtpReceiver(n.dtlsTransport,a)),n.localCapabilities=c,n.sendEncodingParameters=u}),"max-compat"!==r._config.bundlePolicy&&(s+="a=group:BUNDLE "+r.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"),s+="a=ice-options:trickle\r\n",r.transceivers.forEach(function(e,t){s+=i(e,e.localCapabilities,"offer",e.stream,r._dtlsRole),s+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===r.iceGatheringState||0!==t&&r.usingBundle||(e.iceGatherer.getLocalCandidates().forEach(function(e){e.component=1,s+="a="+l.writeCandidate(e)+"\r\n"}),"completed"===e.iceGatherer.state&&(s+="a=end-of-candidates\r\n"))});var c=new e.RTCSessionDescription({type:"offer",sdp:s});return Promise.resolve(c)},h.prototype.createAnswer=function(){var r=this;if(r._isClosed)return Promise.reject(u("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==r.signalingState&&"have-local-pranswer"!==r.signalingState)return Promise.reject(u("InvalidStateError","Can not call createAnswer in signalingState "+r.signalingState));var n=l.writeSessionBoilerplate(r._sdpSessionId,r._sdpSessionVersion++);r.usingBundle&&(n+="a=group:BUNDLE "+r.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"),n+="a=ice-options:trickle\r\n";var o=l.getMediaSections(r._remoteDescription.sdp).length;r.transceivers.forEach(function(e,s){if(!(s+1>o)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?n+="m=application 0 DTLS/SCTP 5000\r\n":n+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?n+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(n+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(n+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");if(e.stream){var c;"audio"===e.kind?c=e.stream.getAudioTracks()[0]:"video"===e.kind&&(c=e.stream.getVideoTracks()[0]),c&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1})}var u=a(e.localCapabilities,e.remoteCapabilities);!u.codecs.filter(function(e){return"rtx"===e.name.toLowerCase()}).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,n+=i(e,u,"answer",e.stream,r._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(n+="a=rtcp-rsize\r\n")}});var s=new e.RTCSessionDescription({type:"answer",sdp:n});return Promise.resolve(s)},h.prototype.addIceCandidate=function(e){var t,r=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise(function(n,i){if(!r._remoteDescription)return i(u("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var o=e.sdpMLineIndex;if(e.sdpMid)for(var a=0;a0?l.parseCandidate(e.candidate):{};if("tcp"===d.protocol&&(0===d.port||9===d.port))return n();if(d.component&&1!==d.component)return n();if((0===o||o>0&&s.iceTransport!==r.transceivers[0].iceTransport)&&!c(s.iceTransport,d))return i(u("OperationError","Can not add ICE candidate"));var f=e.candidate.trim();0===f.indexOf("a=")&&(f=f.substr(2)),t=l.getMediaSections(r._remoteDescription.sdp),t[o]+="a="+(d.type?f:"end-of-candidates")+"\r\n",r._remoteDescription.sdp=l.getDescription(r._remoteDescription.sdp)+t.join("")}else for(var h=0;h55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){var f=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])},h=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(e){return"object"===(void 0===e?"undefined":n(e))&&"object"===n(e.audio)&&(e=JSON.parse(JSON.stringify(e)),f(e.audio,"autoGainControl","mozAutoGainControl"),f(e.audio,"noiseSuppression","mozNoiseSuppression")),h(e)},a&&a.prototype.getSettings){var p=a.prototype.getSettings;a.prototype.getSettings=function(){var e=p.apply(this,arguments);return f(e,"mozAutoGainControl","autoGainControl"),f(e,"mozNoiseSuppression","noiseSuppression"),e}}if(a&&a.prototype.applyConstraints){var _=a.prototype.applyConstraints;a.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"===(void 0===e?"undefined":n(e))&&(e=JSON.parse(JSON.stringify(e)),f(e,"autoGainControl","mozAutoGainControl"),f(e,"noiseSuppression","mozNoiseSuppression")),_.apply(this,[e])}}}r.getUserMedia=function(e,n,o){if(t.version<44)return c(e,n,o);i.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(e).then(n,o)}}},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(15);e.exports={shimLocalStreamsAPI:function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),"getStreamById"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getStreamById=function(e){var t=null;return this._localStreams&&this._localStreams.forEach(function(r){r.id===e&&(t=r)}),this._remoteStreams&&this._remoteStreams.forEach(function(r){r.id===e&&(t=r)}),t}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),-1===this._localStreams.indexOf(e)&&this._localStreams.push(e);var r=this;e.getTracks().forEach(function(n){t.call(r,n,e)})},e.RTCPeerConnection.prototype.addTrack=function(e,r){return r&&(this._localStreams?-1===this._localStreams.indexOf(r)&&this._localStreams.push(r):this._localStreams=[r]),t.call(this,e,r)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);var t=this._localStreams.indexOf(e);if(-1!==t){this._localStreams.splice(t,1);var r=this,n=e.getTracks();this.getSenders().forEach(function(e){-1!==n.indexOf(e.track)&&r.removeTrack(e)})}})}},shimRemoteStreamsAPI:function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){this._onaddstream&&this.removeEventListener("addstream",this._onaddstream),this.addEventListener("addstream",this._onaddstream=e)}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach(function(t){if(e._remoteStreams||(e._remoteStreams=[]),!(e._remoteStreams.indexOf(t)>=0)){e._remoteStreams.push(t);var r=new Event("addstream");r.stream=t,e.dispatchEvent(r)}})}),t.apply(e,arguments)}}},shimCallbacksAPI:function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype,r=t.createOffer,i=t.createAnswer,o=t.setLocalDescription,a=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){var n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){var r=arguments.length>=2?arguments[2]:arguments[0],n=i.apply(this,[r]);return t?(n.then(e,t),Promise.resolve()):n};var c=function(e,t,r){var n=o.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n};t.setLocalDescription=c,c=function(e,t,r){var n=a.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.setRemoteDescription=c,c=function(e,t,r){var n=s.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.addIceCandidate=c}},shimGetUserMedia:function(e){var t=e&&e.navigator;t.getUserMedia||(t.webkitGetUserMedia?t.getUserMedia=t.webkitGetUserMedia.bind(t):t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,r,n){t.mediaDevices.getUserMedia(e).then(r,n)}.bind(t)))},shimRTCIceServerUrls:function(e){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,r){if(e&&e.iceServers){for(var n=[],o=0;o0?n=parseInt(o[0].substr(19),10):"firefox"===t.browser&&-1!==r&&(n=2147483637),n},c=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;if(e._sctp=null,r(arguments[0])){var t,i=n(arguments[0]),o=a(i),u=s(arguments[0],i);t=0===o&&0===u?Number.POSITIVE_INFINITY:0===o||0===u?Math.max(o,u):Math.min(o,u);var l={};Object.defineProperty(l,"maxMessageSize",{get:function(){return t}}),e._sctp=l}return c.apply(e,arguments)}}},shimSendThrowTypeError:function(e){function t(e,t){var r=e.send;e.send=function(){var n=arguments[0],i=n.length||n.size||n.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return r.apply(e,arguments)}}if(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype){var r=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=this,n=r.apply(e,arguments);return t(n,e),n},o.wrapPeerConnectionEvent(e,"datachannel",function(e){return t(e.channel,e.target),e})}}}}]);