text: module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=73)}([function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(37)("wks"),i=n(27),o=n(0).Symbol,s="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=s&&o[e]||(s?o:i)("Symbol."+e))}).store=r},function(e,t){var n=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(75),o=(r=i)&&r.__esModule?r:{default:r};t.default=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,o.default)(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}()},function(e,t,n){var r=n(8);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(0),i=n(2),o=n(18),s=n(11),a=n(12),u=function(e,t,n){var c,l,d,f=e&u.F,p=e&u.G,h=e&u.S,m=e&u.P,v=e&u.B,y=e&u.W,g=p?i:i[t]||(i[t]={}),_=g.prototype,b=p?r:h?r[t]:(r[t]||{}).prototype;for(c in p&&(n=t),n)(l=!f&&b&&void 0!==b[c])&&a(g,c)||(d=l?b[c]:n[c],g[c]=p&&"function"!=typeof b[c]?n[c]:v&&l?o(d,r):y&&b[c]==d?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(d):m&&"function"==typeof d?o(Function.call,d):d,m&&((g.virtual||(g.virtual={}))[c]=d,e&u.R&&_&&!_[c]&&s(_,c,d)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(5),i=n(48),o=n(31),s=Object.defineProperty;t.f=n(9)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){e.exports=!n(25)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.url2origin=t.uniqueID=t.off=t.removeEventListener=t.on=t.addEventListener=t.format=t.regWhiteSpace=t.regBlank=t.emptyFunc=t.f=t.emptyObj=t.o=void 0;var r,i=n(15),o=(r=i)&&r.__esModule?r:{default:r};t.getGlobal=s,t.detectCSSFeature=function(e){var t=!1,n="Webkit Moz ms O".split(" ");if("undefined"==typeof document)return void console.log("error:fn:detectCSSFeature document is undefined");var r=document.createElement("div"),i=null;e=e.toLowerCase(),void 0!==r.style[e]&&(t=!0);if(!1===t){i=e.charAt(0).toUpperCase()+e.substr(1);for(var o=0;o<n.length;o++)if(void 0!==r.style[n[o]+i]){t=!0;break}}return t},t.fix=a,t.getYearStr=u,t.getMonthStr=c,t.getDayStr=l,t.getHourStr=d,t.getMinuteStr=f,t.getSecondStr=p,t.getMillisecondStr=h,t.dateFromDateTimeLocal=function(e){return e=""+e,new Date(e.replace(/-/g,"/").replace("T"," "))},t.getClass=y,t.typeOf=g,t.isString=_,t.isNumber=function(e){return"number"===g(e)},t.isBoolean=function(e){return"boolean"===g(e)},t.isArray=b,t.isFunction=k,t.isDate=C,t.isRegExp=function(e){return"regexp"===g(e)},t.isError=function(e){return"error"===g(e)},t.isnull=O,t.notnull=S,t.undef=E,t.notundef=w,t.exist=T,t.notexist=N,t.isObject=L,t.isEmpty=function(e){return N(e)||(_(e)||b(e))&&0===e.length},t.containsNode=function(e,t){if(e===t)return!0;for(;t.parentNode;){if(t.parentNode===e)return!0;t=t.parentNode}return!1},t.calcHeight=function(e){var t=e.parentNode||("undefined"==typeof document?null:document.body);if(!t)return 0;(e=e.cloneNode(!0)).style.display="block",e.style.opacity=0,e.style.height="auto",t.appendChild(e);var n=e.offsetHeight;return t.removeChild(e),n},t.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)},t.dataset=function(e,t,n){if(!T(n))return e.getAttribute("data-"+t);e.setAttribute("data-"+t,n)},t.target=function(e){return e.target||e.srcElement},t.createIframe=function(e){if("undefined"==typeof document)return;var t;if((e=e||{}).name)try{(t=document.createElement('<iframe name="'+e.name+'"></iframe>')).frameBorder=0}catch(n){(t=document.createElement("iframe")).name=e.name}else t=document.createElement("iframe");e.visible||(t.style.display="none");k(e.onload)&&R(t,"load",(function n(r){t.src&&(e.multi||j(t,"load",n),e.onload(r))}));(e.parent||document.body).appendChild(t);var n=e.src||"about:blank";return setTimeout((function(){t.src=n}),0),t},t.html2node=function(e){if("undefined"==typeof document)return;var t=document.createElement("div");t.innerHTML=e;var n=[],r=void 0,i=void 0;if(t.children)for(r=0,i=t.children.length;r<i;r++)n.push(t.children[r]);else for(r=0,i=t.childNodes.length;r<i;r++){var o=t.childNodes[r];1===o.nodeType&&n.push(o)}return n.length>1?t:n[0]},t.scrollTop=function(e){"undefined"!=typeof document&&T(e)&&(document.documentElement.scrollTop=document.body.scrollTop=e);return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},t.forOwn=A,t.mixin=M,t.isJSON=D,t.parseJSON=function e(t){try{D(t)&&(t=JSON.parse(t)),L(t)&&A(t,(function(n,r){switch(g(r)){case"string":case"object":t[n]=e(r)}}))}catch(e){console.log("error:",e)}return t},t.simpleClone=function(e){var t=[],n=JSON.stringify(e,(function(e,n){if("object"===(void 0===n?"undefined":(0,o.default)(n))&&null!==n){if(-1!==t.indexOf(n))return;t.push(n)}return n}));return JSON.parse(n)},t.merge=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){M(e,t)})),e},t.fillUndef=function(e,t){return A(t,(function(t,n){E(e[t])&&(e[t]=n)})),e},t.checkWithDefault=function(e,t,n){var r=e[t]||e[t.toLowerCase()];N(r)&&(r=n,e[t]=r);return r},t.fetch=function(e,t){return A(e,(function(n,r){T(t[n])&&(e[n]=t[n])})),e},t.string2object=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",",n={};return e.split(t).forEach((function(e){var t=e.split("="),r=t.shift();r&&(n[decodeURIComponent(r)]=decodeURIComponent(t.join("=")))})),n},t.object2string=U,t.genUrlSep=function(e){return e.indexOf("?")<0?"?":"&"},t.object2query=function(e){return U(e,"&",!0)},t.isFileInput=F,t.getKeys=function(e,t){var n=Object.keys(e);t&&n.sort((function(t,n){var r=F(e[t]);return r===F(e[n])?0:r?1:-1}));return n};t.o={},t.emptyObj={},t.f=function(){},t.emptyFunc=function(){},t.regBlank=/\s+/gi,t.regWhiteSpace=/\s+/gi;function s(){return"undefined"!=typeof window?window:void 0!==e?e:{}}function a(e,t){t=t||2;for(var n=""+e;n.length<t;)n="0"+n;return n}function u(e){return""+e.getFullYear()}function c(e){return a(e.getMonth()+1)}function l(e){return a(e.getDate())}function d(e){return a(e.getHours())}function f(e){return a(e.getMinutes())}function p(e){return a(e.getSeconds())}function h(e){return a(e.getMilliseconds(),3)}var m,v;t.format=(m=/yyyy|MM|dd|hh|mm|ss|SSS/g,v={yyyy:u,MM:c,dd:l,hh:d,mm:f,ss:p,SSS:h},function(e,t){return e=new Date(e),isNaN(+e)?"invalid date":(t=t||"yyyy-MM-dd").replace(m,(function(t){return v[t](e)}))});function y(e){return Object.prototype.toString.call(e).slice(8,-1)}function g(e){return y(e).toLowerCase()}function _(e){return"string"===g(e)}function b(e){return"array"===g(e)}function k(e){return"function"===g(e)}function C(e){return"date"===g(e)}function O(e){return null===e}function S(e){return null!==e}function E(e){return void 0===e}function w(e){return void 0!==e}function T(e){return w(e)&&S(e)}function N(e){return E(e)||O(e)}function L(e){return T(e)&&"object"===g(e)}var P=t.addEventListener=function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,n)},R=t.on=P,x=t.removeEventListener=function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent&&e.detachEvent("on"+t,n)},j=t.off=x;function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments[2];for(var r in e)e.hasOwnProperty(r)&&t.call(n,r,e[r])}function M(e,t){A(t,(function(t,n){e[t]=n}))}var I;t.uniqueID=(I=0,function(){return""+I++});function D(e){return _(e)&&0===e.indexOf("{")&&e.lastIndexOf("}")===e.length-1}function U(e,t,n){if(!e)return"";var r=[];return A(e,(function(e,t){k(t)||(C(t)?t=t.getTime():b(t)?t=t.join(","):L(t)&&(t=JSON.stringify(t)),n&&(t=encodeURIComponent(t)),r.push(encodeURIComponent(e)+"="+t))})),r.join(t||",")}t.url2origin=function(){var e=/^([\w]+?:\/\/.*?(?=\/|$))/i;return function(t){return e.test(t||"")?RegExp.$1.toLowerCase():""}}();function F(e){var t=s();return e.tagName&&"INPUT"===e.tagName.toUpperCase()||t.Blob&&e instanceof t.Blob}}).call(this,n(138))},function(e,t,n){var r=n(7),i=n(26);e.exports=n(9)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(125);Object.defineProperty(t,"CONSTANT_ERROR",{enumerable:!0,get:function(){return o(r).default}});var i=n(126);function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"CONSTANT_SOCKET",{enumerable:!0,get:function(){return o(i).default}});t.NETCALL_MODE={NETCALL_MODE_AUDIO_VIDEO:0,NETCALL_MODE_ONLY_AUDIO:1,NETCALL_MODE_ONLY_VIDEO:2,NETCALL_MODE_NOAUDIO_NOVIDEO:3},t.KEEP_CALLING_INTERVAL=3e3,t.CALL_TYPE={NETCALL_TYPE_AUDIO:1,NETCALL_TYPE_VIDEO:2},t.CONTROL_TYPE={NETCALL_CONTROL_COMMAND_NOTIFY_AUDIO_ON:1,NETCALL_CONTROL_COMMAND_NOTIFY_AUDIO_OFF:2,NETCALL_CONTROL_COMMAND_NOTIFY_VIDEO_ON:3,NETCALL_CONTROL_COMMAND_NOTIFY_VIDEO_OFF:4,NETCALL_CONTROL_COMMAND_SWITCH_AUDIO_TO_VIDEO:5,NETCALL_CONTROL_COMMAND_SWITCH_AUDIO_TO_VIDEO_AGREE:6,NETCALL_CONTROL_COMMAND_SWITCH_AUDIO_TO_VIDEO_REJECT:7,NETCALL_CONTROL_COMMAND_SWITCH_VIDEO_TO_AUDIO:8,NETCALL_CONTROL_COMMAND_BUSY:9,NETCALL_CONTROL_COMMAND_SELF_CAMERA_INVALID:10,NETCALL_CONTROL_COMMAND_SELF_ON_BACKGROUND:11,NETCALL_CONTROL_COMMAND_START_NOTIFY_RECEIVED:12},t.SESSION_MODE={P2P:0,MEETING:1},t.ROLE_FOR_MEETING={ROLE_HOST:0,ROLE_AUDIENCE:1},t.HANGUP_TYPE={HANGUP_TYPE_NORMAL:0,HANGUP_TYPE_TIMEOUT:-1},t.RECORD_TYPE={RECORD_TYPE_MIX_SINGLE:"0",RECORD_TYPE_ONLY_MIX:"1",RECORD_TYPE_ONLY_SINGLE:"2"},t.RECORD_AUDIO={RECORD_AUDIO_OPEN:1,RECORD_AUDIO_CLOSE:0},t.RECORD_VIDEO={RECORD_VIDEO_OPEN:1,RECORD_VIDEO_CLOSE:0},t.RTMP_RECORD={RTMP_RECORD_OPEN:1,RTMP_RECORD_CLOSE:0},t.LIVE_ENABLE={LIVE_ENABLE_OPEN:1,LIVE_ENABLE_CLOSE:0}},function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(15),o=(r=i)&&r.__esModule?r:{default:r};t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,o.default)(t))&&"function"!=typeof t?e:t}},function(e,t,n){"use strict";t.__esModule=!0;var r=s(n(78)),i=s(n(90)),o="function"==typeof i.default&&"symbol"==typeof r.default?function(e){return typeof e}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":typeof e};function s(e){return e&&e.__esModule?e:{default:e}}t.default="function"==typeof i.default&&"symbol"===o(r.default)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":void 0===e?"undefined":o(e)}},function(e,t,n){var r=n(83),i=n(33);e.exports=function(e){return r(i(e))}},function(e,t,n){"use strict";t.__esModule=!0;var r=s(n(99)),i=s(n(103)),o=s(n(15));function s(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,o.default)(t)));e.prototype=(0,i.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(r.default?(0,r.default)(e,t):e.__proto__=t)}},function(e,t,n){var r=n(24);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=!0},function(e,t){e.exports={}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(3)),i=o(n(4));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(){(0,r.default)(this,e),this.eventReset()}return(0,i.default)(e,[{key:"eventReset",value:function(){var e=this;this._eventListeners&&Object.keys(this._eventListeners).forEach((function(t){delete e._eventListeners[t]})),this._eventListeners={},this._eventOnceListener&&Object.keys(this._eventOnceListener).forEach((function(t){delete e._eventOnceListener[t]})),this._eventOnceListener={}}},{key:"on",value:function(e,t){if(!e)throw Error({message:"event listener funkey undefined",callFunc:"adapter:_on"});if(!(t instanceof Function))throw Error({message:"event listener next param should be function",callFunc:"adapter:_on"});this._eventListeners[e]=t}},{key:"off",value:function(e){if(!e)throw Error({message:"event listener funkey undefined",callFunc:"adapter:_off"});if(!this._eventListeners[e])throw Error({message:"event listener unbind failed!",callFunc:"adapter:_off"});delete this._eventListeners[e]}},{key:"once",value:function(e,t){if(!e)throw Error({message:"event once listener funkey undefined",callFunc:"adapter:_once"});if(!(t instanceof Function))throw Error({message:"event once listener next param should be function",callFunc:"adapter:_once"});this._eventOnceListener[e]=t}},{key:"emit",value:function(e,t){var n=this;this._eventOnceListener&&this._eventOnceListener[e]instanceof Function&&setTimeout((function(){n._eventOnceListener[e](t),delete n._eventOnceListener[e]}),0),this._eventListeners&&this._eventListeners[e]instanceof Function&&setTimeout((function(){n._eventListeners[e]&&n._eventListeners[e](t)}),0)}}]),e}();t.default=s,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(15),o=(r=i)&&r.__esModule?r:{default:r};var s,a={post:function(e,t){return this.verifyOptions(t,"url"),new Promise((function(n,r){wx.request({url:t.url,method:"post",data:e,header:{"content-type":"application/x-www-form-urlencoded"},success:function(e){var t=e.data;n(t)},fail:function(e){r(e)}})}))},merge:function(){var e=arguments;return e[0]=Object.assign.apply(Object.assign,arguments),e[0]},verifyOptions:function(){var e=arguments;if(e[0]&&e[0].constructor===Object)for(var t=1;t<arguments.length;t++){var n=e[t];(n=n.split(" ")).map((function(t){if(!e[0][t]&&0!=e[0][t])throw Error("参数缺失 "+t)}))}},deepClone:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var n in e)"object"===(0,o.default)(e[n])?(t[n]=e[n].constructor===Array?[]:{},this.deepClone(e[n],t[n])):t[n]=e[n];return t},guid:(s=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)},function(){return s()+s()+s()+s()+s()+s()+s()+s()}),uuid:function(){var e=function(){return(1e5*(1+Math.random())|0).toString(10).substring(1)};return function(){return e()+e()+e()}}(),isString:function(e){return e.constructor===String},isNumber:function(e){return e.constructor===Number},isBoolean:function(e){return e.constructor===Boolean},isObject:function(e){return e.constructor===Object},isArray:function(e){return e.constructor===Array},isFunction:function(e){return e.constructor===Function},isDate:function(e){return e.constructor===Date},isRegExp:function(e){return e.constructor===RegExp},isNull:function(e){return null===e},isUndefined:function(e){return void 0===e},exist:function(e){return!isNull(e)&&!isUndefined(e)}};t.default=a,e.exports=t.default},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(7).f,i=n(12),o=n(1)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){"use strict";var r=n(10),i=n(140),o=n(142),s=n(143),a={},u=r.f;function c(e){var t=e.upload="multipart/form-data"===(e.headers||r.o)["Content-Type"],n=!1;try{n=(location.protocol+"//"+location.host).toLowerCase()!==r.url2origin(e.url)}catch(e){}return e.cors=n,t||n||e.mode?function(e){var t=e.mode,n=i,a=r.getGlobal();return!a.FormData&&a.document&&(t="iframe"),"iframe"===t&&(n=e.upload?o:s),new n(e)}(e):new i(e)}function l(e,t,n){var r=a[e];if(r){"onload"===t&&r.result&&(n=function(e,t){t={data:t};var n=e.result.headers;return n&&(t.headers=e.req.header(n)),t}(r,n)),function(e){var t=a[e];t&&(t.req.destroy(),delete a[e])}(e);var i={type:t,result:n};u(i),i.stopped||r[t](i.result)}}function d(e,t){l(e,"onload",t)}function f(e,t){l(e,"onerror",t)}function p(e,t){var n=r.genUrlSep(e);return t=t||"",r.isObject(t)&&(t=r.object2query(t)),t&&(e+=n+t),e}function h(e,t){t=t||{};var n=r.uniqueID(),i={result:t.result,onload:t.onload||r.f,onerror:t.onerror||r.f};a[n]=i,t.onload=d.bind(null,n),t.onerror=f.bind(null,n),t.query&&(e=p(e,t.query));var o=t.method||"";return o&&!/get/i.test(o)||!t.data||(e=p(e,t.data),t.data=null),t.url=e,i.req=c(t),n}h.filter=function(e){r.isFunction(e)&&(u=e)},h.abort=function(e){var t=a[e];t&&t.req&&t.req.abort()},e.exports=h},function(e,t,n){var r=n(8),i=n(0).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){var r=n(8);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on  "+e);return e}},function(e,t,n){var r=n(5),i=n(82),o=n(38),s=n(36)("IE_PROTO"),a=function(){},u=function(){var e,t=n(30)("iframe"),r=o.length;for(t.style.display="none",n(54).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(a.prototype=r(e),n=new a,a.prototype=null,n[s]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(52),i=n(38);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(37)("keys"),i=n(27);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(2),i=n(0),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(19)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){t.f=n(1)},function(e,t,n){var r=n(0),i=n(2),o=n(19),s=n(39),a=n(7).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:s.f(e)})}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){e.exports=n(107)},function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(109),o=(r=i)&&r.__esModule?r:{default:r};t.default=function(e){return function(){var t=e.apply(this,arguments);return new o.default((function(e,n){return function r(i,s){try{var a=t[i](s),u=a.value}catch(e){return void n(e)}if(!a.done)return o.default.resolve(u).then((function(e){r("next",e)}),(function(e){r("throw",e)}));e(u)}("next")}))}}},function(e,t,n){"use strict";var r=n(24);function i(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new i(e)}},function(e){e.exports=JSON.parse('{"name":"nim","private":false,"version":"7.3.0","privateVersion":"7.0.0.0","nrtcVersion":"4.11.0","sdkVersion":78,"nrtcSdkVersion":1,"protocolVersion":1,"pcAgentVersion":"2.8.0.906","webrtcG2Version":"4.1.0","webrtcG2Branch":"stab-v3.9.0","description":"NIM Web SDK 网易云信|真正稳定的即时通讯云服务","main":"index.js","directories":{"test":"test"},"scripts":{"clean":"node build/emptyDist.js","build:tag":"node build/parseTagMap.js","build:sdk":"cross-env PLATFORM=all webpack --config webpack.config.js","build:sdk:g2":"cross-env PLATFORM=g2 webpack --config webpack.config.js","build:sdk:stats":"webpack --profile --json > dist/webpack-stats.json","build:tester":"node build/tester.js","build:tester:g2":"cross-env PLATFORM=g2 node build/tester.js","build:api":"node build/api","build:guide":"node build/guide","watch:tag":"watch \'npm run build:tag\' ./src/protocol/map -du --interval=0.25 --filter=./build/parseTagMapFilter.js","watch:sdk":"npm run build:sdk -- -w","zip:api":"cross-env NODE_ENV=production npm run build:api && node build/api/zip.js","zip:sdk":"cross-env NODE_ENV=production node build/sdk/zip.js","zip:sdk:g2":"cross-env PLATFORM=g2 NODE_ENV=production node build/sdk/zip.js","copy:sdk":"npm run zip:sdk && node build/sdk/copy.js","copy:api":"npm run build:api && node build/api/copy.js","dev":"npm run clean && run-p watch:*","dev:prod":"cross-env PLATFORM=all NODE_ENV=production npm run dev","dev:nosm":"NO_SOURCE_MAP=true run-p watch:*","dev:rn":"cross-env PLATFORM=rn NO_SOURCE_MAP=true npm run dev","dev:weixin":"cross-env PLATFORM=weixin NO_SOURCE_MAP=true npm run dev","dev:g2":"cross-env PLATFORM=g2 NO_SOURCE_MAP=true webpack --config webpack.config.js --w","pack":"npm run clean && npm run build:sdk && npm run build:api && npm run build:guide","pack:g2":"npm run clean && npm run build:sdk && npm run build:tester:g2 && npm run deploy:g2 && npm run build:api","pack:test":"cross-env PLATFORM=all NODE_ENV=test npm run pack","pack:test:g2":"cross-env PLATFORM=all NODE_ENV=test npm run pack:g2","pack:pre":"cross-env PLATFORM=all NODE_ENV=pre npm run pack","pack:prod":"cross-env PLATFORM=all NODE_ENV=production npm run pack && npm run zip:sdk","pack:prod:g2":"cross-env PLATFORM=all NODE_ENV=production npm run pack:g2 && npm run zip:sdk:g2","pack:weixin":"cross-env PLATFORM=weixin NODE_ENV=production npm run build:sdk -- -w","pack:nodejs":"cross-env PLATFORM=nodejs NODE_ENV=production npm run build:sdk -- -w","pack:rn":"cross-env PLATFORM=rn NODE_ENV=production npm run build:sdk -- -w","pack:custom":"cross-env PLATFORM=all NODE_ENV=custom npm run pack","deploy":"node build/deploy.js","deploy:g2":"cross-env PLATFORM=g2 node build/deploy.js","tester":"cross-env PLATFORM=all NODE_ENV=test node build/tester.js"},"author":"netease im","license":"ISC","dependencies":{"axios":"^0.18.0","babel-polyfill":"^6.26.0","backo2":"^1.0.2","bignumber.js":"^9.0.1","crypto-js":"^4.0.0","deep-access":"^0.1.1","es6-promise":"^4.2.4","eventemitter3":"^2.0.2","gulp":"^3.9.1","gulp-jsdoc3":"^2.0.0","happypack":"^5.0.1","javascript-natural-sort":"^0.7.1","jsdoc":"^3.5.5","json-bigint":"^1.0.0","md5":"^2.2.1","sdp-transform":"^2.3.0","webrtc-adapter":"6.0.3","ws":"^5.1.1","x2js":"^3.2.1","xhr":"^2.4.1"},"devDependencies":{"@types/debug":"^4.1.5","@types/events":"^3.0.0","archiver":"^2.1.1","awaitqueue":"^2.2.3","babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-plugin-add-module-exports":"^0.2.1","babel-plugin-transform-async-to-generator":"^6.24.1","babel-plugin-transform-es3-member-expression-literals":"^6.22.0","babel-plugin-transform-es3-property-literals":"^6.22.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-stage-2":"^6.24.1","bowser":"^2.9.0","cross-env":"^5.1.4","crypto-js":"^4.0.0","debug":"^4.1.1","eslint":"^4.19.1","eslint-config-standard":"^11.0.0","eslint-plugin-import":"^2.11.0","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.7.0","eslint-plugin-standard":"^3.1.0","events":"^3.1.0","fs-extra":"^5.0.0","h264-profile-level-id":"^1.0.1","imports-loader":"^0.8.0","ink-docstrap":"^1.3.2","javascript-state-machine":"^3.1.0","npm-run-all":"^4.1.2","on-build-webpack":"^0.1.0","pre-build-webpack":"^0.1.0","prettyjson":"^1.1.3","protoo-client":"^4.0.4","raw-loader":"^0.5.1","sdp-transform":"^2.14.0","supports-color":"^7.1.0","watch-cli":"^0.2.3","webpack":"^4.5.0","webpack-cli":"^3.3.12","webpack-merge":"^4.1.2","wolfy87-eventemitter":"^5.2.4","yaml":"^0.3.0","yargs":"^11.0.0"}}')},function(e,t,n){"use strict";var r={info:{hash:!1,shortHash:!1,version:"7.3.0",sdkVersion:"78",nrtcVersion:"4.11.0",webrtcG2Version:"4.1.0",nrtcSdkVersion:"1",protocolVersion:1},agentVersion:"2.8.0.906",lbsUrl:"https://lbs.netease.im/lbs/webconf.jsp",roomserver:"roomserver.netease.im",connectTimeout:8e3,xhrTimeout:8e3,socketTimeout:8e3,reconnectionDelay:1600,reconnectionDelayMax:8e3,reconnectionJitter:.01,reconnectiontimer:null,heartbeatInterval:6e4,cmdTimeout:8e3,defaultReportUrl:"https://dr.netease.im/1.gif",isWeixinApp:!1,isNodejs:!1,isRN:!1,ipVersion:0,PUSHTOKEN:"",PUSHCONFIG:{},CLIENTTYPE:16,PushPermissionAsked:!1,iosPushConfig:null,androidPushConfig:null,netDetectAddr:"https://roomserver-dev.netease.im/v1/sdk/detect/local",optionDefaultLinkUrl:"",defaultLinkUrl:"weblink.netease.im",ipv6DefaultLinkUrl:"weblink.netease.im",optionIpv6DefaultLinkUrl:"",wxDefaultLinkUrl:"wlnimsc0.netease.im",getDefaultLinkUrl:function(e){var t,n;1===r.ipVersion?(t=r.optionIpv6DefaultLinkUrl,n=r.ipv6DefaultLinkUrl):(t=r.optionDefaultLinkUrl,n=r.defaultLinkUrl);var i=t||(r.isWeixinApp?r.wxDefaultLinkUrl:n);if(!i)return!1;var o=e?"https":"http",s=e?"443":"80",a=i;return-1===i.indexOf("http")&&(a=o+"://"+a),-1===i.indexOf(":")&&(a=a+":"+s),a}};r.weixinNetcall=r.nrtcNetcall={checkSumUrl:"https://nrtc.netease.im/demo/getChecksum.action",getChannelInfoUrl:"https://nrtc.netease.im/nrtc/getChannelInfos.action"},r.ipProbeAddr={ipv4:"https://detect4.netease.im/test/",ipv6:"https://detect6.netease.im/test/"},r.nrtcWebRTC2={checkSumUrl:"https://nrtc.netease.im/demo/getChecksum.action",getChannelInfoUrl:"https://nrtc.netease.im/nrtc/getChannelInfos.action",createChannelUrl:"https://nrtc.netease.im/nrtc/createChannel.action",roomsTaskUrl:"https://roomserver.netease.im/v2/sdk/rooms/"},r.formatSocketUrl=function(e){var t=e.url,n=e.secure?"https":"http";return-1===t.indexOf("http")?n+"://"+t:t},r.uploadUrl="https://nos.netease.com",r.chunkUploadUrl=null,r.commonMaxSize=104857600,r.chunkSize=4194304,r.chunkMaxSize=4194304e4,r.replaceUrl="https://{bucket}-nosdn.netease.im/{object}",r.downloadHost="nos.netease.com",r.downloadUrl="https://{bucket}-nosdn.netease.im/{object}",r.httpsEnabled=!1,r.threshold=0,r.genUploadUrl=function(e){return r.uploadUrl+"/"+e},r.genChunkUploadUrl=function(e){return r.chunkUploadUrl?r.chunkUploadUrl+"/"+e.bucket+"/"+e.objectName:""},r.genDownloadUrl=function(e,t){var n=e.bucket,i=(e.tag,e.expireSec),o=+new Date,s=i?"&survivalTime="+i:"",a=r.replaceUrl+"?createTime="+o+s;return(a=r.genNosProtocolUrl(a)).replace("{bucket}",n).replace("{object}",t)},r.genFileUrl=function(e){var t=e.bucket,n=e.objectName;return r.genNosProtocolUrl(r.replaceUrl).replace("{bucket}",t).replace("{object}",n)},r.genNosProtocolUrl=function(e){return/^http/.test(e)?r.httpsEnabled&&0!==e.indexOf("https://")&&(e=e.replace("http","https")):e=r.httpsEnabled?"https://"+e:"http://"+e,e},e.exports=r},function(e,t,n){"use strict";var r=n(10),i=r.f,o=n(141);function s(e){e.onload&&this.once("load",e.onload),e.onerror&&this.once("error",e.onerror),e.onbeforesend&&this.once("beforesend",e.onbeforesend),e.onaftersend&&this.once("aftersend",e.onaftersend);var t=(e=this.options=r.fetch({method:"GET",url:"",sync:!1,data:null,headers:{},cookie:!1,timeout:6e4,type:"text",form:null,input:null,putFileAtEnd:!1,proxyUrl:""},e)).headers;r.notexist(t["Content-Type"])&&(t["Content-Type"]="application/x-www-form-urlencoded"),this.send()}var a=s.prototype=Object.create(o.prototype);a.send=function(){var e=this,t=e.options;setTimeout((function(){try{try{e.emit("beforesend",t)}catch(e){console.log("error:","ignore error ajax beforesend,",e)}e.doSend()}catch(t){console.log("error:","ignore error server error,",t),e.onError("serverError","请求失败:"+t.message)}}),0)},a.doSend=i,a.afterSend=function(){var e=this;setTimeout((function(){e.emit("aftersend",e.options)}),0)},a.onLoad=function(e){var t=this.options,n=e.status,r=e.result;if(0===(""+n).indexOf("2")){if("json"===t.type)try{r=JSON.parse(r)}catch(e){return console.log("error:","ignore error parse json,",e),void this.onError("parseError",r)}this.emit("load",r)}else this.onError("serverError","服务器返回异常状态",{status:n,result:r})},a.onError=function(e,t,n){var i=r.isObject(n)?n:{};i.code=e||"error",i.message=t||"发生错误",this.emit("error",i)},a.onTimeout=function(){this.onError("timeout","请求超时")},a.abort=function(){this.onError("abort","客户端中止")},a.header=function(e){var t=this;if(!r.isArray(e))return t.getResponseHeader(e||"");var n={};return e.forEach((function(e){n[e]=t.header(e)})),n},a.getResponseHeader=i,a.destroy=i,e.exports=s},function(e,t,n){e.exports=!n(9)&&!n(25)((function(){return 7!=Object.defineProperty(n(30)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){"use strict";var r=n(80)(!0);n(50)(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})}))},function(e,t,n){"use strict";var r=n(19),i=n(6),o=n(51),s=n(11),a=n(20),u=n(81),c=n(28),l=n(86),d=n(1)("iterator"),f=!([].keys&&"next"in[].keys()),p=function(){return this};e.exports=function(e,t,n,h,m,v,y){u(n,t,h);var g,_,b,k=function(e){if(!f&&e in E)return E[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},C=t+" Iterator",O="values"==m,S=!1,E=e.prototype,w=E[d]||E["@@iterator"]||m&&E[m],T=w||k(m),N=m?O?k("entries"):T:void 0,L="Array"==t&&E.entries||w;if(L&&(b=l(L.call(new e)))!==Object.prototype&&b.next&&(c(b,C,!0),r||"function"==typeof b[d]||s(b,d,p)),O&&w&&"values"!==w.name&&(S=!0,T=function(){return w.call(this)}),r&&!y||!f&&!S&&E[d]||s(E,d,T),a[t]=T,a[C]=p,m)if(g={values:O?T:k("values"),keys:v?T:k("keys"),entries:N},y)for(_ in g)_ in E||o(E,_,g[_]);else i(i.P+i.F*(f||S),t,g);return g}},function(e,t,n){e.exports=n(11)},function(e,t,n){var r=n(12),i=n(16),o=n(84)(!1),s=n(36)("IE_PROTO");e.exports=function(e,t){var n,a=i(e),u=0,c=[];for(n in a)n!=s&&r(a,n)&&c.push(n);for(;t.length>u;)r(a,n=t[u++])&&(~o(c,n)||c.push(n));return c}},function(e,t,n){var r=n(32),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(0).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(33);e.exports=function(e){return Object(r(e))}},function(e,t,n){n(87);for(var r=n(0),i=n(11),o=n(20),s=n(1)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u<a.length;u++){var c=a[u],l=r[c],d=l&&l.prototype;d&&!d[s]&&i(d,s,c),o[c]=o.Array}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(52),i=n(38).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){var r=n(41),i=n(26),o=n(16),s=n(31),a=n(12),u=n(48),c=Object.getOwnPropertyDescriptor;t.f=n(9)?c:function(e,t){if(e=o(e),t=s(t,!0),u)try{return c(e,t)}catch(e){}if(a(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t){},function(e,t,n){var r=n(21),i=n(1)("toStringTag"),o="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:o?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t,n){var r=n(5),i=n(24),o=n(1)("species");e.exports=function(e,t){var n,s=r(e).constructor;return void 0===s||null==(n=r(s)[o])?t:i(n)}},function(e,t,n){var r,i,o,s=n(18),a=n(117),u=n(54),c=n(30),l=n(0),d=l.process,f=l.setImmediate,p=l.clearImmediate,h=l.MessageChannel,m=l.Dispatch,v=0,y={},g=function(){var e=+this;if(y.hasOwnProperty(e)){var t=y[e];delete y[e],t()}},_=function(e){g.call(e.data)};f&&p||(f=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return y[++v]=function(){a("function"==typeof e?e:Function(e),t)},r(v),v},p=function(e){delete y[e]},"process"==n(21)(d)?r=function(e){d.nextTick(s(g,e,1))}:m&&m.now?r=function(e){m.now(s(g,e,1))}:h?(o=(i=new h).port2,i.port1.onmessage=_,r=s(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",_,!1)):r="onreadystatechange"in c("script")?function(e){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),g.call(e)}}:function(e){setTimeout(s(g,e,1),0)}),e.exports={set:f,clear:p}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(5),i=n(8),o=n(44);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(3)),i=l(n(4)),o=l(n(14)),s=l(n(17)),a=l(n(22)),u=n(67),c=n(13);function l(e){return e&&e.__esModule?e:{default:e}}var d=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r.default)(this,t);var n=(0,o.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n._nim=null,n._init(e),n._status={timeoutTimer:null,beCallTimer:null,uid4AccountMap:{},account4UidMap:{},imInfo:{},beCalledInfo:{}},n}return(0,s.default)(t,e),(0,i.default)(t,[{key:"_init",value:function(e){var t=e.nim,n=e.logger,r=void 0===n?u.pureLogger:n,i=e.status;this._resetStatus(),this._nim=t,this._logger=r,this._mainStatus=i,this._bindIMEvent()}},{key:"_resetStatus",value:function(){this._status&&(clearTimeout(this._status.timeoutTimer),Object.assign(this._status,{timeoutTimer:null,uid4AccountMap:{},account4UidMap:{},imInfo:{}})),this._nim&&0!==Object.keys(this._nim)&&this._nim.protocol.setCurrentNetcall()}},{key:"_bindIMEvent",value:function(){this._nim&&0!==Object.keys(this._nim)?(this._nim.on("beCalled",this._onBeCalled.bind(this)),this._nim.on("notifyCalleeAck",this._onNotifyCalleeAck.bind(this)),this._nim.on("notifyHangup",this._onNotifyHangup.bind(this)),this._nim.on("netcallControl",this._onNetcallControl.bind(this)),this._nim.on("notifyCalleeAckSync",this._onNotifyCalleeAckSync.bind(this)),this._nim.on("notifyJoin",this._onNotifyJoin.bind(this))):this._logger.log("IMController: _bindIMEvent: nim 实例不存在，绑定事件失败！")}},{key:"_unBindIMEvent",value:function(){this._nim?(this._nim.removeListener("beCalled",this._onBeCalled.bind(this)),this._nim.removeListener("notifyCalleeAck",this._onNotifyCalleeAck.bind(this)),this._nim.removeListener("notifyHangup",this._onNotifyHangup.bind(this)),this._nim.removeListener("netcallControl",this._onNetcallControl.bind(this)),this._nim.removeListener("notifyCalleeAckSync",this._onNotifyCalleeAckSync.bind(this)),this._nim.removeListener("notifyJoin",this._onNotifyJoin.bind(this))):this._logger.log("IMController: _unBindIMEvent: nim 实例不存在，解绑事件失败！")}},{key:"_addAccountUidMap",value:function(e,t){this._status.uid4AccountMap||(this._status.uid4AccountMap={}),this._status.uid4AccountMap[t]=e,this._status.account4UidMap||(this._status.account4UidMap={}),this._status.account4UidMap[e]=t}},{key:"_parseAccountUidMap",value:function(e){for(var t in e)this._addAccountUidMap(t,e[t])}},{key:"getUidByAccount",value:function(e){return this._status.account4UidMap[e]}},{key:"getAccountByUid",value:function(e){var t=this._status.uid4AccountMap[e];return this._logger.log("IMController: getAccountByUid "+e+" => "+t),t}},{key:"initNetcall",value:function(e){var t=this;return this._logger.log("IMController: initNetcall options="+e),this._nim.initNetcall(e).then((function(e){return t._logger.log("IMController: initNetcall response=%o",e),t.emit("updateStatus",{sessionMode:c.SESSION_MODE.P2P,signalInited:!0}),Object.assign(t._status.imInfo,e,{sessionMode:"p2p",account:t._nim.account}),Promise.resolve(e.accountUidMap)})).catch((function(e){return t._logger.error("IMBusiness:initNetcall error=%o",e),t.emit("updateStatus",{signalEndTime:Date.now()}),Promise.reject(e)}))}},{key:"response",value:function(e){var t=this;this._logger.log("IMController: response options=%o",e);var n=e.caller,r=e.accepted,i=e.type,o=e.cid,s=e.fn||"calleeAck";return this._nim[s]({account:n,channelId:o,type:i,accepted:r}).then((function(e){t._logger.log("IMController: response success",e);var n={};r&&Object.assign(n,{signalStartTime:Date.now(),onTheCall:!0}),Object.assign(n,{calling:!!r,isCaller:!1}),t.emit("updateStatus",n)}),(function(e){throw t._logger.error("IMController: response error=%o",e),e}))}},{key:"hangup",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=null;if(this.emit("updateStatus",{onTheCall:!1,calling:!1}),t=this._mainStatus.isCaller?this._status.imInfo.channelId:this._status.beCalledInfo.channelId,this._logger.log("IMController: hangup: ",t),t&&this._mainStatus.onTheCall){var n=e.fn||"hangup";this._nim[n]({channelId:t})}return this._resetWhenHangup(),Promise.resolve()}},{key:"control",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._logger.log("IMController: control options=%o",t),t.channelId||(this._mainStatus.isCaller?t.channelId=this._status.imInfo.channelId:t.channelId=this._status.beCalledInfo.channelId),t.command&&t.channelId){var n=t.fn||"netcallControl";return t.type=t.command,this._nim[n](t).catch((function(t){e._logger.error("IMController: control error=%o",t)}))}return Promise.reject("IMController: control: command或channelId为空！")}},{key:"createChannel",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.emit("updateStatus",{signalStartTime:Date.now()}),this._nim[e](n).then((function(e){return t._logger.log("IMController: createChannel success=%o",e),Promise.resolve(e)})).catch((function(e){return t._logger.error("IMController: createChannel error=%o",e),t.emit("updateStatus",{signalEndTime:Date.now()}),Promise.reject(e)}))}},{key:"joinChannel",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._nim[e](n).then((function(e){return t._parseAccountUidMap(e.accountUidMap),Object.assign(e,{sessionMode:c.SESSION_MODE.MEETING,account:t._nim.account,uid:t.getUidByAccount(t._nim.account),serverMap:JSON.parse(e.serverMap)}),t.emit("updateStatus",{signalEndTime:Date.now(),signalInited:!0,sessionMode:c.SESSION_MODE.MEETING}),Object.assign(t._status.imInfo,e),Promise.resolve(e)})).catch((function(e){return t.emit("updateStatus",{signalEndTime:Date.now()}),Promise.reject(e)}))}},{key:"_onNotifyJoin",value:function(e){this._logger.log("IMController: _onNotifyJoin: "+e);var t=e.accountUidMap;for(var n in this._parseAccountUidMap(t),t)this.emit("joinChannel",{uid:t[n],account:n,cid:e.channelId})}},{key:"_onBeCalled",value:function(e){var t=this;this._logger.log("IMController: _onBeCalled",e);var n=setTimeout((function(){t.logger.log("清除被叫状态"),t.emit("updateStatus",{calling:!1})}),c.KEEP_CALLING_INTERVAL-100);this.emit("updateStatus",{signalInited:!0,isCaller:!1,sessionMode:c.SESSION_MODE.P2P,calling:!0}),!1===this._mainStatus.onTheCall&&Object.assign(this._status.beCalledInfo,e),this._status.imInfo||(this._status.imInfo={}),this._status.imInfo.uid=e.uid,this._status.beCallTimer=n,this.emit("updateStatistics",{appkey:this._nim&&this._nim.options&&this._nim.options.appKey,P2P:{value:1}}),this.emit("beCalling",{caller:e.account,cid:e.channelId,type:e.type})}},{key:"_onNetcallControl",value:function(e){var t="";t=this._mainStatus.isCaller?this._status.imInfo.channelId:this._status.beCalledInfo.channelId,e.channelId===t?(this._logger.log("IMController: _onNetcallControl: ",e),this.emit("control",{cid:e.channelId,command:e.type,account:e.account})):this._logger.log("IMController: _onNetcallControl: not current channel! drop!",e)}},{key:"_onNotifyCalleeAck",value:function(e){this._logger.log("IMController: _onNotifyCalleeAck: ",e);var t=e.accepted,n=e.account,r=e.channelId,i=e.type;clearTimeout(this._status.beCallTimer),this._status.beCallTimer=null,t?this.emit("updateStatus",{onTheCall:!0}):!1===this._mainStatus.isTeamCall&&this._resetWhenHangup(),this.emit(t?"callAccepted":"callRejected",{cid:r,account:n,type:i})}},{key:"_onNotifyHangup",value:function(e){this._logger.log("IMController: _onNotifyHangup: ",e);var t=this._mainStatus.onTheCall,n=null;this.emit("updateStatus",{onTheCall:!1,calling:!1}),n=this._mainStatus.isCaller?this._status.imInfo.channelId:this._status.beCalledInfo.channelId;var r=e.channelId===n;t&&r&&(this.emit("leaveChannel"),this.emit("sessionEnd"),this._resetStatus()),this.emit("hangup",{cid:e.channelId,timetag:e.timetag,account:e.account})}},{key:"_onNotifyCalleeAckSync",value:function(e){this._logger.log("IMController: _onNetcallControl: ",e);var t=e.timetag,n=e.channelId,r=e.type,i=e.accepted,o=e.fromClientType;this.emit("callerAckSync",{timetag:t,cid:n,type:r,accepted:i,fromClientType:o}),this._resetWhenHangup()}},{key:"_resetWhenHangup",value:function(){this.emit("resetWhenHangup")}},{key:"destroy",value:function(){return this._resetStatus(),this.eventReset(),this._nim=null,Promise.resolve()}},{key:"reset",value:function(){return this._resetStatus(),Promise.resolve()}}]),t}(a.default);t.default=d,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pureLogger=void 0;var r=o(n(3)),i=o(n(4));function o(e){return e&&e.__esModule?e:{default:e}}var s="%c WeAppRTC:: ",a=function(){function e(t){var n=t.debug;(0,r.default)(this,e),this.debug=n}return(0,i.default)(e,[{key:"log",value:function(e){if(this.debug){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return console.log(s+e,"color:#bada55",n)}}},{key:"warn",value:function(e){if(this.debug){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return console.warn(s+e,n)}}},{key:"error",value:function(e){if(this.debug){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return console.error(s+e,n)}}}]),e}();t.default=a;t.pureLogger={trace:function(){},debug:function(){},log:function(){},warn:function(){},error:function(){}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=p(n(42)),i=p(n(43)),o=p(n(3)),s=p(n(4)),a=p(n(14)),u=p(n(17)),c=p(n(127)),l=p(n(22)),d=n(67),f=n(13);function p(e){return e&&e.__esModule?e:{default:e}}var h=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,o.default)(this,t);var n=(0,a.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n._init(e),n._websocket=null,n}var n,l,p,h,m,v;return(0,u.default)(t,e),(0,s.default)(t,[{key:"_init",value:function(e){var t=e.status,n=e.logger,r=void 0===n?d.pureLogger:n;this._mainStatus=t,this.logger=r,this._initStatus()}},{key:"_initStatus",value:function(){var e=this;this._status||(this._status={}),Object.keys(this._status).forEach((function(t){delete e._status[t]})),Object.assign(this._status,{needReconnect:!1,reconnectTimer:null,currentOptions:null,reconnectCount:0,reconnectMaxNum:8,destroy:!1})}},{key:"_destroy",value:function(){return this._resetReconnectStatus(!0),this.stopSignal()}},{key:"_resetReconnectStatus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];clearTimeout(this._status.reconnectTimer),Object.assign(this._status,{needReconnect:!1,reconnectCount:0,reconnectTimer:null,destroy:e})}},{key:"_resetWhenClose",value:function(){this._resetReconnectStatus(),this._unbindEvent(),this._websocket=null,this._initStatus()}},{key:"_bindEvent",value:function(){var e=this;this._websocket?(this._websocket.on("open",this._onOpen.bind(this)),this._websocket.on("error",this._onError.bind(this)),this._websocket.on("close",this._onClose.bind(this)),this._websocket.on("hangup",this._onHangup.bind(this)),this._websocket.on("syncDone",this._onSyncDone.bind(this)),this._websocket.on("clientLeave",this._onClientLeave.bind(this)),this._websocket.on("clientJoin",this._onClientJoin.bind(this)),this._websocket.on("clientUpdate",this._onClientUpdate.bind(this)),this._websocket.on("clientMute",this._onClientMute.bind(this)),this._websocket.on("liveRoomClose",this._onLiveRoomClose.bind(this)),this._websocket.on("kicked",this._onKicked.bind(this)),this._websocket.on("roomRefused",this._onRoomRefused.bind(this)),this._websocket.on("clientPublished",this._onClientPublished.bind(this)),this._websocket.on("sendCommandOverTime",this._onSendCommandOverTime.bind(this)),this._websocket.on("heartbeatOverTime",(function(t){e.logger.log("WSController::heartbeatOverTime",t),e.stopSignal()}))):this.logger.warn("WSController::_bindEvent: _websocket为空！")}},{key:"_unbindEvent",value:function(){this._websocket&&(this._websocket.off("open"),this._websocket.off("error"),this._websocket.off("close"),this._websocket.off("hangup"),this._websocket.off("syncDone"),this._websocket.off("clientLeave"),this._websocket.off("clientJoin"),this._websocket.off("clientUpdate"),this._websocket.off("clientMute"),this._websocket.off("liveRoomClose"),this._websocket.off("kicked"),this._websocket.off("roomRefused"),this._websocket.off("clientPublished"),this._websocket.off("sendCommandOverTime"),this._websocket.off("heartbeatOverTime"))}},{key:"_onOpen",value:function(e){}},{key:"_onError",value:function(e){this.logger.error("wsController::onerror: ",e),e&&e.code&&"登录失败"==e.desc?(this._resetReconnectStatus(),this.emit("loginFailed",e)):this._status.reconnectTimer||(this.logger.log("wsController 没有重连计时器，调用stopSignal"),this.stopSignal()),this._status.needReconnect||(e.connectCount=this._status.reconnectCount,this.logger.log("反馈error事件"),this.emit("error",e))}},{key:"_onClose",value:function(){var e=this;if(this.logger.log("主动 _onClose"),this._status.needReconnect)this._unbindEvent(),this._websocket=null,this.logger.log("wsController::onclose: 重连 try reconnect No. "+this._status.reconnectCount,(new Date).toString()),this.emit("willreconnect",{count:this._status.reconnectCount}),clearTimeout(this._status.reconnectTimer),this._status.reconnectTimer=setTimeout((function(){e._status.reconnectTimer=null,e.logger.warn("重连： startSignal"),e.startSignal().then((function(t){e.logger.log("重连成功"),e.emit("reconnected")})).catch((function(t){e.logger.warn("重连失败: ",t),"login timeout"==t&&e._onClose()}))}),5e3);else{this.logger.log("主动触发的destroy");var t=this._status.destroy;this._resetWhenClose(),t?this.emit("destroy"):(this.emit("close"),this.logger.log("wsController::onclose: close need not reconnect"))}}},{key:"_onHangup",value:function(){return this.setEndSessionTime(),this._resetReconnectStatus(!0),this.stopSignal()}},{key:"_onSyncDone",value:function(e){var t=Object.assign({},e);t.userlist.map((function(e){e.account=e.accid,delete e.accid})),t.connectCount=this._status.reconnectCount,this._status.needReconnect=!0,this._status.reconnectCount=0,this.emit("syncDone",t)}},{key:"_onClientLeave",value:function(e){if(this._mainStatus.sessionMode===f.SESSION_MODE.P2P)return this.emit("_invokeHangup",{channelId:e.cid,timetag:+new Date,account:e.accid}),void this.logger.log("wsController::onClientLeave: _invokeHangup");var t=Object.assign({},e);delete t.accid,t.account=e.accid,this.emit("clientLeave",t)}},{key:"_onClientJoin",value:function(e){var t=Object.assign({},e);delete t.accid,t.account=e.accid,this.emit("clientJoin",t)}},{key:"_onClientUpdate",value:function(e){var t=Object.assign({},e.body);delete t.accid,t.account=e.accid,this.emit("clientUpdate",t)}},{key:"_onClientMute",value:function(e){Object.assign({},e);this.emit("clientMute",e)}},{key:"_onLiveRoomClose",value:function(e){this.emit("liveRoomClose",e)}},{key:"_onKicked",value:function(e){this.emit("kicked",e)}},{key:"_onRoomRefused",value:function(e){this.emit("roomRefused",e)}},{key:"_onSendCommandOverTime",value:function(){this.emit("sendCommandOverTime")}},{key:"_onClientPublished",value:function(e){var t=Object.assign({},e.body);this.emit("clientPublished",t)}},{key:"joinChannel",value:function(e){return this.setStartSessionTime(),e.logger=this.logger,e.mainStatus=this._mainStatus,this._status.currentOptions=e,this.startSignal(e)}},{key:"leaveChannel",value:function(){return this.logger.log("主动离开房间"),this.setEndSessionTime(),this._resetReconnectStatus(!0),this.stopSignal()}},{key:"startSignal",value:function(e){if(e||(e=this._status.currentOptions),this.logger.log("reconnect count <= reconnectMaxNum ? "+this._status.reconnectCount+","+this._status.reconnectMaxNum),!(this._status.reconnectCount<=this._status.reconnectMaxNum)){this._resetReconnectStatus(!0),this.logger.warn("wsController: maxceed reconnect times ...");var t={message:"number of connections exceeded"};return this.emit("reconnectFailed",t),Promise.reject(t)}if(!this._websocket)return this._status.needReconnect=!0,this._status.reconnectCount++,this._websocket=new c.default(e),this._bindEvent(),this.logger.log("开始连接小程序服务器"),this._websocket.login();this.logger.log("已经有websocket了"),this.logger.warn("wsController: already in session ...");return Promise.reject({message:"already in session"})}},{key:"stopSignal",value:function(){return this._websocket?(this.logger.log("wsController::stopSignal: start..."),this._websocket.logout()):(this._onClose(),Promise.resolve())}},{key:"publish",value:(v=(0,i.default)(r.default.mark((function e(t){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._websocket.publish(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"unpublish",value:(m=(0,i.default)(r.default.mark((function e(t){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._websocket.unpublish(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)})},{key:"subscribe",value:(h=(0,i.default)(r.default.mark((function e(t,n){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._websocket.subscribe(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"unsubscribe",value:(p=(0,i.default)(r.default.mark((function e(t,n){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._websocket.unsubscribe(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"mute",value:(l=(0,i.default)(r.default.mark((function e(t,n){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._websocket.mute(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"unmute",value:(n=(0,i.default)(r.default.mark((function e(t,n){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._websocket.unmute(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"switchMode",value:function(e){return this._websocket.updatePushMode(e)}},{key:"setStartSessionTime",value:function(){this.emit("sessionStart")}},{key:"setEndSessionTime",value:function(){this.emit("sessionEnd")}}]),t}(l.default);t.default=h,e.exports=t.default},function(e,t,n){"use strict";var r,i=n(15),o=(r=i)&&r.__esModule?r:{default:r};var s=n(135),a=n(136);function u(e){"object"===(void 0===e?"undefined":(0,o.default)(e))?(this.callFunc=e.callFunc||null,this.message=e.message||"UNKNOW ERROR"):this.message=e,this.time=new Date,this.timetag=+this.time}n(137);var c,l,d=n(10),f=d.getGlobal(),p=/\s+/;d.deduplicate=function(e){var t=[];return e.forEach((function(e){-1===t.indexOf(e)&&t.push(e)})),t},d.capFirstLetter=function(e){return e?(e=""+e).slice(0,1).toUpperCase()+e.slice(1):""},d.guid=(c=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)},function(){return c()+c()+c()+c()+c()+c()+c()+c()}),d.extend=function(e,t,n){for(var r in t)void 0!==e[r]&&!0!==n||(e[r]=t[r])},d.filterObj=function(e,t){var n={};return d.isString(t)&&(t=t.split(p)),t.forEach((function(t){e.hasOwnProperty(t)&&(n[t]=e[t])})),n},d.copy=function(e,t){return t=t||{},e?(Object.keys(e).forEach((function(n){d.exist(e[n])&&(t[n]=e[n])})),t):t},d.copyWithNull=function(e,t){return t=t||{},e?(Object.keys(e).forEach((function(n){(d.exist(e[n])||d.isnull(e[n]))&&(t[n]=e[n])})),t):t},d.findObjIndexInArray=function(e,t){e=e||[];var n=t.keyPath||"id",r=-1;return e.some((function(e,i){if(a(e,n)===t.value)return r=i,!0})),r},d.findObjInArray=function(e,t){var n=d.findObjIndexInArray(e,t);return-1===n?null:e[n]},d.mergeObjArray=function(){var e=[],t=[].slice.call(arguments,0,-1),n=arguments[arguments.length-1];d.isArray(n)&&(t.push(n),n={});var r,i=n.keyPath=n.keyPath||"id";for(n.sortPath=n.sortPath||i;!e.length&&t.length;)e=(e=t.shift()||[]).slice(0);return t.forEach((function(t){t&&t.forEach((function(t){-1!==(r=d.findObjIndexInArray(e,{keyPath:i,value:a(t,i)}))?e[r]=d.merge({},e[r],t):e.push(t)}))})),n.notSort||(e=d.sortObjArray(e,n)),e},d.cutObjArray=function(e){var t=e.slice(0),n=arguments.length,r=[].slice.call(arguments,1,n-1),i=arguments[n-1];d.isObject(i)||(r.push(i),i={});var o,s=i.keyPath=i.keyPath||"id";return r.forEach((function(e){d.isArray(e)||(e=[e]),e.forEach((function(e){e&&(i.value=a(e,s),-1!==(o=d.findObjIndexInArray(t,i))&&t.splice(o,1))}))})),t},d.sortObjArray=function(e,t){var n=(t=t||{}).sortPath||"id";s.insensitive=!!t.insensitive;var r,i,o,u=!!t.desc;return o=d.isFunction(t.compare)?t.compare:function(e,t){return r=a(e,n),i=a(t,n),u?s(i,r):s(r,i)},e.sort(o)},d.emptyFunc=function(){},d.isEmptyFunc=function(e){return e===d.emptyFunc},d.notEmptyFunc=function(e){return e!==d.emptyFunc},d.splice=function(e,t,n){return[].splice.call(e,t,n)},d.reshape2d=function(e,t){if(Array.isArray(e)){d.verifyParamType("type",t,"number","util::reshape2d");var n=e.length;if(n<=t)return[e];for(var r=Math.ceil(n/t),i=[],o=0;o<r;o++)i.push(e.slice(o*t,(o+1)*t));return i}return e},d.flatten2d=function(e){if(Array.isArray(e)){var t=[];return e.forEach((function(e){t=t.concat(e)})),t}return e},d.dropArrayDuplicates=function(e){if(Array.isArray(e)){for(var t={},n=[];e.length>0;){t[e.shift()]=!0}for(var r in t)!0===t[r]&&n.push(r);return n}return e},d.onError=function(e){throw new u(e)},d.verifyParamPresent=function(e,t,n,r){n=n||"";var i=!1;switch(d.typeOf(t)){case"undefined":case"null":i=!0;break;case"string":""===t&&(i=!0);break;case"StrStrMap":case"object":Object.keys(t).length||(i=!0);break;case"array":t.length?t.some((function(e){if(d.notexist(e))return i=!0,!0})):i=!0}i&&d.onParamAbsent(n+e,r)},d.onParamAbsent=function(e,t){d.onParamError("缺少参数 "+e+", 请确保参数不是 空字符串、空对象、空数组、null或undefined, 或数组的内容不是 null/undefined",t)},d.verifyParamAbsent=function(e,t,n,r){n=n||"",void 0!==t&&d.onParamPresent(n+e,r)},d.onParamPresent=function(e,t){d.onParamError("多余的参数 "+e,t)},d.verifyParamType=function(e,t,n,r){var i=d.typeOf(t).toLowerCase();d.isArray(n)||(n=[n]);var o=!0;switch(-1===(n=n.map((function(e){return e.toLowerCase()}))).indexOf(i)&&(o=!1),i){case"number":isNaN(t)&&(o=!1);break;case"string":"numeric or numeric string"===n.join("")&&(o=!!/^[0-9]+$/.test(t))}o||d.onParamInvalidType(e,n,"",r)},d.onParamInvalidType=function(e,t,n,r){n=n||"",t=d.isArray(t)?(t=t.map((function(e){return'"'+e+'"'}))).join(", "):'"'+t+'"',d.onParamError('参数"'+n+e+'"类型错误, 合法的类型包括: ['+t+"]",r)},d.verifyParamValid=function(e,t,n,r){d.isArray(n)||(n=[n]),-1===n.indexOf(t)&&d.onParamInvalidValue(e,n,r)},d.onParamInvalidValue=function(e,t,n){d.isArray(t)||(t=[t]),t=t.map((function(e){return'"'+e+'"'})),d.isArray(t)&&(t=t.join(", ")),d.onParamError("参数 "+e+"值错误, 合法的值包括: ["+JSON.stringify(t)+"]",n)},d.verifyParamMin=function(e,t,n,r){t<n&&d.onParamError("参数"+e+"的值不能小于"+n,r)},d.verifyParamMax=function(e,t,n,r){t>n&&d.onParamError("参数"+e+"的值不能大于"+n,r)},d.verifyArrayMax=function(e,t,n,r){t.length>n&&d.onParamError("参数"+e+"的长度不能大于"+n,r)},d.verifyEmail=(l=/^\S+@\S+$/,function(e,t,n){l.test(t)||d.onParamError("参数"+e+"邮箱格式错误, 合法格式必须包含@符号, @符号前后至少要各有一个字符",n)}),d.verifyTel=function(){var e=/^[+\-()\d]+$/;return function(t,n,r){e.test(n)||d.onParamError("参数"+t+"电话号码格式错误, 合法字符包括+、-、英文括号和数字",r)}}(),d.verifyBirth=function(){var e=/^(\d{4})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/;return function(t,n,r){e.test(n)||d.onParamError("参数"+t+'生日格式错误, 合法为"yyyy-MM-dd"',r)}}(),d.onParamError=function(e,t){d.onError({message:e,callFunc:t})},d.verifyOptions=function(e,t,n,r,i){if(e=e||{},t&&(d.isString(t)&&(t=t.split(p)),d.isArray(t))){"boolean"!=typeof n&&(i=n||null,n=!0,r="");var o=n?d.verifyParamPresent:d.verifyParamAbsent;t.forEach((function(t){o.call(d,t,e[t],r,i)}))}return e},d.verifyParamAtLeastPresentOne=function(e,t,n){t&&(d.isString(t)&&(t=t.split(p)),d.isArray(t)&&(t.some((function(t){return d.exist(e[t])}))||d.onParamError("以下参数["+t.join(", ")+"]至少需要传入一个",n)))},d.verifyParamPresentJustOne=function(e,t,n){t&&(d.isString(t)&&(t=t.split(p)),d.isArray(t)&&1!==t.reduce((function(t,n){return d.exist(e[n])&&t++,t}),0)&&d.onParamError("以下参数["+t.join(", ")+"]必须且只能传入一个",n))},d.verifyBooleanWithDefault=function(e,t,n,r,i){d.undef(n)&&(n=!0),p.test(t)&&(t=t.split(p)),d.isArray(t)?t.forEach((function(t){d.verifyBooleanWithDefault(e,t,n,r,i)})):void 0===e[t]?e[t]=n:d.isBoolean(e[t])||d.onParamInvalidType(t,"boolean",r,i)},d.verifyFileInput=function(e,t){return d.verifyParamPresent("fileInput",e,"",t),d.isString(e)&&((e="undefined"==typeof document?void 0:document.getElementById(e))||d.onParamError("找不到要上传的文件对应的input, 请检查fileInput id "+e,t)),e.tagName&&"input"===e.tagName.toLowerCase()&&"file"===e.type.toLowerCase()||d.onParamError("请提供正确的 fileInput, 必须为 file 类型的 input 节点 tagname:"+e.tagName+", filetype:"+e.type,t),e},d.verifyFileType=function(e,t){d.verifyParamValid("type",e,d.validFileTypes,t)},d.verifyCallback=function(e,t,n){p.test(t)&&(t=t.split(p)),d.isArray(t)?t.forEach((function(t){d.verifyCallback(e,t,n)})):e[t]?d.isFunction(e[t])||d.onParamInvalidType(t,"function","",n):e[t]=d.emptyFunc},d.verifyFileUploadCallback=function(e,t){d.verifyCallback(e,"uploadprogress uploaddone uploaderror uploadcancel",t)},d.validFileTypes=["image","audio","video","file"],d.validFileExts={image:["bmp","gif","jpg","jpeg","jng","png","webp"],audio:["mp3","wav","aac","wma","wmv","amr","mp2","flac","vorbis","ac3"],video:["mp4","rm","rmvb","wmv","avi","mpg","mpeg"]},d.filterFiles=function(e,t){var n,r,i="file"===(t=t.toLowerCase()),o=[];return[].forEach.call(e,(function(e){if(i)o.push(e);else if(n=e.name.slice(e.name.lastIndexOf(".")+1),(r=e.type.split("/"))[0]&&r[1]){(r[0].toLowerCase()===t||-1!==d.validFileExts[t].indexOf(n))&&o.push(e)}})),o};var h,m,v=d.supportFormData=d.notundef(f.FormData);d.getFileName=function(e){return e=d.verifyFileInput(e),v?e.files[0].name:e.value.slice(e.value.lastIndexOf("\\")+1)},d.getFileInfo=(h={ppt:1,pptx:2,pdf:3},function(e){var t={};if(!(e=d.verifyFileInput(e)).files)return t;var n=e.files[0];return v&&(t.name=n.name,t.size=n.size,t.type=n.name.match(/\.(\w+)$/),t.type=t.type&&t.type[1].toLowerCase(),t.transcodeType=h[t.type]||0),t}),d.sizeText=(m=["B","KB","MB","GB","TB","PB","EB","ZB","BB"],function(e){var t,n=0;do{t=(e=Math.floor(100*e)/100)+m[n],e/=1024,n++}while(e>1);return t}),d.promises2cmds=function(e){return e.map((function(e){return e.cmd}))},d.objs2accounts=function(e){return e.map((function(e){return e.account}))},d.teams2ids=function(e){return e.map((function(e){return e.teamId}))},d.objs2ids=function(e){return e.map((function(e){return e.id}))},d.getMaxUpdateTime=function(e){var t=e.map((function(e){return+e.updateTime}));return Math.max.apply(Math,t)},d.genCheckUniqueFunc=function(e,t){return e=e||"id",t=t||1e3,function(t){this.uniqueSet=this.uniqueSet||{},this.uniqueSet[e]=this.uniqueSet[e]||{};var n=this.uniqueSet[e],r=t[e];return!n[r]&&(n[r]=!0,!0)}},d.fillPropertyWithDefault=function(e,t,n){return!!d.undef(e[t])&&(e[t]=n,!0)},e.exports=d},function(e,t,n){"use strict";var r=n(10),i=r.getGlobal(),o={},s=i.name||"_parent",a=[],u=[];o.addMsgListener=function(e){a.push(e)};var c,l,d,f,p=(c=/^([\w]+?:\/\/.*?(?=\/|$))/i,function(e){return e=e||"",c.test(e)?RegExp.$1:"*"}),h=function(){var e=unescape(i.name||"").trim();if(e&&0===e.indexOf("MSG|")){i.name="";var t=r.string2object(e.replace("MSG|",""),"|"),n=(t.origin||"").toLowerCase();n&&"*"!==n&&0!==location.href.toLowerCase().indexOf(n)||function(e){for(var t=0,n=a.length;t<n;t++)try{a[t].call(null,e)}catch(e){}}({data:JSON.parse(t.data||"null"),source:i.frames[t.self]||t.self,origin:p(t.ref||("undefined"==typeof document?"":document.referrer))})}},m=(d=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return!0;return!1},function(){if(u.length){l=[];for(var e,t=u.length-1;t>=0;t--)e=u[t],d(l,e.w)||(l.push(e.w),u.splice(t,1),e.w.name=e.d);l=null}}),v=o.startTimer=(f=!1,function(){f||(f=!0,i.postMessage||(setInterval(m,100),setInterval(h,20)))});o.postMessage=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r.fillUndef(t,{origin:"*",source:s}),i.postMessage){var n=t.data;i.FormData||(n=JSON.stringify(n)),e.postMessage(n,t.origin)}else{if(v(),r.isObject(t)){var o={};o.origin=t.origin||"",o.ref=location.href,o.self=t.source,o.data=JSON.stringify(t.data),t="MSG|"+r.object2string(o,"|",!0)}u.unshift({w:e,d:escape(t)})}},e.exports=o},function(e,t,n){var r,i,o,s,a;r=n(156),i=n(72).utf8,o=n(157),s=n(72).bin,(a=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?s.stringToBytes(e):i.stringToBytes(e):o(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var n=r.bytesToWords(e),u=8*e.length,c=1732584193,l=-271733879,d=-1732584194,f=271733878,p=0;p<n.length;p++)n[p]=16711935&(n[p]<<8|n[p]>>>24)|4278255360&(n[p]<<24|n[p]>>>8);n[u>>>5]|=128<<u%32,n[14+(u+64>>>9<<4)]=u;var h=a._ff,m=a._gg,v=a._hh,y=a._ii;for(p=0;p<n.length;p+=16){var g=c,_=l,b=d,k=f;c=h(c,l,d,f,n[p+0],7,-680876936),f=h(f,c,l,d,n[p+1],12,-389564586),d=h(d,f,c,l,n[p+2],17,606105819),l=h(l,d,f,c,n[p+3],22,-1044525330),c=h(c,l,d,f,n[p+4],7,-176418897),f=h(f,c,l,d,n[p+5],12,1200080426),d=h(d,f,c,l,n[p+6],17,-1473231341),l=h(l,d,f,c,n[p+7],22,-45705983),c=h(c,l,d,f,n[p+8],7,1770035416),f=h(f,c,l,d,n[p+9],12,-1958414417),d=h(d,f,c,l,n[p+10],17,-42063),l=h(l,d,f,c,n[p+11],22,-1990404162),c=h(c,l,d,f,n[p+12],7,1804603682),f=h(f,c,l,d,n[p+13],12,-40341101),d=h(d,f,c,l,n[p+14],17,-1502002290),c=m(c,l=h(l,d,f,c,n[p+15],22,1236535329),d,f,n[p+1],5,-165796510),f=m(f,c,l,d,n[p+6],9,-1069501632),d=m(d,f,c,l,n[p+11],14,643717713),l=m(l,d,f,c,n[p+0],20,-373897302),c=m(c,l,d,f,n[p+5],5,-701558691),f=m(f,c,l,d,n[p+10],9,38016083),d=m(d,f,c,l,n[p+15],14,-660478335),l=m(l,d,f,c,n[p+4],20,-405537848),c=m(c,l,d,f,n[p+9],5,568446438),f=m(f,c,l,d,n[p+14],9,-1019803690),d=m(d,f,c,l,n[p+3],14,-187363961),l=m(l,d,f,c,n[p+8],20,1163531501),c=m(c,l,d,f,n[p+13],5,-1444681467),f=m(f,c,l,d,n[p+2],9,-51403784),d=m(d,f,c,l,n[p+7],14,1735328473),c=v(c,l=m(l,d,f,c,n[p+12],20,-1926607734),d,f,n[p+5],4,-378558),f=v(f,c,l,d,n[p+8],11,-2022574463),d=v(d,f,c,l,n[p+11],16,1839030562),l=v(l,d,f,c,n[p+14],23,-35309556),c=v(c,l,d,f,n[p+1],4,-1530992060),f=v(f,c,l,d,n[p+4],11,1272893353),d=v(d,f,c,l,n[p+7],16,-155497632),l=v(l,d,f,c,n[p+10],23,-1094730640),c=v(c,l,d,f,n[p+13],4,681279174),f=v(f,c,l,d,n[p+0],11,-358537222),d=v(d,f,c,l,n[p+3],16,-722521979),l=v(l,d,f,c,n[p+6],23,76029189),c=v(c,l,d,f,n[p+9],4,-640364487),f=v(f,c,l,d,n[p+12],11,-421815835),d=v(d,f,c,l,n[p+15],16,530742520),c=y(c,l=v(l,d,f,c,n[p+2],23,-995338651),d,f,n[p+0],6,-198630844),f=y(f,c,l,d,n[p+7],10,1126891415),d=y(d,f,c,l,n[p+14],15,-1416354905),l=y(l,d,f,c,n[p+5],21,-57434055),c=y(c,l,d,f,n[p+12],6,1700485571),f=y(f,c,l,d,n[p+3],10,-1894986606),d=y(d,f,c,l,n[p+10],15,-1051523),l=y(l,d,f,c,n[p+1],21,-2054922799),c=y(c,l,d,f,n[p+8],6,1873313359),f=y(f,c,l,d,n[p+15],10,-30611744),d=y(d,f,c,l,n[p+6],15,-1560198380),l=y(l,d,f,c,n[p+13],21,1309151649),c=y(c,l,d,f,n[p+4],6,-145523070),f=y(f,c,l,d,n[p+11],10,-1120210379),d=y(d,f,c,l,n[p+2],15,718787259),l=y(l,d,f,c,n[p+9],21,-343485551),c=c+g>>>0,l=l+_>>>0,d=d+b>>>0,f=f+k>>>0}return r.endian([c,l,d,f])})._ff=function(e,t,n,r,i,o,s){var a=e+(t&n|~t&r)+(i>>>0)+s;return(a<<o|a>>>32-o)+t},a._gg=function(e,t,n,r,i,o,s){var a=e+(t&r|n&~r)+(i>>>0)+s;return(a<<o|a>>>32-o)+t},a._hh=function(e,t,n,r,i,o,s){var a=e+(t^n^r)+(i>>>0)+s;return(a<<o|a>>>32-o)+t},a._ii=function(e,t,n,r,i,o,s){var a=e+(n^(t|~r))+(i>>>0)+s;return(a<<o|a>>>32-o)+t},a._blocksize=16,a._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var n=r.wordsToBytes(a(e,t));return t&&t.asBytes?n:t&&t.asString?s.bytesToString(n):r.bytesToHex(n)}},function(e,t){var n={utf8:{stringToBytes:function(e){return n.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(n.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}};e.exports=n},function(e,t,n){"use strict";var r=n(74);e.exports=r.YunXinMiniappSDK},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.YunXinMiniappSDK=void 0;var r=v(n(3)),i=v(n(4)),o=v(n(14)),s=v(n(17)),a=v(n(106)),u=v(n(148)),c=v(n(150)),l=v(n(151)),d=v(n(152)),f=v(n(153)),p=v(n(23)),h=v(n(154)),m=v(n(158));function v(e){return e&&e.__esModule?e:{default:e}}t.YunXinMiniappSDK=function(e){function t(e){(0,r.default)(this,t);var n=(0,o.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return e.nim?(Object.assign(a.default.prototype,m.default),n._init({nim:e.nim,logger:n.logger})):(p.default.verifyOptions(e,"appkey"),Object.assign(a.default.prototype,h.default),n._init({appkey:e.appkey,nim:e.nim,logger:n.logger})),n}return(0,s.default)(t,e),(0,i.default)(t,null,[{key:"Client",value:function(e){return t.instance?(e.nim&&e.nim&&(t.instance._imController._nim=e.nim),t.instance):t.instance=new t(e)}},{key:"getInstance",value:function(e){return t.instance?(e.nim&&e.nim&&(t.instance._imController._nim=e.nim),t.instance):t.instance=new t(e)}},{key:"destroy",value:function(){t.instance=null}},{key:"install",value:function(e,t){u.default.install(e,t),c.default.install(e,t),e.parser.mixin({configMap:l.default,serializeMap:d.default,unserializeMap:f.default})}}]),t}(a.default)},function(e,t,n){e.exports={default:n(76),__esModule:!0}},function(e,t,n){n(77);var r=n(2).Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},function(e,t,n){var r=n(6);r(r.S+r.F*!n(9),"Object",{defineProperty:n(7).f})},function(e,t,n){e.exports={default:n(79),__esModule:!0}},function(e,t,n){n(49),n(56),e.exports=n(39).f("iterator")},function(e,t,n){var r=n(32),i=n(33);e.exports=function(e){return function(t,n){var o,s,a=String(i(t)),u=r(n),c=a.length;return u<0||u>=c?e?"":void 0:(o=a.charCodeAt(u))<55296||o>56319||u+1===c||(s=a.charCodeAt(u+1))<56320||s>57343?e?a.charAt(u):o:e?a.slice(u,u+2):s-56320+(o-55296<<10)+65536}}},function(e,t,n){"use strict";var r=n(34),i=n(26),o=n(28),s={};n(11)(s,n(1)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(s,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(7),i=n(5),o=n(35);e.exports=n(9)?Object.defineProperties:function(e,t){i(e);for(var n,s=o(t),a=s.length,u=0;a>u;)r.f(e,n=s[u++],t[n]);return e}},function(e,t,n){var r=n(21);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(16),i=n(53),o=n(85);e.exports=function(e){return function(t,n,s){var a,u=r(t),c=i(u.length),l=o(s,c);if(e&&n!=n){for(;c>l;)if((a=u[l++])!=a)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(32),i=Math.max,o=Math.min;e.exports=function(e,t){return(e=r(e))<0?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(12),i=n(55),o=n(36)("IE_PROTO"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t,n){"use strict";var r=n(88),i=n(89),o=n(20),s=n(16);e.exports=n(50)(Array,"Array",(function(e,t){this._t=s(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){e.exports={default:n(91),__esModule:!0}},function(e,t,n){n(92),n(60),n(97),n(98),e.exports=n(2).Symbol},function(e,t,n){"use strict";var r=n(0),i=n(12),o=n(9),s=n(6),a=n(51),u=n(93).KEY,c=n(25),l=n(37),d=n(28),f=n(27),p=n(1),h=n(39),m=n(40),v=n(94),y=n(95),g=n(5),_=n(8),b=n(55),k=n(16),C=n(31),O=n(26),S=n(34),E=n(96),w=n(59),T=n(57),N=n(7),L=n(35),P=w.f,R=N.f,x=E.f,j=r.Symbol,A=r.JSON,M=A&&A.stringify,I=p("_hidden"),D=p("toPrimitive"),U={}.propertyIsEnumerable,F=l("symbol-registry"),V=l("symbols"),H=l("op-symbols"),B=Object.prototype,G="function"==typeof j&&!!T.f,J=r.QObject,W=!J||!J.prototype||!J.prototype.findChild,z=o&&c((function(){return 7!=S(R({},"a",{get:function(){return R(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=P(B,t);r&&delete B[t],R(e,t,n),r&&e!==B&&R(B,t,r)}:R,q=function(e){var t=V[e]=S(j.prototype);return t._k=e,t},K=G&&"symbol"==typeof j.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof j},Y=function(e,t,n){return e===B&&Y(H,t,n),g(e),t=C(t,!0),g(n),i(V,t)?(n.enumerable?(i(e,I)&&e[I][t]&&(e[I][t]=!1),n=S(n,{enumerable:O(0,!1)})):(i(e,I)||R(e,I,O(1,{})),e[I][t]=!0),z(e,t,n)):R(e,t,n)},$=function(e,t){g(e);for(var n,r=v(t=k(t)),i=0,o=r.length;o>i;)Y(e,n=r[i++],t[n]);return e},X=function(e){var t=U.call(this,e=C(e,!0));return!(this===B&&i(V,e)&&!i(H,e))&&(!(t||!i(this,e)||!i(V,e)||i(this,I)&&this[I][e])||t)},Z=function(e,t){if(e=k(e),t=C(t,!0),e!==B||!i(V,t)||i(H,t)){var n=P(e,t);return!n||!i(V,t)||i(e,I)&&e[I][t]||(n.enumerable=!0),n}},Q=function(e){for(var t,n=x(k(e)),r=[],o=0;n.length>o;)i(V,t=n[o++])||t==I||t==u||r.push(t);return r},ee=function(e){for(var t,n=e===B,r=x(n?H:k(e)),o=[],s=0;r.length>s;)!i(V,t=r[s++])||n&&!i(B,t)||o.push(V[t]);return o};G||(a((j=function(){if(this instanceof j)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(n){this===B&&t.call(H,n),i(this,I)&&i(this[I],e)&&(this[I][e]=!1),z(this,e,O(1,n))};return o&&W&&z(B,e,{configurable:!0,set:t}),q(e)}).prototype,"toString",(function(){return this._k})),w.f=Z,N.f=Y,n(58).f=E.f=Q,n(41).f=X,T.f=ee,o&&!n(19)&&a(B,"propertyIsEnumerable",X,!0),h.f=function(e){return q(p(e))}),s(s.G+s.W+s.F*!G,{Symbol:j});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;te.length>ne;)p(te[ne++]);for(var re=L(p.store),ie=0;re.length>ie;)m(re[ie++]);s(s.S+s.F*!G,"Symbol",{for:function(e){return i(F,e+="")?F[e]:F[e]=j(e)},keyFor:function(e){if(!K(e))throw TypeError(e+" is not a symbol!");for(var t in F)if(F[t]===e)return t},useSetter:function(){W=!0},useSimple:function(){W=!1}}),s(s.S+s.F*!G,"Object",{create:function(e,t){return void 0===t?S(e):$(S(e),t)},defineProperty:Y,defineProperties:$,getOwnPropertyDescriptor:Z,getOwnPropertyNames:Q,getOwnPropertySymbols:ee});var oe=c((function(){T.f(1)}));s(s.S+s.F*oe,"Object",{getOwnPropertySymbols:function(e){return T.f(b(e))}}),A&&s(s.S+s.F*(!G||c((function(){var e=j();return"[null]"!=M([e])||"{}"!=M({a:e})||"{}"!=M(Object(e))}))),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(_(t)||void 0!==e)&&!K(e))return y(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!K(t))return t}),r[1]=t,M.apply(A,r)}}),j.prototype[D]||n(11)(j.prototype,D,j.prototype.valueOf),d(j,"Symbol"),d(Math,"Math",!0),d(r.JSON,"JSON",!0)},function(e,t,n){var r=n(27)("meta"),i=n(8),o=n(12),s=n(7).f,a=0,u=Object.isExtensible||function(){return!0},c=!n(25)((function(){return u(Object.preventExtensions({}))})),l=function(e){s(e,r,{value:{i:"O"+ ++a,w:{}}})},d=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!u(e))return"F";if(!t)return"E";l(e)}return e[r].i},getWeak:function(e,t){if(!o(e,r)){if(!u(e))return!0;if(!t)return!1;l(e)}return e[r].w},onFreeze:function(e){return c&&d.NEED&&u(e)&&!o(e,r)&&l(e),e}}},function(e,t,n){var r=n(35),i=n(57),o=n(41);e.exports=function(e){var t=r(e),n=i.f;if(n)for(var s,a=n(e),u=o.f,c=0;a.length>c;)u.call(e,s=a[c++])&&t.push(s);return t}},function(e,t,n){var r=n(21);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(16),i=n(58).f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(e){return s.slice()}}(e):i(r(e))}},function(e,t,n){n(40)("asyncIterator")},function(e,t,n){n(40)("observable")},function(e,t,n){e.exports={default:n(100),__esModule:!0}},function(e,t,n){n(101),e.exports=n(2).Object.setPrototypeOf},function(e,t,n){var r=n(6);r(r.S,"Object",{setPrototypeOf:n(102).set})},function(e,t,n){var r=n(8),i=n(5),o=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(18)(Function.call,n(59).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:o}},function(e,t,n){e.exports={default:n(104),__esModule:!0}},function(e,t,n){n(105);var r=n(2).Object;e.exports=function(e,t){return r.create(e,t)}},function(e,t,n){var r=n(6);r(r.S,"Object",{create:n(34)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=m(n(42)),i=m(n(43)),o=m(n(3)),s=m(n(4)),a=m(n(14)),u=m(n(17)),c=m(n(22)),l=m(n(23)),d=m(n(66)),f=m(n(68)),p=m(n(132)),h=n(13);function m(e){return e&&e.__esModule?e:{default:e}}var v=n(133),y=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,o.default)(this,t);var n=(0,a.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.logger=new v({debug:e.debug,prefix:"mini"}),n._commonStatus={},n._rtcStatus={},n._nrtcStatus={appkey:e.appkey||null},n._status={RTC:!1,NRTC:!1,startSessionTime:0,endSessionTime:0,lastSessionDuation:0,publishAudio:!1,publishVideo:!1,channelServer:"",statisticsServer:""},e.nim?n._status.RTC=!0:n._status.NRTC=!0,n._imController=null,n._wsController=null,n._init(),n}return(0,u.default)(t,e),(0,s.default)(t,[{key:"_init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._resetStatus(),this._status.RTC&&(this._imController=new d.default(Object.assign(e,{status:this._status})),Object.assign(this,h.CONTROL_TYPE,h.CALL_TYPE)),Object.assign(this,h.ROLE_FOR_MEETING,h.SESSION_MODE,h.LIVE_ENABLE,h.RECORD_TYPE,h.RECORD_AUDIO,h.RECORD_VIDEO,h.NETCALL_MODE,h.RTMP_RECORD),this._wsController=new f.default(Object.assign(e,{status:this._status})),this._dataReporter=new p.default,this._bindEvent()}},{key:"_resetStatus",value:function(){this.logger.log("重置的状态"),Object.assign(this._commonStatus,{closeEvent:h.CONSTANT_ERROR.closeNormal,role:0,rtmpPushAddress:""}),Object.assign(this._rtcStatus,{signalInited:!1,signalStartTime:0,signalEndTime:0,sessionMode:"",calling:!1,isCaller:!1,pushConfig:{},onTheCall:!1,isTeamCall:!1}),Object.assign(this._nrtcStatus,{joinChannelParam:null,isInTheRoom:!1,createChannelResponse:{}}),this._status.publishAudio=!1,this._status.publishVideo=!1,Object.assign(this._status,this._commonStatus),this._status.RTC?Object.assign(this._status,this._rtcStatus):Object.assign(this._status,this._nrtcStatus),this._info={isSyncDown:!1,pushUrl:"",userlist:new Map,cid:0,uid:0}}},{key:"_updateStatus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(this._status,e)}},{key:"_bindEvent",value:function(){var e,t=this;this._wsController&&(this._wsController.on("reconnectFailed",(function(e){t.apiEventReport("setDisconnect",{reason:"reconnectFailed"}),t._status.closeEvent=h.CONSTANT_ERROR.reconnectFail,t.destroy()})),this._wsController.on("kicked",(function(e){t.apiEventReport("setDisconnect",{reason:"kicked"}),t._status.closeEvent=h.CONSTANT_ERROR.kicked,t.emit("kicked",e),t.destroy()})),this._wsController.on("roomRefused",(function(e){t._status.closeEvent=h.CONSTANT_ERROR.roomRefused,t.apiEventReport("setDisconnect",{reason:"roomRefused"}),t.emit("kicked",e),t.destroy()})),this._wsController.on("loginFailed",(function(e){e?e.code==h.CONSTANT_ERROR.loginFailed.code?t._status.closeEvent=h.CONSTANT_ERROR.loginFailed:e.code===h.CONSTANT_ERROR.loginFailedEncrypt.code&&(t._status.closeEvent=h.CONSTANT_ERROR.loginFailedEncrypt):t._status.closeEvent=h.CONSTANT_ERROR.loginFailed;var n=t._info.joinChannelParam||t._info.createChannelResponse||{};t.apiEventReport("setLogin",{a_record:!!n.recordAudio,v_record:!!n.recordVideo,record_type:n.recordType?n.recordType+"":"0",host_speaker:!!n.isHostSpeaker,result:e.code,serverIp:n.address||""}),t.destroy()})),this._wsController.on("destroy",(function(){var e=Object.assign({},t._status.closeEvent);t.logger.log("mainController::ws ondestroy: ",e),t._resetStatus(),t.emit("disconnect",e)})),this._wsController.on("error",(function(e){t.apiEventReport("setDisconnect",{reason:"ws error"}),t.emit("error",e)})),this._wsController.on("syncDone",(function(e){t.logger.log("mainController: syncDone 成功:",e);t._status.needReconnect;var n=t._info.joinChannelParam||t._info.createChannelResponse||{};t.apiEventReport("setLogin",{a_record:!!n.recordAudio,v_record:!!n.recordVideo,record_type:n.recordType?n.recordType+"":"0",host_speaker:!!n.isHostSpeaker,result:0,serverIp:n.address||""}),t._info.isSyncDown?(e.userlist.map((function(e){e.uid==t._info.uid?(t._info.pushUrl=e.url,t.logger.log("找到推流地址: ",t._info.pushUrl)):(t.logger.log("房间里有其他人: ",e),t._info.userlist.set(e.uid,e))})),t.emit("syncDone",e)):(t._info.isSyncDown=!0,e.userlist=e.userlist.map((function(e){return e.uid==t._info.uid?(t._info.pushUrl=e.url,t.logger.log("找到推流地址: ",t._info.pushUrl),t._status.publishAudio||t._status.publishVideo?e:{}):(t.logger.log("房间里有其他人: ",e),t._info.userlist.set(e.uid,e),t.emit("clientJoin",e),(e.audio_on||e.video_on)&&(t.logger.log("房间里有其他人 stream-added"),e.audio_on&&(t.logger.log("房间里有其他人 stream-added audio"),t.emit("stream-added",{uid:e.uid,mediaType:"audio"})),e.video_on&&(t.logger.log("房间里有其他人 stream-added video"),t.emit("stream-added",{uid:e.uid,mediaType:"video"}))),e)})))})),this._wsController.on("clientLeave",(function(e){t.logger.log("有人离开: ",e),t.emit("clientLeave",e),t._info.userlist.delete(e.uid),t.emit("stream-removed",e.uid)})),this._wsController.on("clientMute",(function(e){t.logger.log("mainController: clientMute 有人mute:",e),"audio"==e.mediaType?e.mute?t.emit("mute-audio",e.uid):t.emit("unmute-audio",e.uid):"video"==e.mediaType&&(e.mute?t.emit("mute-video",e.uid):t.emit("unmute-video",e.uid))})),this._wsController.on("clientJoin",(function(e){t.logger.log("mainController: clientJoin 有人加入房间:",e),t._info.userlist.set(e.uid,e),t.emit("clientJoin",e)})),this._wsController.on("clientUpdate",(function(e){t.logger.log("mainController: clientUpdate 有人更新:",e),t.emit("clientUpdate",e)})),this._wsController.on("liveRoomClose",(function(e){t.emit("liveRoomClose",e)})),this._wsController.on("willreconnect",(function(e){t.apiEventReport("setDisconnect",{reason:"willreconnect"}),t.emit("willreconnect",e)})),this._wsController.on("reconnected",(e=(0,i.default)(r.default.mark((function e(n){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._status.publishAudio){e.next=4;break}return t._status.publishAudio=!1,e.next=4,t.publish("audio");case 4:if(!t._status.publishVideo){e.next=8;break}return t._status.publishVideo=!1,e.next=8,t.publish("video");case 8:t.emit("reconnected",n);case 9:case"end":return e.stop()}}),e,t)}))),function(t){return e.apply(this,arguments)})),this._wsController.on("clientPublished",(function(e){t.logger.log("mainController: clientPublished 有人发布媒体:",e),"open"==e.status?(t.logger.log("通知对端pub流"),t.emit("stream-added",{uid:e.uid,mediaType:e.mediaType})):"close"==e.status&&t.emit("stream-removed",{uid:e.uid,mediaType:e.mediaType})})),this._wsController.on("sendCommandOverTime",(function(e){t.apiEventReport("setDisconnect",{reason:"sendCommandOverTime"}),t.emit("sendCommandOverTime",e)})),this._wsController.on("sessionStart",this.setStartSessionTime.bind(this)),this._wsController.on("sessionEnd",this.setEndSessionTime.bind(this)),this._wsController.on("_invokeHangup",(function(e){t._imController._onNotifyHangup(e)}))),this._imController&&(this._imController.on("control",(function(e){t.emit("control",e)})),this._imController.on("beCalling",(function(e){t.emit("beCalling",e)})),this._imController.on("callAccepted",(function(e){t.emit("callAccepted",e)})),this._imController.on("callRejected",(function(e){t.emit("callRejected",e)})),this._imController.on("joinChannel",(function(e){t.emit("joinChannel",e)})),this._imController.on("leaveChannel",(function(e){t.leaveChannel()})),this._imController.on("hangup",(function(e){t.emit("hangup",e)})),this._imController.on("callerAckSync",(function(e){t.emit("callerAckSync",e)})),this._imController.on("resetWhenHangup",(function(e){t.destroy()})),this._imController.on("updateStatus",this._updateStatus.bind(this)),this._imController.on("sessionStart",this.setStartSessionTime.bind(this)),this._imController.on("sessionEnd",this.setEndSessionTime.bind(this)),this._imController.on("updateStatistics",(function(e){t._dataReporter.updateStatistics(e)}))),this._dataReporter&&this._dataReporter.on("updateStatistics",(function(e){t._dataReporter.updateStatistics(e)}))}},{key:"destroy",value:function(){this._imController&&(this._imController._resetStatus(),this._imController._nim&&this._imController._nim.protocol&&this._imController._nim.protocol.setCurrentNetcall()),this._wsController&&this._wsController._destroy()}},{key:"getStatus",value:function(){return l.default.deepClone(this._status)}},{key:"setStartSessionTime",value:function(){this._status.startSessionTime=+Date.now(),this._status.endSessionTime=0,this.emit("sessionStart")}},{key:"setEndSessionTime",value:function(){this._status.startSessionTime?(this._status.endSessionTime=+Date.now(),this._status.lastSessionDuation=this._status.endSessionTime-this._status.startSessionTime):this.logger.log("mainController: setEndSessionTime failed: startSessionTime undefined！")}},{key:"setEncryptKey",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this._status.encryptKey=e||""}},{key:"setEncryptType",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(e<0||1===e||e>6)throw new Error("加密算法类型不合法！合法值有：0，2，3，4，5，6");this._status.encryptType=e}}]),t}(c.default);t.default=y,e.exports=t.default},function(e,t,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,e.exports=n(108),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(e){r.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag",u="object"==typeof e,c=t.regeneratorRuntime;if(c)u&&(e.exports=c);else{(c=t.regeneratorRuntime=u?e.exports:{}).wrap=m;var l={},d={};d[o]=function(){return this};var f=Object.getPrototypeOf,p=f&&f(f(w([])));p&&p!==n&&r.call(p,o)&&(d=p);var h=_.prototype=y.prototype=Object.create(d);g.prototype=h.constructor=_,_.constructor=g,_[a]=g.displayName="GeneratorFunction",c.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},c.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,a in e||(e[a]="GeneratorFunction")),e.prototype=Object.create(h),e},c.awrap=function(e){return{__await:e}},b(k.prototype),k.prototype[s]=function(){return this},c.AsyncIterator=k,c.async=function(e,t,n,r){var i=new k(m(e,t,n,r));return c.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(h),h[a]="Generator",h[o]=function(){return this},h.toString=function(){return"[object Generator]"},c.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},c.values=w,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return s.type="throw",s.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:w(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}}}function m(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,o=Object.create(i.prototype),s=new E(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var a=C(s,n);if(a){if(a===l)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=v(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,s),o}function v(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function y(){}function g(){}function _(){}function b(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function k(e){var t;this._invoke=function(n,i){function o(){return new Promise((function(t,o){!function t(n,i,o,s){var a=v(e[n],e,i);if("throw"!==a.type){var u=a.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?Promise.resolve(c.__await).then((function(e){t("next",e,o,s)}),(function(e){t("throw",e,o,s)})):Promise.resolve(c).then((function(e){u.value=e,o(u)}),s)}s(a.arg)}(n,i,t,o)}))}return t=t?t.then(o,o):o()}}function C(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,C(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=v(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function w(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:T}}function T(){return{value:void 0,done:!0}}}(function(){return this}()||Function("return this")())},function(e,t,n){e.exports={default:n(110),__esModule:!0}},function(e,t,n){n(60),n(49),n(56),n(111),n(123),n(124),e.exports=n(2).Promise},function(e,t,n){"use strict";var r,i,o,s,a=n(19),u=n(0),c=n(18),l=n(61),d=n(6),f=n(8),p=n(24),h=n(112),m=n(113),v=n(62),y=n(63).set,g=n(118)(),_=n(44),b=n(64),k=n(119),C=n(65),O=u.TypeError,S=u.process,E=S&&S.versions,w=E&&E.v8||"",T=u.Promise,N="process"==l(S),L=function(){},P=i=_.f,R=!!function(){try{var e=T.resolve(1),t=(e.constructor={})[n(1)("species")]=function(e){e(L,L)};return(N||"function"==typeof PromiseRejectionEvent)&&e.then(L)instanceof t&&0!==w.indexOf("6.6")&&-1===k.indexOf("Chrome/66")}catch(e){}}(),x=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},j=function(e,t){if(!e._n){e._n=!0;var n=e._c;g((function(){for(var r=e._v,i=1==e._s,o=0,s=function(t){var n,o,s,a=i?t.ok:t.fail,u=t.resolve,c=t.reject,l=t.domain;try{a?(i||(2==e._h&&I(e),e._h=1),!0===a?n=r:(l&&l.enter(),n=a(r),l&&(l.exit(),s=!0)),n===t.promise?c(O("Promise-chain cycle")):(o=x(n))?o.call(n,u,c):u(n)):c(r)}catch(e){l&&!s&&l.exit(),c(e)}};n.length>o;)s(n[o++]);e._c=[],e._n=!1,t&&!e._h&&A(e)}))}},A=function(e){y.call(u,(function(){var t,n,r,i=e._v,o=M(e);if(o&&(t=b((function(){N?S.emit("unhandledRejection",i,e):(n=u.onunhandledrejection)?n({promise:e,reason:i}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",i)})),e._h=N||M(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},M=function(e){return 1!==e._h&&0===(e._a||e._c).length},I=function(e){y.call(u,(function(){var t;N?S.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})}))},D=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),j(t,!0))},U=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw O("Promise can't be resolved itself");(t=x(e))?g((function(){var r={_w:n,_d:!1};try{t.call(e,c(U,r,1),c(D,r,1))}catch(e){D.call(r,e)}})):(n._v=e,n._s=1,j(n,!1))}catch(e){D.call({_w:n,_d:!1},e)}}};R||(T=function(e){h(this,T,"Promise","_h"),p(e),r.call(this);try{e(c(U,this,1),c(D,this,1))}catch(e){D.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(120)(T.prototype,{then:function(e,t){var n=P(v(this,T));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=N?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&j(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=c(U,e,1),this.reject=c(D,e,1)},_.f=P=function(e){return e===T||e===s?new o(e):i(e)}),d(d.G+d.W+d.F*!R,{Promise:T}),n(28)(T,"Promise"),n(121)("Promise"),s=n(2).Promise,d(d.S+d.F*!R,"Promise",{reject:function(e){var t=P(this);return(0,t.reject)(e),t.promise}}),d(d.S+d.F*(a||!R),"Promise",{resolve:function(e){return C(a&&this===s?T:this,e)}}),d(d.S+d.F*!(R&&n(122)((function(e){T.all(e).catch(L)}))),"Promise",{all:function(e){var t=this,n=P(t),r=n.resolve,i=n.reject,o=b((function(){var n=[],o=0,s=1;m(e,!1,(function(e){var a=o++,u=!1;n.push(void 0),s++,t.resolve(e).then((function(e){u||(u=!0,n[a]=e,--s||r(n))}),i)})),--s||r(n)}));return o.e&&i(o.v),n.promise},race:function(e){var t=this,n=P(t),r=n.reject,i=b((function(){m(e,!1,(function(e){t.resolve(e).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(18),i=n(114),o=n(115),s=n(5),a=n(53),u=n(116),c={},l={};(t=e.exports=function(e,t,n,d,f){var p,h,m,v,y=f?function(){return e}:u(e),g=r(n,d,t?2:1),_=0;if("function"!=typeof y)throw TypeError(e+" is not iterable!");if(o(y)){for(p=a(e.length);p>_;_++)if((v=t?g(s(h=e[_])[0],h[1]):g(e[_]))===c||v===l)return v}else for(m=y.call(e);!(h=m.next()).done;)if((v=i(m,g,h.value,t))===c||v===l)return v}).BREAK=c,t.RETURN=l},function(e,t,n){var r=n(5);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,n){var r=n(20),i=n(1)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},function(e,t,n){var r=n(61),i=n(1)("iterator"),o=n(20);e.exports=n(2).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(0),i=n(63).set,o=r.MutationObserver||r.WebKitMutationObserver,s=r.process,a=r.Promise,u="process"==n(21)(s);e.exports=function(){var e,t,n,c=function(){var r,i;for(u&&(r=s.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){s.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(a&&a.resolve){var l=a.resolve(void 0);n=function(){l.then(c)}}else n=function(){i.call(r,c)};else{var d=!0,f=document.createTextNode("");new o(c).observe(f,{characterData:!0}),n=function(){f.data=d=!d}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){var r=n(0).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){var r=n(11);e.exports=function(e,t,n){for(var i in t)n&&e[i]?e[i]=t[i]:r(e,i,t[i]);return e}},function(e,t,n){"use strict";var r=n(0),i=n(2),o=n(7),s=n(9),a=n(1)("species");e.exports=function(e){var t="function"==typeof i[e]?i[e]:r[e];s&&t&&!t[a]&&o.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(1)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],s=o[r]();s.next=function(){return{done:n=!0}},o[r]=function(){return s},e(o)}catch(e){}return n}},function(e,t,n){"use strict";var r=n(6),i=n(2),o=n(0),s=n(62),a=n(65);r(r.P+r.R,"Promise",{finally:function(e){var t=s(this,i.Promise||o.Promise),n="function"==typeof e;return this.then(n?function(n){return a(t,e()).then((function(){return n}))}:e,n?function(n){return a(t,e()).then((function(){throw n}))}:e)}})},function(e,t,n){"use strict";var r=n(6),i=n(44),o=n(64);r(r.S,"Promise",{try:function(e){var t=i.f(this),n=o(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={closeNormal:{code:"0",desc:"wx: normally closed"},connectSocketFail:{code:"401",desc:"wx: connectSocket: fail"},reconnectFail:{code:"403",desc:"wx: maxceed reconnect times"},kicked:{code:"405",desc:"wx: kicked"},roomRefused:{code:"406",desc:"wx: roomRefused"},loginFailed:{code:"417",desc:"wx: login failed cause room destroyed"},loginFailedEncrypt:{code:"418",desc:"wx: login failed cause room no encryption"}},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={connectSocketSuccess:{code:"200",desc:"wx: connectSocket: success"}},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=h(n(3)),i=h(n(4)),o=h(n(14)),s=h(n(17)),a=h(n(22)),u=h(n(23)),c=n(128),l=n(129),d=n(130),f=n(13),p=n(131);function h(e){return e&&e.__esModule?e:{default:e}}var m=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r.default)(this,t);var n=(0,o.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n._reset(),n.$options=e,n._mainStatus=e.mainStatus,n.logger=e.logger,n._resetStatus(),n.logger.log("小程序网关地址: ",e),Object.keys(n._status).forEach((function(t){var r=e[t];null!=r&&(n._status[t]=r)})),n._status.edgeAddr=e.edgeAddr||"59.111.239.249:31101",n}return(0,s.default)(t,e),(0,i.default)(t,[{key:"_resetStatus",value:function(){if(this._status&&(clearInterval(this._status.heartbeatTimer),clearTimeout(this._status.heartbeatOverTimer),this._status.sendCommandTimerMap&&0!==Object.keys(this._status.sendCommandTimerMap).length))for(var e in this._status.sendCommandTimerMap)clearTimeout(this._status.sendCommandTimerMap[e]);this._status={uid:"",cid:"",accid:"",token:"",address:[],webrtc:1,mode:0,scene:1,usertype:3,liveEnable:0,rtmpRecord:0,rtmpUrl:"",splitMode:"",recordAudio:0,recordVideo:0,recordType:0,isHostSpeaker:0,encryptType:0,encryptKey:"",role:0,seq:1,cmdTasksMap:{},heartbeatTimer:null,heartbeatOverTimer:null,sendCommandTimerMap:{},layout:"",socketStatus:"CLOSED",checkP2PUserTimer:null,edgeAddr:""},this._resolve=null,this._reject=null,this._loginTimer&&clearTimeout(this._loginTimer),this._loginTimer=null}},{key:"_reset",value:function(){this.$options={},this._resetStatus(),this._wsLink=null}},{key:"login",value:function(){var e=this;return new Promise((function(t,n){e.logger.log("建立长链接, url: ",e._status.address),e._reject=n,e._wsLink=wx.connectSocket({url:e._status.address,fail:function(t){e.logger.error("ws connect 动作执行失败： ",f.CONSTANT_ERROR.connectSocketFail.desc),e._status.socketStatus="CLOSED",n(f.CONSTANT_ERROR.connectSocketFail)},success:function(n){e.logger.log("ws connect 动作执行成功"),e._status.socketStatus="OPENING",e._resolve=t},complete:function(t){e.logger.log("ws connect 动作执行完成")}}),e._bindWXSocketEvent(),e._loginTimer=setTimeout((function(){e._reject&&(e.closeSocket(),e._reject("login timeout"))}),6e3)}))}},{key:"logout",value:function(){var e=this,t={uid:this._status.uid,cid:this._status.cid,statistic:{},seq:this._status.seq++};return this.logger.log("ws::logout: ws status "+this._status.socketStatus),Promise.resolve().then((function(){return"LOGIN"===e._status.socketStatus?e.sendCmd("logout",t).then((function(t){return t&&e.logger.log("ws::logout:",t.code),Promise.resolve(t)})):Promise.resolve()})).then((function(){if(!e._wsLink)return e.emit("close"),Promise.resolve();switch(clearInterval(e._status.heartbeatTimer),e._status.socketStatus){case"OPENING":case"OPEN":case"LOGIN":case"CLOSING":return e.closeSocket();case"CLOSED":return e.emit("close"),Promise.resolve()}}))}},{key:"checkP2PUser",value:function(){var e=this;if(0===this._status.scene){this.logger.log("ws::checkP2PUser ...");var t={uid:this._status.uid,cid:this._status.cid,seq:this._status.seq++};clearTimeout(this._status.checkP2PUserTimer),this._status.checkP2PUserTimer=setTimeout((function(){e.sendCmd("getUploadUserList",t).then((function(t){e.logger.log("ws::checkP2PUser:getUser ",t)})).catch((function(t){e.logger.log("ws::checkP2PUser:error ",t),e.emit("hangup")}))}),2e4)}}},{key:"closeSocket",value:function(){var e=this;return new Promise((function(t,n){e.logger.log("ws::close WebSocket starting..."),clearInterval(e._status.heartbeatTimer),clearTimeout(e._status.heartbeatOverTimer),e._wsLink.onOpen=null,e._wsLink.onMessage=null,e._wsLink.close({code:1e3,reason:"ws::user force close websocket",success:function(t){e._status.socketStatus="CLOSING",e.logger.log("ws::close WebSocket force closed success")},fail:function(t){e._status.socketStatus="CLOSING",e.logger.log("ws::close WebSocket force closed fail")},complete:function(){e.emit("close"),t()}})}))}},{key:"publish",value:function(e){var t=this;return new Promise((function(n,r){t.sendCmd("publish",{mediaType:e,uid:t._status.uid,cid:t._status.cid,status:"open"}).then((function(e){200===e.code?n():r(e)}))}))}},{key:"unpublish",value:function(e){var t=this;return new Promise((function(n,r){t.sendCmd("unpublish",{mediaType:e,uid:t._status.uid,cid:t._status.cid,status:"close"}).then((function(e){200===e.code?n():r(e)}))}))}},{key:"subscribe",value:function(e,t){var n=this;return new Promise((function(r,i){n.sendCmd("subscribe",{mediaType:t,uid:n._status.uid,srcUid:e,cid:n._status.cid,sub:!0}).then((function(e){console.log("订阅返回结果：",e),200===e.code?r():i(e)}))}))}},{key:"unsubscribe",value:function(e,t){var n=this;return new Promise((function(r,i){n.sendCmd("unsubscribe",{mediaType:t,uid:n._status.uid,srcUid:e,cid:n._status.cid,sub:!1}).then((function(e){200===e.code?r():i(e)}))}))}},{key:"mute",value:function(e,t){var n=this;return new Promise((function(r,i){n.sendCmd("mute",{uid:e||n._status.uid,mediaType:t,cid:n._status.cid,mute:!0}).then((function(e){200===e.code?r():i(e)}))}))}},{key:"unmute",value:function(e,t){var n=this;return new Promise((function(r,i){n.sendCmd("unmute",{uid:e||n._status.uid,mediaType:t,cid:n._status.cid,mute:!1}).then((function(e){200===e.code?r():i(e)}))}))}},{key:"updatePushMode",value:function(e){var t=this;return this._status.mode=e,new Promise((function(e,n){t.sendCmd("updatePushMode",t._status).then((function(t){200===t.code?e():n(t)}))}))}},{key:"startHeartbeat",value:function(){var e=this;this._status.heartbeatTimer=setInterval((function(){if(!e._status.heartbeatOverTimer){var t=Date.now();e._status.heartbeatOverTimer=setTimeout((function(){e.logger.log("ws::heartbeating: overtime:",(new Date).toString()),e.emit("heartbeatOverTime",{lastTime:t})}),p.Config.heartbeatOverTime)}return e.sendCmd("heartbeat",e._status)}),p.Config.heartbeatInterval)}},{key:"getUploadUserList",value:function(){var e=this;return new Promise((function(t,n){e.sendCmd("getUploadUserList",e._status).then((function(e){200===e.code?t(e):n(e)}))}))}},{key:"_judgeRoleAndSave",value:function(e){var t=this,n=u.default.deepClone(e);return 1===this._mainStatus.role&&n.userlist.map((function(e){e.uid===t._status.uid&&(t._mainStatus.rtmpPushAddress=e.url,e.url=null)})),n}},{key:"_bindWXSocketEvent",value:function(){var e=this;this._wsLink.onOpen((function(t){e._status.socketStatus="OPEN",e._status.newprotocol=2,e.emit("open",f.CONSTANT_SOCKET.connectSocketSuccess),e.logger.log("开始登录小程序网关: ",e._status),e.sendCmd("login",e._status).then((function(t){e.logger.log("ws::onlogin ",t),e._status.socketStatus="LOGIN",e.startHeartbeat(),e.checkP2PUser(),e.emit("syncDone",e._judgeRoleAndSave(t)),e._resolve&&(e._resolve(),e._loginTimer&&clearTimeout(e._loginTimer),e._loginTimer=null)})).catch((function(t){e.emit("error",{code:t.code,desc:"登录失败"})}))})),this._wsLink.onError((function(t){e.logger.log("ws::onerror ",t),e.emit("error",t)})),this._wsLink.onClose((function(t){e._status.socketStatus="CLOSED",e.logger.log("ws::onclose ",t),e.emit("close",t),e._reset()})),this._wsLink.onMessage((function(t){var n=t.data;if("onHeartbeat"!==(n=(0,d.parsePacket)(n)).cmd&&e.logger.log("ws::onmessage",n),n.seq){var r=e._status.cmdTasksMap[n.seq];r&&(delete e._status.cmdTasksMap[n.seq],200===n.body.code?r.resolve(n.body):r.reject(n.body))}e[n.cmd]&&e[n.cmd](n),0!==Object.keys(e._status.sendCommandTimerMap).length&&(clearTimeout(e._status.sendCommandTimerMap[n.seq]),delete e._status.sendCommandTimerMap[n.seq])}))}},{key:"sendCmd",value:function(e,t){var n=this;if("heartbeat"===e){var r=(0,d.genPacket)(e,t,this._status.seq++);return this._wsLink.send({data:r}),Promise.resolve()}var i=setTimeout((function(){n.logger.log("oops! ws::sendCmd timmout"),n.emit("sendCommandOverTime",{cmd:e})}),p.Config.sendCommandOverTime);return this._status.sendCommandTimerMap[this._status.seq]=i,new Promise((function(r,i){"logout"===e&&setTimeout((function(){r()}),300),n._status.cmdTasksMap[n._status.seq]={resolve:r,reject:i};var o=(0,d.genPacket)(e,t,n._status.seq++);n.logger.log("小程序ws::sendCmd ",o);try{n._wsLink.send({data:o})}catch(e){n.logger.error("小程序ws::信令发送失败")}}))}}]),t}(a.default);(0,c.apiMixin)(m),(0,l.messageMixin)(m),t.default=m,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.apiMixin=function(e){e.prototype}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.messageMixin=function(e){var t=e.prototype;t.onClientLeave=function(e){this.emit("clientLeave",e.body)},t.onClientJoin=function(e){this.emit("clientJoin",e.body)},t.onClientMute=function(e){this.emit("clientMute",e.body)},t.onClientUpdate=function(e){this.emit("clientUpdate",e)},t.onUpdatePushMode=function(e){this.emit("updatePushMode",e)},t.onLiveRoomClose=function(e){this.emit("liveRoomClose",e)},t.onKicked=function(e){this.emit("kicked",e)},t.onRoomRefused=function(e){this.emit("roomRefused",e)},t.clientPublished=function(e){this.emit("clientPublished",e)},t.onHeartbeat=function(e){clearTimeout(this._status.heartbeatOverTimer),this._status.heartbeatOverTimer=null}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genPacket=function(e,t,n){var i=r[e];if(i){var o={cmd:i.cmd,body:{},seq:n},s=Object.assign({},o);return i.body.forEach((function(e){(t[e.key]||0===t[e.key])&&(s.body[e.key]=t[e.key])})),JSON.stringify(s)}},t.parsePacket=function(e){var t=JSON.parse(e);return t.cmd=i[t.cmd].cmd,t};var r={login:{cmd:0,body:[{key:"accid",type:"String"},{key:"uid",type:"Number"},{key:"cid",type:"String"},{key:"accid",type:"Number"},{key:"token",type:"String"},{key:"mode",type:"Number"},{key:"scene",type:"Number"},{key:"usertype",type:"Number"},{key:"liveEnable",type:"Number"},{key:"webrtc",type:"Number"},{key:"recordAudio",type:"Number"},{key:"recordVideo",type:"Number"},{key:"rtmpRecord",type:"Number"},{key:"rtmpUrl",type:"String"},{key:"splitMode",type:"Number"},{key:"layout",type:"Boolean"},{key:"recordType",type:"String"},{key:"role",type:"Number"},{key:"isHostSpeaker",type:"Number"},{key:"encryptType",type:"Number"},{key:"encryptKey",type:"String"},{key:"edgeAddr",type:"String"},{key:"newprotocol",type:"Number"}]},heartbeat:{cmd:2,body:[{key:"uid",type:"Number"},{key:"cid",type:"String"},{key:"statistic",type:"Object"}]},logout:{cmd:4,body:[{key:"uid",type:"Number"},{key:"cid",type:"String"},{key:"statistic",type:"Object"}]},publish:{cmd:10,body:[{key:"uid",type:"Number"},{key:"cid",type:"String"},{key:"mediaType",type:"String"},{key:"status",type:"String"}]},unpublish:{cmd:10,body:[{key:"uid",type:"Number"},{key:"cid",type:"String"},{key:"mediaType",type:"String"},{key:"status",type:"String"}]},subscribe:{cmd:16,body:[{key:"uid",type:"Number"},{key:"cid",type:"String"},{key:"srcUid",type:"String"},{key:"mediaType",type:"String"},{key:"sub",type:"Boolean"}]},unsubscribe:{cmd:16,body:[{key:"uid",type:"Number"},{key:"cid",type:"String"},{key:"srcUid",type:"String"},{key:"mediaType",type:"String"},{key:"sub",type:"Boolean"}]},mute:{cmd:11,body:[{key:"uid",type:"Number"},{key:"cid",type:"String"},{key:"mediaType",type:"String"},{key:"mute",type:"Boolean"}]},unmute:{cmd:11,body:[{key:"uid",type:"Number"},{key:"cid",type:"String"},{key:"mediaType",type:"String"},{key:"mute",type:"Boolean"}]},getUploadUserList:{cmd:5,body:[{key:"uid",type:"Number"},{key:"cid",type:"Number"}]},updatePushMode:{cmd:7,body:[{key:"uid",type:"Number"},{key:"cid",type:"Number"},{key:"mode",type:"Number"}]}},i={1:{cmd:"onLogin",body:[{key:"code"},{key:"errmsg"},{key:"userlist"}]},3:{cmd:"onHeartbeat",body:[{key:"code"},{key:"errmsg"},{key:"userlist"}]},6:{cmd:"onUploadUserList",body:[{key:"code"},{key:"errmsg"},{key:"userlist"}]},8:{cmd:"onUpdatePushMode",body:[{key:"code"},{key:"errmsg"}]},9:{cmd:"onLogout",body:[{key:"code"}]},14:{cmd:"onPublishOrUnpublish",body:[{key:"code"},{key:"errmsg"},{key:"cid"},{key:"uid"}]},15:{cmd:"onClientMute",body:[{key:"mediaType"},{key:"mute"},{key:"cid"},{key:"uid"}]},20:{cmd:"onClientJoin",body:[{key:"uid"},{key:"accid"},{key:"cid"},{key:"url"},{key:"mode"}]},21:{cmd:"onClientLeave",body:[{key:"uid"},{key:"accid"},{key:"cid"}]},22:{cmd:"onClientUpdate",body:[{key:"uid"},{key:"accid"},{key:"cid"},{key:"mode"}]},23:{cmd:"onLiveRoomClose",body:[{key:"cid"},{key:"reason"}]},24:{cmd:"onKicked",body:[{key:"cid"},{key:"reason"}]},25:{cmd:"onRoomRefused",body:[{key:"cid"},{key:"reason"}]},26:{cmd:"clientPublished",body:[{key:"uid"},{key:"accid"},{key:"cid"},{key:"mediaType"},{key:"status"}]}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Config={heartbeatInterval:3e3,heartbeatOverTime:1e4,sendCommandOverTime:1e4}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(3)),i=u(n(4)),o=u(n(14)),s=u(n(17)),a=u(n(22));function u(e){return e&&e.__esModule?e:{default:e}}var c=n(45).webrtcG2Version,l=function(e){function t(){(0,r.default)(this,t);var e=(0,o.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._statisticsServer="",e._initStatistics(),e}return(0,s.default)(t,e),(0,i.default)(t,[{key:"_initStatistics",value:function(){this._statistics={ver:1,time:null,sdk_ver:c||"v4.0.0",platform:"miniapp",uid:null,cid:null,appkey:null,P2P:{value:0},meeting:{value:0},always_keep_calling:{value:0},miniapp_mode:null}}},{key:"updateStatisticsServer",value:function(e){console.warn("updateStatisticsServer: ",e),this._statisticsServer=e}},{key:"updateStatistics",value:function(e){Object.assign(this._statistics,e),this.sendStatistics()}},{key:"sendStatistics",value:function(){var e=this;Object.assign(this._statistics,{time:+new Date});var t="https://statistic.live.126.net/statistic/realtime/sdkFunctioninfo";console.warn("_statisticsServer: ",this._statisticsServer),this._statisticsServer&&(t=this._statisticsServer),wx.request({url:t,method:"POST",data:t,header:{"content-type":"application/json"},complete:function(){e._initStatistics()}})}}]),t}(a.default);t.default=l,e.exports=t.default},function(e,t,n){"use strict";var r=n(134),i=n(69),o=(n(139),n(147));function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i.merge(this,{options:e,debug:!1,api:"log",style:"color:#1cb977;",log:i.emptyFunc,info:i.emptyFunc,warn:i.emptyFunc,error:i.emptyFunc}),this.prefix=e.prefix||"",this.setDebug(e.debug),e.isSavedLogs&&(this.logHelper=new o(e))}var a=s.prototype,u=["Chrome","Safari","Firefox"];a.setDebug=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;if(t.debug=e,e.style&&(t.style=e.style),t.debug&&i.exist(console)){var n=console;t.debug=function(){this.logHelper&&this.logHelper.log(arguments);var e=t.formatArgs(arguments);-1!==u.indexOf(r.name)&&i.isString(e[0])&&(e[0]="%c"+e[0],e.splice(1,0,t.style)),t._log("debug",e)},t.log=function(){this.logHelper&&this.logHelper.log(arguments);var e=t.formatArgs(arguments);-1!==u.indexOf(r.name)&&i.isString(e[0])&&(e[0]="%c"+e[0],e.splice(1,0,t.style)),t._log("log",e)},t.info=function(){this.logHelper&&this.logHelper.log(arguments);var e=t.formatArgs(arguments);-1!==u.indexOf(r.name)&&i.isString(e[0])&&(e[0]="%c"+e[0],e.splice(1,0,t.style)),t._log("info",e)},t.warn=function(){this.logHelper&&this.logHelper.log(arguments);var e=t.formatArgs(arguments);-1!==u.indexOf(r.name)&&i.isString(e[0])&&(e[0]="%c"+e[0],e.splice(1,0,t.style)),t._log("warn",e)},t.error=function(){this.logHelper&&this.logHelper.log(arguments);var e=t.formatArgs(arguments);-1!==u.indexOf(r.name)&&i.isString(e[0])&&(e[0]="%c"+e[0],e.splice(1,0,t.style)),t._log("error",e)},t._log=function(e,r){var o=t.options.logFunc,s=null;if(o&&(o[e]&&(s=o[e]),i.isFunction(s)))s.apply(o,r);else if(n[e])try{n[e].apply?t.chrome(e,r):t.ie(e,r)}catch(e){}},t.chrome=function(e,i){-1!==u.indexOf(r.name)?n[e].apply(n,i):t.ie(e,i)},t.ie=function(e,t){t.forEach((function(t){n[e](JSON.stringify(t,null,4))}))}}},a.formatArgs=function(e){e=[].slice.call(e,0);var t=new Date,n="[LOG "+(c(t.getMonth()+1)+"-"+c(t.getDate())+" "+c(t.getHours())+":"+c(t.getMinutes())+":"+c(t.getSeconds())+":"+c(t.getMilliseconds(),3))+" "+this.prefix.toUpperCase()+"]  ";return i.isString(e[0])?e[0]=n+e[0]:e.splice(0,0,n),e.forEach((function(t,n){(i.isArray(t)||i.isObject(t))&&(e[n]=i.simpleClone(t))})),e};var c=function(e,t){t=t||2;for(var n=""+e;n.length<t;)n="0"+n;return n};e.exports=s},function(e,t,n){"use strict";e.exports={description:"weixin micro app",layout:null,manufacturer:null,name:"weixin",prerelease:null,product:null,ua:"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko) Weixin/1.9.1",version:"1.9.1",os:{architecture:64,family:"Windows",version:"1.9.1"}}},function(e,t){e.exports=function e(t,n){"use strict";var r,i,o=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,s=/(^[ ]*|[ ]*$)/g,a=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,u=/^0x[0-9a-f]+$/i,c=/^0/,l=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},d=l(t).replace(s,"")||"",f=l(n).replace(s,"")||"",p=d.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=f.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=parseInt(d.match(u),16)||1!==p.length&&d.match(a)&&Date.parse(d),v=parseInt(f.match(u),16)||m&&f.match(a)&&Date.parse(f)||null;if(v){if(m<v)return-1;if(m>v)return 1}for(var y=0,g=Math.max(p.length,h.length);y<g;y++){if(r=!(p[y]||"").match(c)&&parseFloat(p[y])||p[y]||0,i=!(h[y]||"").match(c)&&parseFloat(h[y])||h[y]||0,isNaN(r)!==isNaN(i))return isNaN(r)?1:-1;if(typeof r!=typeof i&&(r+="",i+=""),r<i)return-1;if(r>i)return 1}return 0}},function(e,t){e.exports=function(e,t){var n=t.split(".");for(;n.length;){var r=n.shift(),i=!1;if("?"==r[r.length-1]&&(r=r.slice(0,-1),i=!0),!(e=e[r])&&i)return e}return e}},function(e,t,n){"use strict";var r=n(46);"undefined"!=typeof window&&(window.console||r.isWeixinApp||(window.console={log:function(){},info:function(){},warn:function(){},error:function(){}}))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r=n(29),i=n(144),o=n(145),s=n(146);r.json=i,r.upload=o,r.chunkUpload=s,e.exports=r},function(e,t,n){"use strict";var r=n(10),i=n(47);function o(e){e.onuploading&&this.on("uploading",e.onuploading),i.call(this,e)}var s=i.prototype,a=o.prototype=Object.create(s);a.doSend=function(){var e=this.options,t=e.headers,n=this.xhr=new XMLHttpRequest;if("multipart/form-data"===t["Content-Type"]){delete t["Content-Type"],n.upload.onprogress=this.onProgress.bind(this),n.upload.onload=this.onProgress.bind(this);var i=e.data;e.data=new window.FormData,i&&r.getKeys(i,e.putFileAtEnd).forEach((function(t){var n=i[t];n.tagName&&"INPUT"===n.tagName.toUpperCase()?"file"===n.type&&[].forEach.call(n.files,(function(t){e.data.append(r.dataset(n,"name")||n.name||t.name||"file-"+r.uniqueID(),t)})):e.data.append(t,n)}))}else t["x-nos-token"]&&(n.upload.onprogress=this.onProgress.bind(this),n.upload.onload=this.onProgress.bind(this));n.onreadystatechange=this.onStateChange.bind(this),0!==e.timeout&&(this.timer=setTimeout(this.onTimeout.bind(this),e.timeout)),n.open(e.method,e.url,!e.sync),Object.keys(t).forEach((function(e){n.setRequestHeader(e,t[e])})),e.cookie&&"withCredentials"in n&&(n.withCredentials=!0),n.send(e.data),this.afterSend()},a.onProgress=function(e){e.lengthComputable&&e.loaded<=e.total&&this.emit("uploading",e)},a.onStateChange=function(){var e=this.xhr;4===e.readyState&&this.onLoad({status:e.status,result:e.responseText||""})},a.getResponseHeader=function(e){var t=this.xhr;return t?t.getResponseHeader(e):""},a.destroy=function(){clearTimeout(this.timer);try{this.xhr.onreadystatechange=r.f,this.xhr.abort()}catch(e){console.log("error:","ignore error ajax destroy,",e)}s.destroy.call(this)},e.exports=o},function(e,t,n){var r;
  /*!
   * EventEmitter v5.2.9 - git.io/ee
   * Unlicense - http://unlicense.org/
   * Oliver Caldwell - https://oli.me.uk/
   * @preserve
   */!function(t){"use strict";function i(){}var o=i.prototype,s=t.EventEmitter;function a(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function u(e){return function(){return this[e].apply(this,arguments)}}o.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp)for(n in t={},r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n]);else t=r[e]||(r[e]=[]);return t},o.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},o.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&((t={})[e]=n),t||n},o.addListener=function(e,t){if(!function e(t){return"function"==typeof t||t instanceof RegExp||!(!t||"object"!=typeof t)&&e(t.listener)}(t))throw new TypeError("listener must be a function");var n,r=this.getListenersAsObject(e),i="object"==typeof t;for(n in r)r.hasOwnProperty(n)&&-1===a(r[n],t)&&r[n].push(i?t:{listener:t,once:!1});return this},o.on=u("addListener"),o.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},o.once=u("addOnceListener"),o.defineEvent=function(e){return this.getListeners(e),this},o.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},o.removeListener=function(e,t){var n,r,i=this.getListenersAsObject(e);for(r in i)i.hasOwnProperty(r)&&-1!==(n=a(i[r],t))&&i[r].splice(n,1);return this},o.off=u("removeListener"),o.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},o.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},o.manipulateListeners=function(e,t,n){var r,i,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(r=n.length;r--;)o.call(this,t,n[r]);else for(r in t)t.hasOwnProperty(r)&&(i=t[r])&&("function"==typeof i?o.call(this,r,i):s.call(this,r,i));return this},o.removeEvent=function(e){var t,n=typeof e,r=this._getEvents();if("string"===n)delete r[e];else if(e instanceof RegExp)for(t in r)r.hasOwnProperty(t)&&e.test(t)&&delete r[t];else delete this._events;return this},o.removeAllListeners=u("removeEvent"),o.emitEvent=function(e,t){var n,r,i,o,s=this.getListenersAsObject(e);for(o in s)if(s.hasOwnProperty(o))for(n=s[o].slice(0),i=0;i<n.length;i++)!0===(r=n[i]).once&&this.removeListener(e,r.listener),r.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,r.listener);return this},o.trigger=u("emitEvent"),o.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},o.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},o._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},o._getEvents=function(){return this._events||(this._events={})},i.noConflict=function(){return t.EventEmitter=s,i},void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}("undefined"!=typeof window?window:this||{})},function(e,t,n){"use strict";var r=n(10),i=n(47),o=n(70),s="NEJ-UPLOAD-RESULT:",a={};function u(e){this.init(),i.call(this,e)}var c=i.prototype,l=u.prototype=Object.create(c);l.init=function(){var e=!1;function t(e){var t=e.data;if(0===t.indexOf(s)){var n=(t=JSON.parse(t.replace(s,""))).key,r=a[n];r&&(delete a[n],t.result=decodeURIComponent(t.result||""),r.onLoad(t.result))}}return function(){!function(){if(!e){e=!0;var n=r.getGlobal();n.postMessage?r.on(n,"message",t):(o.addMsgListener(t),o.startTimer())}}()}}(),l.doSend=function(){var e=this,t=e.options,n=e.key="zoro-ajax-upload-iframe-"+r.uniqueID();a[n]=e;var i=e.form=r.html2node('<form style="display:none;"></form>');"undefined"==typeof document?console.log("error: document is undefined"):document.body.appendChild(i),i.target=n,i.method="POST",i.enctype="multipart/form-data",i.encoding="multipart/form-data";var o=t.url,s=r.genUrlSep(o);i.action=o+s+"_proxy_=form";var u=t.data,c=[],l=[];function d(){c.forEach((function(e,t){var n=l[t];n.parentNode&&(e.name=n.name,r.isFunction(e.setAttribute)&&e.setAttribute("form",n.getAttribute("form")),n.parentNode.replaceChild(e,n))}))}u&&r.getKeys(u,t.putFileAtEnd).forEach((function(e){var t=u[e];if(t.tagName&&"INPUT"===t.tagName.toUpperCase()){if("file"===t.type){var n=t,o=n.cloneNode(!0);n.parentNode.insertBefore(o,n);var s=r.dataset(n,"name");s&&(n.name=s),i.appendChild(n),r.isFunction(n.setAttribute)&&(n.setAttribute("form",""),n.removeAttribute("form")),c.push(t),l.push(o)}}else{var a=r.html2node('<input type="hidden"/>');a.name=e,a.value=t,i.appendChild(a)}}));var f=e.iframe=r.createIframe({name:n,onload:function(){e.aborted?d():(r.on(f,"load",e.checkResult.bind(e)),i.submit(),d(),e.afterSend())}})},l.checkResult=function(){var e,t;try{if((t=((e=this.iframe.contentWindow.document.body).innerText||e.textContent||"").trim()).indexOf(s)>=0||e.innerHTML.indexOf(s)>=0)return}catch(e){return void console.log("error:","ignore error if not same domain,",e)}this.onLoad(t)},l.onLoad=function(e){c.onLoad.call(this,{status:200,result:e}),r.remove(this.form),r.remove(this.iframe),c.destroy.call(this)},l.destroy=function(){r.remove(this.iframe),r.remove(this.form)},l.abort=function(){this.aborted=!0,delete a[this.key],c.abort.call(this)},e.exports=u},function(e,t,n){"use strict";var r=n(10),i=n(70),o=n(47),s={};function a(e){this.init(),o.call(this,e)}var u=o.prototype,c=a.prototype=Object.create(u);c.init=function(){var e="NEJ-AJAX-DATA:",t=!1;function n(t){var n=t.data;if(0===n.indexOf(e)){var r=(n=JSON.parse(n.replace(e,""))).key,i=s[r];i&&(delete s[r],n.result=decodeURIComponent(n.result||""),i.onLoad(n))}}return function(){!function(){if(!t){t=!0;var e=r.getGlobal();e.postMessage?r.on(e,"message",n):i.addMsgListener(n)}}()}}(),c.doSend=function(){var e=this.options,t=r.url2origin(e.url),n=e.proxyUrl||t+"/res/nej_proxy_frame.html",o=s[n];if(r.isArray(o))o.push(this.doSend.bind(this,e));else{if(!o)return s[n]=[this.doSend.bind(this,e)],void r.createIframe({src:n,onload:function(e){var t=s[n];s[n]=r.target(e).contentWindow,t.forEach((function(e){try{e()}catch(e){console.log("error:",e)}}))}});if(!this.aborted){var a=this.key=r.uniqueID();s[a]=this;var u=r.fetch({method:"GET",url:"",data:null,headers:{},timeout:0},e);u.key=a,i.postMessage(o,{data:u}),this.afterSend()}}},c.abort=function(){this.aborted=!0,delete s[this.key],u.abort.call(this)},e.exports=a},function(e,t,n){"use strict";var r,i,o=n(10),s=n(29),a=(r=/json/i,i=/post/i,function(e,t){var n=(t=t||{}).data=t.data||{},a=t.headers=t.headers||{},u=o.checkWithDefault(a,"Accept","application/json"),c=o.checkWithDefault(a,"Content-Type","application/json");return r.test(u)&&(t.type="json"),i.test(t.method)&&r.test(c)&&(t.data=JSON.stringify(n)),s(e,t)});e.exports=a},function(e,t,n){"use strict";var r=n(29);e.exports=function(e,t){return t.method="POST",t.headers=t.headers||{},t.headers["Content-Type"]="multipart/form-data",t.timeout=0,t.type=t.type||"json",r(e,t)}},function(e,t,n){"use strict";var r=n(46),i=r.chunkSize,o=(n(69),n(29));e.exports=function(e,t,n){var s={file:e.data[t],fileSize:e.data[t].size,fileUoloadedSize:0,percentage:0};function a(t){var n=s.fileUoloadedSize+t.loaded,r=Math.floor(1e4*n/s.fileSize)/100;if(parseInt(r)>=100&&(r=100,a=function(){}),s.percentage!==r){s.percentage=r;var i={docId:e.docId,total:s.fileSize,loaded:n,percentage:r,percentageText:r+"%"};e.fileInput&&(i.fileInput=e.fileInput),e.blob&&(i.blob=e.blob),e.uploadprogress(i)}}function u(t){try{t=JSON.parse(t)}catch(e){return void n.onError(e)}if(t.errMsg||t.errCode)n.onError(t);else if(t.offset<s.fileSize)delete l.onaftersend,s.fileUoloadedSize=t.offset,n.sn=function(e,t,n,r,s){var l=t.offset,d=t.offset+i;return n.data=s.file.slice(l,d),n.query.offset=t.offset,n.query.complete=d>=s.fileSize,n.query.context=t.context,n.onuploading=a,n.onload=u,n.onerror=c,o(e,n)}(e.url,t,l,0,s);else{var d=function(e){n.onError(e)},f=r.genFileUrl(e.nosToken);"image"===e.type?o(f+"?imageInfo",{onload:function(n){try{n=JSON.parse(n),e.uploaddone(null,{docId:t.docId,w:n.Width,h:n.Height,orientation:n.Orientation||"",type:n.Type,size:n.Size||s.fileSize})}catch(e){d(e)}},onerror:d}):"video"===e.type||"audio"===e.type?o(f+"?vinfo",{onload:function(n){try{(n=JSON.parse(n)).GetVideoInfo&&n.GetVideoInfo.VideoInfo&&(n=n.GetVideoInfo.VideoInfo),e.uploaddone(null,{docId:t.docId,w:n.Width,h:n.Height,dur:n.Duration,orientation:n.Rotate,audioCodec:n.AudioCodec,videoCodec:n.VideoCodec,container:n.Container,size:n.Size||s.fileSize})}catch(e){d(e)}},onerror:d}):e.uploaddone(null,{docId:t.docId,size:s.fileSize})}}function c(e){try{if(e.result)var t=JSON.parse(e.result);else t=e;n.onError(t)}catch(e){n.onError(e)}}var l={query:{offset:0,complete:i>=s.fileSize,version:"1.0"},headers:{"Content-Type":"application/x-www-form-urlencoded","x-nos-token":e.nosToken.token},method:"POST",timeout:0,onaftersend:function(){e.beginupload(n)},onuploading:a,onload:u,onerror:c};return l.data=s.file.slice(0,i),o(e.url,l)}},function(e,t,n){"use strict";var r,i=n(15),o=(r=i)&&r.__esModule?r:{default:r};e.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this;if(e.maxLogsLines&&"number"==typeof e.maxLogsLines&&!isNaN(e.maxLogsLines)||(e.maxLogsLines=5e3),e.logFilename&&(e.logFilename=e.logFilename+".txt"),t.useTimestamps=e.useTimestamps||!1,t.useLocalStorage=e.useLocalStorage||!1,t.autoTrim=!0,t.maxLines=e.maxLogsLines||5e3,t.tailNumLines=100,t.logFilename=e.logFilename||"nimWebRtcLog.txt",t.maxDepth=5,t.depth=0,t.parentSizes=[0],t.currentResult="",t.startTime=new Date,t.output="",this.getLog=function(){var e=new Date;if(t.useLocalStorage){var n=window.localStorage.getItem("nimWebRtcLog");n&&(n=JSON.parse(n),t.startTime=new Date(n.startTime),t.output=n.log,e=new Date(n.lastLog))}return t.output+"\n---- Log retrieved: "+e+" ----\n"+t.formatSessionDuration(t.startTime,e)},this.tail=function(e){e=e||t.tailLines;return t.trimLog(t.getLog(),e)},this.search=function(e){for(var n=t.output.split("\n"),r=new RegExp(e),i=[],o=0;o<n.length;o++){var s="["+o+"] ";n[o].match(r)&&i.push(s+n[o])}var a=i.join("\n");return 0==a.length&&(a='Nothing found for "'+e+'".'),a},this.getSlice=function(e,n){return t.output.split("\n").slice(e,e+n).join("\n")},this.downloadLog=function(){var e=t.getLog(),n=new Blob([e],{type:"data:text/plain;charset=utf-8"}),r=document.createElement("a");r.href=window.URL.createObjectURL(n),r.target="_blank",r.download=t.logFilename,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(r.href)},this.clear=function(){var e=new Date;if(t.output="---- Log cleared: "+e+" ----\n",t.useLocalStorage){var n={startTime:t.startTime,log:t.output,lastLog:e};n=JSON.stringify(n),window.localStorage.setItem("nimWebRtcLog",n)}},this.log=function(e){var n=t.determineType(e);if(null!=n){var r=t.formatType(n,e);if(t.useTimestamps){var i=new Date;t.output+=t.formatTimestamp(i)}if(t.output+=r+"\n",t.autoTrim&&(t.output=t.trimLog(t.output,t.maxLines)),t.useLocalStorage){var o=new Date,s={startTime:t.startTime,log:t.output,lastLog:o};s=JSON.stringify(s),window.localStorage.setItem("nimWebRtcLog",s)}}t.depth=0,t.parentSizes=[0],t.currentResult=""},this.determineType=function(e){if(null!=e){var t,n=void 0===e?"undefined":(0,o.default)(e);if("object"==n)t=null==e.length?"function"==typeof e.getTime?"Date":"function"==typeof e.test?"RegExp":"Object":"Array";else t=n;return t}return null},this.formatType=function(e,n){if(t.maxDepth&&t.depth>=t.maxDepth)return"... (max-depth reached)";switch(e){case"Object":t.currentResult+="{\n",t.depth++,t.parentSizes.push(t.objectSize(n));var r=0;for(var i in n){t.currentResult+=t.indentsForDepth(t.depth),t.currentResult+=i+": ";var o=t.determineType(n[i]);(s=t.formatType(o,n[i]))?("function"!==o&&(t.currentResult+=s),r!=t.parentSizes[t.depth]-1&&(t.currentResult+=","),t.currentResult+="\n"):(r!=t.parentSizes[t.depth]-1&&(t.currentResult+=","),t.currentResult+="\n"),r++}if(t.depth--,t.parentSizes.pop(),t.currentResult+=t.indentsForDepth(t.depth),t.currentResult+="}",0==t.depth)return t.currentResult;break;case"Array":t.currentResult+="[",t.depth++,t.parentSizes.push(n.length);for(r=0;r<n.length;r++){var s;"Object"!=(o=t.determineType(n[r]))&&"Array"!=o||(t.currentResult+="\n"+t.indentsForDepth(t.depth)),(s=t.formatType(o,n[r]))?(t.currentResult+=s,r!=t.parentSizes[t.depth]-1&&(t.currentResult+=", "),"Array"==o&&(t.currentResult+="\n")):(r!=t.parentSizes[t.depth]-1&&(t.currentResult+=", "),("Object"!=o||r==t.parentSizes[t.depth]-1)&&(t.currentResult+="\n"))}if(t.depth--,t.parentSizes.pop(),t.currentResult+="]",0==t.depth)return t.currentResult;break;case"function":var a=(n+="").split("\n");for(r=0;r<a.length;r++)a[r].match(/\}/)&&t.depth--,t.currentResult+=t.indentsForDepth(t.depth),a[r].match(/\{/)&&t.depth++,t.currentResult+=a[r]+"\n";return t.currentResult;case"RegExp":return"/"+n.source+"/";case"Date":case"string":return t.depth>0||0==n.length?'"'+n+'"':n;case"boolean":return n?"true":"false";case"number":return n+""}},this.indentsForDepth=function(e){for(var t="",n=0;n<e;n++)t+="\t";return t},this.trimLog=function(e,t){var n=e.split("\n");return n.length>t&&(n=n.slice(n.length-t)),n.join("\n")},this.lines=function(){return t.output.split("\n").length},this.formatSessionDuration=function(e,t){var n=t-e,r=Math.floor(n/1e3/60/60),i=("0"+r).slice(-2);n-=1e3*r*60*60;var o=Math.floor(n/1e3/60),s=("0"+o).slice(-2);n-=1e3*o*60;var a=Math.floor(n/1e3);return n-=1e3*a,"---- Session duration: "+i+":"+s+":"+("0"+a).slice(-2)+" ----"},this.formatTimestamp=function(e){var t=e.getFullYear(),n=e.getDate();return"["+t+"-"+("0"+(e.getMonth()+1)).slice(-2)+"-"+n+" "+Number(e.getHours())+":"+("0"+e.getMinutes()).slice(-2)+":"+("0"+e.getSeconds()).slice(-2)+"]: "},this.objectSize=function(e){var t,n=0;for(t in e)e.hasOwnProperty&&e.hasOwnProperty(t)&&n++;return n},t.useLocalStorage){var n=window.localStorage.getItem("nimWebRtcLog");if(n){n=JSON.parse(n),t.output=n.log;var r=new Date(n.startTime),i=new Date(n.lastLog);t.output+="\n---- Session end: "+n.lastLog+" ----\n",t.output+=t.formatSessionDuration(r,i),t.output+="\n\n"}}t.output+="---- Session started: "+t.startTime+" ----\n\n"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(149),o=(r=i)&&r.__esModule?r:{default:r};var s={install:function(e){var t=e.fn,n=e.util;t.initNetcall=function(e){return n.verifyOptions(e,"type accounts","netcall::initNetcall"),e.pushContent="",e.custom="",e.pushConfig||(e.pushConfig={}),e.pushConfig.webrtcEnable=e.webrtcEnable,e.pushConfig=new o.default(e.pushConfig),this.cbAndSendCmd("initNetcall",e)},t.keepCalling=function(e){return n.verifyOptions(e,"type accounts channelId","netcall::keepCalling"),this.cbAndSendCmd("keepCalling",e)},t.calleeAck=function(e){return n.verifyOptions(e,"account channelId type accepted","netcall::calleeAck"),this.cbAndSendCmd("calleeAck",e)},t.hangup=function(e){return n.verifyOptions(e,"channelId","netcall::hangup"),this.cbAndSendCmd("hangup",e)},t.netcallControl=function(e){return n.verifyOptions(e,"channelId type","netcall::netcallControl"),this.cbAndSendCmd("netcallControl",e)},t.createChannel=function(e){return this.cbAndSendCmd("createChannel",e)},t.joinChannel=function(e){return n.verifyOptions(e,"channelName","netcall::joinChannel"),n.verifyBooleanWithDefault(e,"liveEnable",!1,"","netcall::joinChannel"),n.verifyBooleanWithDefault(e,"webrtcEnable",!1,"","netcall::joinChannel"),this.cbAndSendCmd("joinChannel",{channelName:e.channelName,liveOption:{liveEnable:e.liveEnable?1:0,webrtcEnable:e.webrtcEnable?1:0}})},t.queryAccountUidMap=function(e,t){return this.cbAndSendCmd("queryAccountUidMap",{channelName:e,uids:t})}}};t.default=s,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});function r(e){return void 0!==e}t.default=function(e){r(e.enable)&&(this.enable=e.enable?1:0),r(e.needBadge)&&(this.needBadge=e.needBadge?1:0),r(e.needPushNick)&&(this.needPushNick=e.needPushNick?1:0),r(e.pushContent)&&(this.pushContent=""+e.pushContent),r(e.custom)&&(this.custom=""+e.custom),r(e.pushPayload)&&(this.pushPayload=""+e.pushPayload),r(e.sound)&&(this.sound=""+e.sound),r(e.webrtcEnable)&&(this.webrtcEnable=e.webrtcEnable?1:0),r(e.forceKeepCalling)&&(this.forceKeepCalling=e.forceKeepCalling?1:0)},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(13),i={install:function(e){var t=e.Protocol.fn;t.processNetcall=function(e){switch(e.cmd){case"initNetcall":this.onInitNetcall(e);break;case"beCalled":this.onBeCalled(e);break;case"keepCalling":this.onKeepCalling(e);break;case"calleeAck":break;case"notifyCalleeAck":this.onNotifyCalleeAck(e);break;case"hangup":break;case"notifyHangup":this.onNotifyHangup(e);break;case"notifyNetcallControl":this.onNetcallControl(e);break;case"notifyCalleeAckSync":this.onNotifyCalleeAckSync(e);break;case"notifyNetcallRecord":this.onMsg(e);break;case"createChannel":break;case"joinChannel":this.joinChannel(e);break;case"notifyJoin":this.notifyJoin(e)}},t.onInitNetcall=function(e){if(!e.error){var t=e.obj.type;e.obj=e.content,e.obj.type=t,e.obj.accounts=e.obj.keepCallingAccounts,this.setCurrentNetcall(e.obj.channelId),this.keepCalling(e)}},t.setCurrentNetcall=function(e){this.currentNetcallChannelId=e},t.onKeepCalling=function(e){e.error||e.content.accounts.length&&this.keepCalling(e)},t.keepCalling=function(e){var t=this,n=e.obj,i=n.type,o=n.accounts,s=n.channelId;o&&o.length&&setTimeout((function(){t.currentNetcallChannelId&&t.currentNetcallChannelId===s&&t.api.keepCalling({type:i,accounts:o,channelId:s}).catch((function(){}))}),r.KEEP_CALLING_INTERVAL)},t.onBeCalled=function(e){e.error||this.emitAPI({type:"beCalled",obj:e.content})},t.onNotifyCalleeAck=function(e){e.error||this.emitAPI({type:"notifyCalleeAck",obj:e.content})},t.onNotifyHangup=function(e){e.error||this.emitAPI({type:"notifyHangup",obj:e.content})},t.onNetcallControl=function(e){e.error||this.emitAPI({type:"netcallControl",obj:e.content})},t.onNotifyCalleeAckSync=function(e){e.error||this.emitAPI({type:"notifyCalleeAckSync",obj:e.content})},t.notifyJoin=function(e){e.error||this.emitAPI({type:"notifyJoin",obj:e.content})},t.joinChannel=function(e){e.obj=e.content}}};t.default=i,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={netcall:{id:9,initNetcall:1,keepCalling:3,calleeAck:4,notifyCalleeAck:5,hangup:6,notifyHangup:7,netcallControl:8,notifyNetcallControl:9,verifyChannelId:10,createChannel:13,joinChannel:14,queryAccountUidMap:16}},i={initNetcall:{sid:9,cid:r.netcall.initNetcall,params:[{type:"byte",name:"type"},{type:"StrArray",name:"accounts"},{type:"String",name:"pushContent"},{type:"String",name:"custom"},{type:"Property",name:"pushConfig"}]},keepCalling:{sid:9,cid:r.netcall.keepCalling,params:[{type:"byte",name:"type"},{type:"StrArray",name:"accounts"},{type:"long",name:"channelId"}]},calleeAck:{sid:9,cid:r.netcall.calleeAck,params:[{type:"string",name:"account"},{type:"long",name:"channelId"},{type:"byte",name:"type"},{type:"bool",name:"accepted"}]},hangup:{sid:9,cid:r.netcall.hangup,params:[{type:"long",name:"channelId"}]},netcallControl:{sid:9,cid:r.netcall.netcallControl,params:[{type:"long",name:"channelId"},{type:"byte",name:"type"}]},verifyChannelId:{sid:9,cid:r.netcall.verifyChannelId,params:[{type:"long",name:"channelId"},{type:"String",name:"account"}]},createChannel:{sid:9,cid:r.netcall.createChannel,params:[{type:"String",name:"channelName"},{type:"String",name:"custom"},{type:"String",name:"webrtcEnable"}]},joinChannel:{sid:9,cid:r.netcall.joinChannel,params:[{type:"String",name:"channelName"},{type:"Property",name:"liveOption"}]},queryAccountUidMap:{sid:9,cid:r.netcall.queryAccountUidMap,params:[{type:"String",name:"channelName"},{type:"LongArray",name:"uids"}]}},o={"9_1":{service:"netcall",cmd:"initNetcall",response:[{type:"Number",name:"timetag"},{type:"Number",name:"uid"},{type:"Number",name:"channelId"},{type:"StrArray",name:"turnServerList"},{type:"StrArray",name:"sturnServerList"},{type:"StrArray",name:"proxyServerList"},{type:"StrArray",name:"keepCallingAccounts"},{type:"StrLongMap",name:"accountUidMap"},{type:"String",name:"clientConfig"},{type:"String",name:"serverMap"}]},"9_2":{service:"netcall",cmd:"beCalled",response:[{type:"Number",name:"timetag"},{type:"Number",name:"type"},{type:"Number",name:"channelId"},{type:"String",name:"account"},{type:"Number",name:"uid"},{type:"StrArray",name:"turnServerList"},{type:"StrArray",name:"sturnServerList"},{type:"StrArray",name:"proxyServerList"},{type:"StrLongMap",name:"accountUidMap"},{type:"String",name:"clientConfig"},{type:"String",name:"custom"},{type:"Property",name:"pushConfig"},{type:"String",name:"serverMap"}]},"9_3":{service:"netcall",cmd:"keepCalling",response:[{type:"StrArr",name:"accounts"}]},"9_4":{service:"netcall",cmd:"calleeAck",response:[]},"9_5":{service:"netcall",cmd:"notifyCalleeAck",response:[{type:"String",name:"account"},{type:"long",name:"channelId"},{type:"byte",name:"type"},{type:"bool",name:"accepted"}]},"9_6":{service:"netcall",cmd:"hangup",response:[]},"9_7":{service:"netcall",cmd:"notifyHangup",response:[{type:"long",name:"channelId"},{type:"String",name:"account"},{type:"long",name:"timetag"}]},"9_8":{service:"netcall",cmd:"netcallControl",response:[]},"9_9":{service:"netcall",cmd:"notifyNetcallControl",response:[{type:"String",name:"account"},{type:"byte",name:"type"},{type:"long",name:"channelId"}]},"9_10":{service:"netcall",cmd:"verifyChannelId",response:[]},"9_11":{service:"netcall",cmd:"notifyNetcallRecord",response:[{type:"Property",name:"msg"}]},"9_12":{service:"netcall",cmd:"notifyCalleeAckSync",response:[{type:"String",name:"timetag"},{type:"long",name:"channelId"},{type:"byte",name:"type"},{type:"bool",name:"accepted"},{type:"byte",name:"fromClientType"}]},"9_13":{service:"netcall",cmd:"createChannel",response:[{type:"long",name:"timetag"}]},"9_14":{service:"netcall",cmd:"joinChannel",response:[{type:"long",name:"timetag"},{type:"long",name:"channelId"},{type:"StrLongMap",name:"accountUidMap"},{type:"String",name:"serverMap"},{type:"String",name:"clientConfig"},{type:"String",name:"custom"}]},"9_15":{service:"netcall",cmd:"notifyJoin",response:[{type:"Long",name:"channelId"},{type:"StrLongMap",name:"accountUidMap"}]},"9_16":{service:"netcall",cmd:"queryAccountUidMap",response:[]}};t.default={idMap:r,cmdConfig:i,packetConfig:o},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={pushConfig:{enable:1,needBadge:2,needPushNick:3,pushContent:4,custom:5,pushPayload:6,sound:7,forceKeepCalling:9,webrtcEnable:10},liveOption:{liveEnable:1,webrtcEnable:2}},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={pushConfig:{1:"enable",2:"needBadge",3:"needPushNick",4:"pushContent",5:"custom",6:"pushPayload",7:"sound",9:"forceKeepCalling",10:"webrtcEnable"},liveOption:{1:"liveEnable",2:"webrtcEnable"}},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(42)),i=c(n(43)),o=c(n(23)),s=n(13),a=c(n(155)),u=c(n(71));function c(e){return e&&e.__esModule?e:{default:e}}var l=n(46),d=n(45).webrtcG2Version,f={init:function(){return Promise.resolve()},join:function(e){var t=this;if(this._status.isInTheRoom)return this.logger.log("正在房间中，请勿重复加入！"),Promise.reject("ERR_REPEAT_JOIN");var n=this;o.default.verifyOptions(e,"channelName");var r=this._status,i=r.encryptType,a=r.encryptKey;if(0!==i&&""===a)return Promise.reject(new Error("流媒体加密类型不为0，需要设置加密密钥"));if(!e.uid)return this.logger.error("需要参入uid参数"),Promise.reject("INVALID_ARGUMENTS");this.logger.log("开始请求小程序网关地址");var c=e.uid||o.default.uuid();n._updateStatus({joinChannelParam:e});var f=e.scene!==s.SESSION_MODE.MEETING?{P2P:{value:1}}:{meeting:{value:1}};n._dataReporter.updateStatistics(Object.assign({},{appkey:n._nrtcStatus.appkey,uid:c,miniapp_mode:e.mode?e.mode:0},f)),this._info.uid=c;var p=+new Date,h=Date.now();n._info.joinChannelParam=e;var m=l.nrtcWebRTC2.getChannelInfoUrl;return e.channelServer&&(m=e.channelServer),this._status.channelServer=e.channelServer,this._status.statisticsServer=e.statisticsServer,console.warn("_dataReporter: ",this._dataReporter),this._dataReporter&&this._dataReporter.updateStatisticsServer(e.statisticsServer),new Promise((function(r,s){return o.default.post({uid:c,appkey:n._nrtcStatus.appkey,channelName:e.channelName,secureType:e.token?"1":"2",osType:"4",mode:2,netType:"0",version:d+".0"||!1,curtime:p,checksum:e.token?e.token:(0,u.default)(n._nrtcStatus.appkey+"."+c+"."+p),nrtcg2:1,t1:h},{url:m}).then((function(o){if(t.logger.log("server response: ",o),200===o.code){t.logger.log("请求到服务器地址"),n._updateStatus({isInTheRoom:!0});o.ips;var u=o.time,l=void 0===u?{}:u;Object.assign(n._status.createChannelResponse,o,e,{uid:c}),n._status.createChannelResponse.token=o.token,n._info.T4=Date.now();var d=n._info.T4-l.t1-(l.t3-l.t2);n._info.clientNtpTime=l.t3+Math.round(d/2),t.logger.log("joinChannelParam: ",e);var f=n._generateJoinParam(e);n._status.role=f.role,n._info.joinChannelParam=f,f.encryptType=i,f.encryptKey=a,t.logger.log("开始joinChannel _status: ",t._status),n._wsController.joinChannel(f).then((function(){t._info.cid=o.cid,n._dataReporter.updateStatistics({cid:t._info.cid,appkey:n._nrtcStatus.appkey,uid:c}),t.logger.log("开始joinChannel 加入房间成功"),r({cid:o.cid,code:o.code,uid:c})})).catch((function(e){t.logger.error("开始joinChannel 加入房间失败: ",e),s(e)}))}else t.logger.error("小程序网关地址请求失败: ",o),t.apiEventReport("setLogin",{a_record:!!n._info.joinChannelParam.recordAudio,v_record:!!n._info.joinChannelParam.recordVideo,record_type:n._info.joinChannelParam.recordType?n._info.joinChannelParam.recordType+"":"0",host_speaker:!!n._info.joinChannelParam.isHostSpeaker,result:o.code,serverIp:n._info.joinChannelParam.address||""}),s(o)})).catch((function(e){t.apiEventReport("setLogin",{a_record:!!n._info.joinChannelParam.recordAudio,v_record:!!n._info.joinChannelParam.recordVideo,record_type:n._info.joinChannelParam.recordType?n._info.joinChannelParam.recordType+"":"0",host_speaker:!!n._info.joinChannelParam.isHostSpeaker,result:-2,serverIp:n._info.joinChannelParam.address||""}),s(e)}))}))},publish:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,i.default)(r.default.mark((function n(){return r.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.logger.log("Nrtc::publish 发布媒体: ",e._status),e._status.isInTheRoom){n.next=5;break}return n.abrupt("return",Promise.reject("不正在房间中，请勿调用！"));case 5:if("audio"===t||"video"===t||""===t){n.next=8;break}return e.logger.log("Nrtc::publish mediaType参数错误"),n.abrupt("return",Promise.reject("mediaType参数错误"));case 8:if("audio"!==t||!e._status.publishAudio){n.next=12;break}return n.abrupt("return");case 12:if("video"!==t||!e._status.publishVideo){n.next=16;break}return n.abrupt("return");case 16:if(!e._status.publishAudio||!e._status.publishVideo){n.next=18;break}return n.abrupt("return");case 18:return n.abrupt("return",new Promise(function(){var n=(0,i.default)(r.default.mark((function n(o,s){var a;return r.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:a=setInterval((0,i.default)(r.default.mark((function n(){return r.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.logger.log("Nrtc::publish 定时器 推流地址： ",e._info.pushUrl),!e._info.pushUrl){n.next=30;break}if(clearInterval(a),a=null,e.apiEventReport("setFunction",{name:"publish",oper:"1",value:"success"}),e.logger.log("Nrtc::publish 定时器发送publish消息"),n.prev=6,!t){n.next=14;break}return e.logger.log("publish: ",t),n.next=11,e._wsController.publish(t);case 11:"audio"===t?e._status.publishAudio=!0:"video"===t&&(e._status.publishVideo=!0),n.next=24;break;case 14:if(e._status.publishAudio){n.next=18;break}return e.logger.log("publish audio"),n.next=18,e._wsController.publish("audio");case 18:if(e._status.publishVideo){n.next=22;break}return e.logger.log("publish video"),n.next=22,e._wsController.publish("video");case 22:e._status.publishAudio=!0,e._status.publishVideo=!0;case 24:o(e._info.pushUrl),n.next=30;break;case 27:n.prev=27,n.t0=n.catch(6),s(n.t0);case 30:case"end":return n.stop()}}),n,e,[[6,27]])}))),100),setTimeout((function(){clearInterval(a),a=null,e._info.pushUrl||(e.apiEventReport("setFunction",{name:"publish",oper:"1",value:"failed"}),s("no pushUrl"))}),5e3);case 2:case"end":return n.stop()}}),n,e)})));return function(e,t){return n.apply(this,arguments)}}()));case 19:case"end":return n.stop()}}),n,e)})))()},unpublish:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,i.default)(r.default.mark((function n(){return r.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.logger.log("Nrtc::unpublish 停止发布媒体: ",t),e._status.isInTheRoom){n.next=5;break}return n.abrupt("return",Promise.reject("不正在房间中，请勿调用！"));case 5:if("audio"===t||"video"===t||""===t){n.next=8;break}return e.logger.log("Nrtc::unpublish mediaType参数错误"),n.abrupt("return",Promise.reject("mediaType参数错误"));case 8:if(e.logger.log("Nrtc::unpublish _status: ",e._status),"audio"!==t||e._status.publishAudio){n.next=13;break}return n.abrupt("return");case 13:if("video"!==t||e._status.publishVideo){n.next=17;break}return n.abrupt("return");case 17:if(e._status.publishAudio||e._status.publishVideo){n.next=19;break}return n.abrupt("return");case 19:if(e.logger.log("Nrtc::unpublish 停止发布媒体: ",e._info.pushUrl),n.prev=20,!t){n.next=27;break}return n.next=24,e._wsController.unpublish(t);case 24:"audio"===t?e._status.publishAudio=!1:"video"===t&&(e._status.publishVideo=!1),n.next=35;break;case 27:if(!e._status.audio){n.next=30;break}return n.next=30,e._wsController.unpublish("audio");case 30:if(!e._status.video){n.next=33;break}return n.next=33,e._wsController.unpublish("video");case 33:e._status.publishAudio=!1,e._status.publishVideo=!1;case 35:return e.apiEventReport("setFunction",{name:"unpublish",oper:"1",value:"success"}),n.abrupt("return");case 39:return n.prev=39,n.t0=n.catch(20),n.abrupt("return",Promise.reject(n.t0));case 42:case"end":return n.stop()}}),n,e,[[20,39]])})))()},subscribe:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,i.default)(r.default.mark((function i(){return r.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t.logger.log("Nrtc::subscribe 订阅媒体"),t._status.isInTheRoom){r.next=5;break}return r.abrupt("return",Promise.reject("不正在房间中，请勿调用！"));case 5:if(t._info.userlist.get(e)){r.next=7;break}return r.abrupt("return",Promise.reject("对方不正在房间中，或者没有发布！"));case 7:return t.logger.log("Nrtc::subscribe 订阅媒体: ",n),t.apiEventReport("setFunction",{name:"subscribe",oper:""+e,value:"success"}),r.prev=9,r.next=12,t._wsController.subscribe(e,n);case 12:r.next=18;break;case 14:return r.prev=14,r.t0=r.catch(9),t.logger.log("Nrtc::subscribe 订阅媒体: ",n,"失败: ",r.t0),r.abrupt("return",Promise.reject(r.t0));case 18:return t.logger.log("Nrtc::subscribe 订阅媒体成功: ",t._info.userlist.get(e)),r.abrupt("return",Promise.resolve(t._info.userlist.get(e)));case 20:case"end":return r.stop()}}),i,t,[[9,14]])})))()},unsubscribe:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,i.default)(r.default.mark((function i(){return r.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t.logger.log("Nrtc::subscribe 停止订阅媒体"),t._status.isInTheRoom){r.next=5;break}return r.abrupt("return",Promise.reject("不正在房间中，请勿调用！"));case 5:if(t._info.userlist.get(e)){r.next=7;break}return r.abrupt("return",Promise.reject("对方不正在房间中，或者没有发布！"));case 7:return t.apiEventReport("setFunction",{name:"unsubscribe",oper:""+e,value:"success"}),t.logger.log("Nrtc::subscribe 停止订阅媒体: ",e,",mediaType: ",n),r.next=11,t._wsController.unsubscribe(e,n);case 11:case"end":return r.stop()}}),i,t)})))()},mute:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(0,i.default)(r.default.mark((function i(){return r.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.logger.log("Nrtc::mute 发布媒体"),e._status.isInTheRoom){r.next=5;break}return r.abrupt("return",Promise.reject("不正在房间中，请勿调用！"));case 5:if("audio"===t||"video"===t||""===t){r.next=8;break}return e.logger.log("Nrtc::mute mediaType参数错误"),r.abrupt("return",Promise.reject("mediaType参数错误"));case 8:if(e.logger.log("Nrtc::mute: ",t),r.prev=9,!t){r.next=15;break}return r.next=13,e._wsController.mute(n,t);case 13:r.next=19;break;case 15:return r.next=17,e._wsController.mute(n,"audio");case 17:return r.next=19,e._wsController.mute(n,"video");case 19:return e.apiEventReport("setFunction",{name:"mute",oper:"1",value:"success"}),r.abrupt("return");case 23:return r.prev=23,r.t0=r.catch(9),r.abrupt("return",Promise.reject(r.t0));case 26:case"end":return r.stop()}}),i,e,[[9,23]])})))()},unmute:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(0,i.default)(r.default.mark((function i(){return r.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.logger.log("Nrtc::unmute"),e._status.isInTheRoom){r.next=5;break}return r.abrupt("return",Promise.reject("不正在房间中，请勿调用！"));case 5:if("audio"===t||"video"===t||""===t){r.next=8;break}return e.logger.log("Nrtc::unmute mediaType参数错误"),r.abrupt("return",Promise.reject("mediaType参数错误"));case 8:if(e.logger.log("Nrtc::unmute: ",t),r.prev=9,!t){r.next=15;break}return r.next=13,e._wsController.unmute(n,t);case 13:r.next=19;break;case 15:return r.next=17,e._wsController.unmute(n,"audio");case 17:return r.next=19,e._wsController.unmute(n,"video");case 19:return e.apiEventReport("setFunction",{name:"unmute",oper:"1",value:"success"}),r.abrupt("return");case 23:return r.prev=23,r.t0=r.catch(9),r.abrupt("return",Promise.reject(r.t0));case 26:case"end":return r.stop()}}),i,e,[[9,23]])})))()},dataReporter:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"push",t=arguments[1],n=arguments[2];this.apiEventReport("setFunction",{name:t,oper:e,value:JSON.stringify(n,null," ")})},apiEventReport:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"setFunction",t=arguments[1];if(e){var n=new a.default({channelInfo:Object.assign(this._info,this._status,this._nrtcStatus)});n[e](Object.assign({uid:""+this._info.uid,cid:""+this._info.cid,time:Date.now()},t)),n.send(),n=null}},leave:function(){return!1===this._status.isInTheRoom?Promise.reject("不在房间中了，请勿重复离开"):(this.apiEventReport("setLogout",{reason:0}),this._updateStatus({isInTheRoom:!1}),this._dataReporter.sendStatistics(),this._resetStatus(),this._wsController.leaveChannel())},switchMode:function(e){return o.default.isNumber(e)?(this._dataReporter.updateStatistics({miniapp_mode:e}),this.logger.log("设置推流模式: ",e),this._wsController.switchMode(e)):Promise.reject("switchMode: 入参类型必须为Number")},getUploadUserList:function(){return this._wsController._websocket.getUploadUserList()},_generateJoinParam:function(e){var t={},n=this._status.createChannelResponse;return t.accid=n.accid||"unknow",t.cid=parseInt(n.cid),t.uid=parseInt(n.uid),t.token=n.token,t.mode=parseInt(e.mode),t.scene=n.scene,t.liveEnable=e.liveEnable?s.LIVE_ENABLE.LIVE_ENABLE_OPEN:s.LIVE_ENABLE.LIVE_ENABLE_CLOSE,t.role=e.role?s.ROLE_FOR_MEETING.ROLE_AUDIENCE:s.ROLE_FOR_MEETING.ROLE_HOST,t.webrtc=1,t.address=e.address||"wss://"+n.ips.wechatapparray[0],t.edgeAddr=e.edgeAddr||n.ips.turnaddrs[0][0],t.recordType=e.recordType?e.recordType:s.RECORD_TYPE.RECORD_TYPE_MIX_SINGLE,t.recordAudio=e.recordAudio?s.RECORD_AUDIO.RECORD_AUDIO_OPEN:s.RECORD_AUDIO.RECORD_AUDIO_CLOSE,t.recordVideo=e.recordVideo?s.RECORD_VIDEO.RECORD_VIDEO_OPEN:s.RECORD_VIDEO.RECORD_VIDEO_CLOSE,t.isHostSpeaker=e.isHostSpeaker?1:0,this.logger.log("Nrtc::joinChannel",t),t},_getLink:function(){return this._wsController._websocket}};t.default=f,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(3)),i=s(n(4)),o=s(n(71));function s(e){return e&&e.__esModule?e:{default:e}}var a=n(45).webrtcG2Version,u=function(){function e(t){(0,r.default)(this,e),this.channelInfo=t.channelInfo||{},this.cid=""+this.channelInfo.cid,this.uid=""+this.channelInfo.uid;var n=this.channelInfo.startSessionTime||Date.now();this.time=this.channelInfo.clientNtpTime-this.channelInfo.T4,this.common={ver:"2.0",sdk_type:"nrtc2",session_id:(0,o.default)(this.cid+":"+this.uid+":"+n),app_key:this.channelInfo.appkey||""},this.event=[],this.api=null,this.heartbeat=null}return(0,i.default)(e,[{key:"addEvent",value:function(e){return-1==this.event.indexOf(e)&&this.event.push(e),this}},{key:"updateCommon",value:function(e){return Object.assign(this.common,e),this}},{key:"setEvent",value:function(e,t){this.addEvent(e),this[e]=t}},{key:"setHeartbeat",value:function(e){var t=this,n=e.uid,r=e.cid,i=e.sys,o=e.tx,s=e.rx;this.heartbeat={uid:n,cid:r,sys:i,tx:o,rx:s},this.api=this.adapterRef.apiEvents.length?this.adapterRef.apiEvents:this.adapterRef.apiEvent;var a={apiEvent:[]};for(var u in this.api)this.api[u].length&&this.api[u].forEach((function(e){e.uid=t.uid-0,e.cid=t.cid-0})),a.apiEvent=a.apiEvent.concat(this.api[u]);return this.api=null,this.api=a.apiEvent.length?a:null,this.adapterRef.apiEvents={},this.adapterRef.apiEvent={},this}},{key:"setLogin",value:function(e){var t=e.uid,n=e.cid,r=e.sdk_ver,i=void 0===r?a:r,o=e.platform,s=void 0===o?"mini":o,u=e.app_key,c=void 0===u?this.common.app_key:u,l=e.meeting_mode,d=void 0===l?1:l,f=e.a_record,p=e.v_record,h=e.record_type,m=e.host_speaker,v=e.server_ip,y=e.result,g=e.time,_=e.signal_time_elapsed,b=e.time_elapsed;this.addEvent("login"),g=this.time+g,this.login={uid:t,cid:n,sdk_ver:i,platform:s,app_key:c,meeting_mode:d,a_record:f,v_record:p,record_type:h,host_speaker:m,server_ip:v,result:y,time:g,signal_time_elapsed:_,time_elapsed:b}}},{key:"setRelogin",value:function(e){var t=e.uid,n=e.cid,r=e.meeting_mode,i=void 0===r?1:r,o=e.a_record,s=e.v_record,a=e.record_type,u=e.host_speaker,c=e.server_ip,l=e.result,d=e.time,f=e.reason;this.addEvent("relogin"),d=this.time+d,this.relogin={uid:t,cid:n,meeting_mode:i,a_record:o,v_record:s,record_type:a,host_speaker:u,server_ip:c,result:l,time:d,reason:f}}},{key:"setLogout",value:function(e){var t=e.uid,n=e.cid,r=e.time,i=e.reason;this.addEvent("logout"),r=this.time+r,this.logout={uid:t,cid:n,time:r,reason:i}}},{key:"deviceAbnormal",value:function(e){var t=e.uid,n=e.cid;this.addEvent("deviceAbnormal"),time=this.time+time,this.deviceAbnormal={uid:t,cid:n}}},{key:"setDisconnect",value:function(e){var t=e.uid,n=e.cid,r=e.reason,i=e.time;this.addEvent("disconnect"),i=this.time+i,this.disconnect={uid:t,cid:n,reason:r,time:i}}},{key:"setRecvFirstFrame",value:function(e){var t=e.uid,n=e.cid,r=e.pull_uid,i=e.time,o=e.media_type;this.addEvent("recvFirstFrame"),i=this.time+i,this.recvFirstFrame={uid:t,cid:n,pull_uid:r,time:i,media_type:o}}},{key:"setSendFirstPackage",value:function(e){var t=e.uid,n=e.cid,r=e.time,i=e.media_type;this.addEvent("firstPacketSent"),r=this.time+r,this.firstPacketSent={uid:t,cid:n,time:r,media_type:i}}},{key:"setRecvFirstPackage",value:function(e){var t=e.uid,n=e.cid,r=e.pull_uid,i=e.time,o=e.media_type;this.addEvent("recvFirstPackage"),i=this.time+i,this.recvFirstPackage={uid:t,cid:n,pull_uid:r,time:i,media_type:o}}},{key:"setFunction",value:function(e){var t=e.uid,n=e.cid,r=e.oper,i=e.value,o=e.time,s=e.name;this.addEvent("function"),o=this.time+o,this.function={uid:t,cid:n,oper:r,value:i,time:o,name:s}}},{key:"reset",value:function(){this.event=[],this.api=null,this.heartbeat=null}},{key:"send",value:function(e){var t=this,n={common:this.common};if(e||(e=this.event||null),this.heartbeat&&(n.heartbeat=this.heartbeat,this.api&&(n.event=this.api)),e)e.length&&(n.event=e.reduce((function(e,n){return e[n]=t[n],e}),{}));else if(!this.heartbeat)return this;var r="https://statistic.live.126.net/statics/report/common/form";this.channelInfo.statisticsServer&&(r=this.channelInfo.statisticsServer);var i=this;return wx.request({method:"post",url:r,data:n,header:{"content-type":"application/json",sdktype:this.common.sdk_type,appkey:this.common.app_key,platform:"mini",sdkver:a},complete:function(){"function"==typeof i.reset&&i.reset()}}),this}}]),e}();t.default=u,e.exports=t.default},function(e,t){var n,r;n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&r.rotl(e,8)|4278255360&r.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=r.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var t=[],r=0;r<e.length;r+=3)for(var i=e[r]<<16|e[r+1]<<8|e[r+2],o=0;o<4;o++)8*r+6*o<=8*e.length?t.push(n.charAt(i>>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],r=0,i=0;r<e.length;i=++r%4)0!=i&&t.push((n.indexOf(e.charAt(r-1))&Math.pow(2,-2*i+8)-1)<<2*i|n.indexOf(e.charAt(r))>>>6-2*i);return t}},e.exports=r},function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}
  /*!
   * Determine if an object is a Buffer
   *
   * @author   Feross Aboukhadijeh <https://feross.org>
   * @license  MIT
   */
  e.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});o(n(66)),o(n(68));var r=n(13),i=o(n(23));function o(e){return e&&e.__esModule?e:{default:e}}var s={call:function(e){var t=this;if(this._status.calling)return Promise.reject("呼叫失败: 当前正在通话中");i.default.verifyOptions(e,"type callee");var n=e.callee,o=e.type,s=e.forceKeepCalling,a=n.constructor===Array;return this._updateStatus({signalStartTime:Date.now(),calling:!0,isCaller:!0,callee:n,isTeamCall:a}),s&&this._dataReporter.updateStatistics({always_keep_calling:{value:1}}),this._dataReporter.updateStatistics({appkey:this._imController._nim.options.appKey,P2P:{value:1},miniapp_mode:e.type===r.CALL_TYPE.NETCALL_TYPE_AUDIO?r.NETCALL_MODE.NETCALL_MODE_ONLY_AUDIO:r.NETCALL_MODE.NETCALL_MODE_AUDIO_VIDEO}),this._imController.initNetcall({type:o,pushConfig:{forceKeepCalling:s?1:0},accounts:a?n:[n],webrtcEnable:!0}).catch((function(e){return t.logger.error("call error: "+e),t.destroy()}))},control:function(e){return i.default.verifyOptions(e,"command"),e.cid&&(e.channelId=e.cid),Object.assign(e,{fn:"netcallControl"}),this._imController.control(e)},response:function(e){return i.default.verifyOptions(e,"caller accepted type cid"),this._imController.response(e)},hangup:function(){return this._dataReporter.sendStatistics(),this._imController.hangup({fn:"hangup",recordType:"cancelNetcallBeforeAccept"})},createChannel:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t;return i.default.verifyOptions(n,"channelName"),n.custom=n.custom||"",n.webrtcEnable=!0,Object.assign(this._status,{signalStartTime:Date.now()}),this._imController.createChannel("createChannel",n).then((function(e){return Promise.resolve(e)})).catch((function(t){return e.logger.error("createChannel error:",t),Object.assign(e._status,{signalEndTime:Date.now()}),Promise.reject(t)}))},joinChannel:function(e){i.default.verifyOptions(e,"channelName mode role");var t=this._status,n=t.encryptType,o=t.encryptKey;if(0!==n&&""===o)return Promise.reject(new Error("流媒体加密类型不为0，需要设置加密密钥"));var s=i.default.deepClone(e),a=this,u={};return this._status.role=s.role,new Promise((function(t,i){a._getChannelInfo(s).then((function(c){return u={accountUidMap:c.accountUidMap,uid:c.uid,cid:c.channelId,account:c.account},a._dataReporter.updateStatistics({appkey:a._imController._nim.options.appKey,uid:c.uid,meeting:{value:1},miniapp_mode:e.mode}),a._wsController.joinChannel({cid:+c.channelId,uid:c.uid,accid:c.account||"unknown",usertype:2,token:c.channelId+"",address:"wss://"+c.serverMap.webrtcarray[0],mode:s.mode,role:s.role,scene:r.SESSION_MODE.MEETING,liveEnable:s.liveEnable?s.liveEnable:r.LIVE_ENABLE.LIVE_ENABLE_CLOSE,rtmpRecord:s.rtmpRecord?s.rtmpRecord:r.RTMP_RECORD.RTMP_RECORD_CLOSE,recordAudio:s.recordAudio?s.recordAudio:r.RECORD_AUDIO.RECORD_AUDIO_CLOSE,recordVideo:s.recordVideo?s.recordVideo:r.RECORD_VIDEO.RECORD_VIDEO_CLOSE,recordType:s.recordType?+s.recordType:+r.RECORD_TYPE.RECORD_TYPE_MIX_SINGLE,isHostSpeaker:s.isHostSpeaker?1:0,encryptType:n,encryptKey:o}).then((function(){t(u)})).catch((function(e){i(e)}))})).then((function(){return Promise.resolve(u)})).catch((function(e){i(e)}))}))},startRtc:function(e){var t=this;i.default.verifyOptions(e,"mode");var n=this._status,o=n.encryptType,s=n.encryptKey;if(0!==o&&""===s)return Promise.reject(new Error("流媒体加密类型不为0，需要设置加密密钥"));var a=this._status.isCaller?this._imController._status.imInfo:this._imController._status.beCalledInfo,u=this._imController._nim.account,c=a.accountUidMap[u];return this._dataReporter.updateStatistics({uid:c,miniapp_mode:e.mode}),new Promise((function(n,i){t._updateStatus({signalInited:!0}),t._wsController.joinChannel({cid:+a.channelId,uid:c,accid:u||"unknown",usertype:2,token:a.channelId+"",address:"wss://"+JSON.parse(a.serverMap).webrtcarray[0],mode:e.mode,scene:r.SESSION_MODE.P2P,recordAudio:e.recordAudio?e.recordAudio:r.RECORD_AUDIO.RECORD_AUDIO_CLOSE,recordVideo:e.recordVideo?e.recordVideo:r.RECORD_VIDEO.RECORD_VIDEO_CLOSE,rtmpRecord:e.rtmpRecord?e.rtmpRecord:r.RTMP_RECORD.RTMP_RECORD_CLOSE,recordType:e.recordType?+e.recordType:+r.RECORD_TYPE.RECORD_TYPE_MIX_SINGLE,isHostSpeaker:e.isHostSpeaker?1:0,encryptType:o,encryptKey:s}).then((function(){n({uid:a.uid,cid:a.channelId,account:u})})).catch((function(e){i(e)}))}))},leaveChannel:function(){var e=this,t=this;return!1===this._status.signalInited?(this.logger.error("未处于房间中"),Promise.reject("未处于房间中")):(this._dataReporter.sendStatistics(),new Promise((function(n,r){e._wsController.leaveChannel().then((function(){t._resetStatus(),t._imController._resetStatus(),n()})).catch((function(e){r(e)}))})))},switchMode:function(e){if(!i.default.isNumber(e))throw Error("switchMode: 入参类型必须为Number");switch(e=parseInt(e),this._dataReporter.updateStatistics({miniapp_mode:e}),e){case r.NETCALL_MODE.NETCALL_MODE_AUDIO_VIDEO:case r.NETCALL_MODE.NETCALL_MODE_ONLY_AUDIO:case r.NETCALL_MODE.NETCALL_MODE_ONLY_VIDEO:case r.NETCALL_MODE.NETCALL_MODE_NOAUDIO_NOVIDEO:break;default:return Promise.reject("RTC: switchMode: mode值无效！")}return this._wsController.switchMode(e)},_getChannelInfo:function(e){var t=this,n=e;return this._status.signalInited?(this.logger.error("已经在房间中了"),Promise.reject("已经在房间中了")):(i.default.verifyOptions(n,"channelName"),new Promise((function(n,r){t._imController.joinChannel("joinChannel",{channelName:e.channelName}).then((function(e){n(e)})).catch((function(e){r(e)}))})))}};t.default=s,e.exports=t.default}]);