diff --git a/dist/main.js b/dist/main.js
index 5536b45..e5f7d16 100644
--- a/dist/main.js
+++ b/dist/main.js
@@ -1,6 +1,7 @@
-!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MessageEngine=t():e.MessageEngine=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))switch(typeof e[t]){case"function":break;case"object":e[t]=function(t){var n=t.slice(1),r=e[t[0]];return function(e,t,i){r.apply(this,[e,t,i].concat(n))}}(e[t]);break;default:e[t]=e[e[t]]}return e}([function(e,t,n){e.exports=n(19)},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){n(this,e),this.info=t||"",this.id=this.initId()}return r(e,[{key:"initId",value:function(){var e=this.info.constructor.name.toLowerCase();return"string"===e?this.info:"object"===e?this.info.mid||"":""}},{key:"log",value:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];this._log(e.LOG,n)}},{key:"warn",value:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];this._log(e.WARN,n)}},{key:"error",value:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];this._log(e.ERROR,n)}},{key:"_log",value:function(t,n){n=JSON.stringify(n);var r=this.id+" -> "+n;if(t>=e.logLevel)switch(t){case e.LOG:console.log(r);break;case e.WARN:console.warn(r);break;case e.ERROR:console.error(r)}}}]),e}();i.LOG=0,i.WARN=1,i.ERROR=2,i.NO=1/0,i.logLevel=i.LOG;var o={getLoger:function(e){return new i(e)},setLogLevel:function(e){i.logLevel=e},LOG:i.LOG,WARN:i.WARN,ERROR:i.ERROR,NO:i.NO};t.default=o;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"Loger","D:/work/McuClient/src/Loger.js"),__REACT_HOT_LOADER__.register(o,"default","D:/work/McuClient/src/Loger.js"))})()},function(e,t){"use strict";function n(){}Object.defineProperty(t,"__esModule",{value:!0}),n.CONFERENCE_SHOW_USERNAME="show.name.input",n.CONFERENCE_SHOW_ILLEGAL="illegal.user",n.CONFERENCE_SHOW_USERNAME_PASSWORD="show.name.pasword.input",n.CONFERENCE_SHOW_WRONG_PASSWORD="password.wrong",n.CONFERENCE_JOIN_FAILED="join.conference.failed",n.CONFERENCE_JOIN_SUCCESS="join.conference.success",n.CONFERENCE_JOIN_FULL="full.capacity",n.CONFERENCE_EXIT="conference.exit",n.CONFERENCE_JOIN_CONFILICT="have.been.logged.elsewhere",n.CONFERENCE_SHOW_DETAIL="class_detail.message",n.CONFERENCE_SHOW_ROSTER_NUM="roster_num.message",n.NET_ERROR="net_error",n.PRO_ERROR="pro_error",n.VIDEO_SHOW="video.message",n.DOC_SHOW="document.message",n.DOC_SWITCH="document.switch",n.DOC_UPDATE="document.update",n.CHAT_RECEIVE="chat.message",n.DOC_ANNO="document.anno",n.ANNO_UPDATE="anno_update",n.DOC_DEL="document.delete",n.AUDIO_SHOW="audio.message";var r=n;t.default=r;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(n,"MessageTypes","D:/work/McuClient/src/MessageTypes.js"),__REACT_HOT_LOADER__.register(r,"default","D:/work/McuClient/src/MessageTypes.js"))})()},function(e,t){"use strict";function n(e){for(var t in n)if(n[t]===e)return t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.NR_GUEST=0,n.NR_NORMAL=1,n.NR_ADMIN=2,n.NR_MASTER=4,n.NR_SLAVE=8,n.NR_ASSISTANT=16,n.NR_INVISIBLE=32,n.INVALIDATE_CHANNEL_ID=-1,n.INVALIDATE_NODE_ID=-1,n.DOCUMENT_LOAD=0,n.DOCUMENT_DEL=1,n.CGS_RELEASED=0,n.CGS_PENDING=1,n.CGS_OPENNED=2,n.CGS_GRABBING=3,n.CONFERENCE_SESSION_ID=11,n.CHAT_SESSION_ID=12,n.GIFT_SESSION_ID=13,n.AUDIO_SESSION_ID=14,n.VIDEO_SESSION_ID=15,n.WEBSHARING_SESSION_ID=16,n.DOCSHARING_SESSION_ID=17,n.WHITEBOARD_SESSION_ID=18,n.MEDIA_SESSION_ID=19,n.SCREENSHARING_SESSION_ID=20,n.POLL_SESSION_ID=21,n.BROADCAST_CHANNEL_ID=0,n.CONFERENCE_CHANNEL_ID=n.CONFERENCE_SESSION_ID,n.CHAT_CHANNEL_ID=n.CHAT_SESSION_ID,n.GIFT_CHANNEL_ID=n.GIFT_SESSION_ID,n.WEBSHARING_CHANNEL_ID=n.WEBSHARING_SESSION_ID,n.DOCSHARING_CHANNEL_ID=n.DOCSHARING_SESSION_ID,n.WHITEBOARD_CHANNEL_ID=n.WHITEBOARD_SESSION_ID,n.MEDIA_CHANNEL_ID=n.MEDIA_SESSION_ID,n.SCREENSHARING_CHANNEL_ID=n.SCREENSHARING_SESSION_ID,n.CONFERENCE_SESSION_NAME="conference app",n.CHAT_SESSION_NAME="chat app",n.GIFT_SESSION_NAME="gift app",n.AUDIO_SESSION_NAME="audio app",n.VIDEO_SESSION_NAME="video app",n.WEBSHARING_SESSION_NAME="web sharing app",n.DOCSHARING_SESSION_NAME="doc sharing app",n.WHITEBOARD_SESSION_NAME="whiteboard app",n.MEDIA_SESSION_NAME="media sharing app",n.SCREENSHARING_SESSION_NAME="screen sharing app",n.CONFERENCE_SESSION_TAG="con-tag",n.CHAT_SESSION_TAG="cha-tag",n.GIFT_SESSION_TAG="gif-tag",n.AUDIO_SESSION_TAG="aud-tag",n.VIDEO_SESSION_TAG="vid-tag",n.WEBSHARING_SESSION_TAG="web-tag",n.DOCSHARING_SESSION_TAG="doc-tag",n.WHITEBOARD_SESSION_TAG="wbd-tag",n.MEDIA_SESSION_TAG="med-tag",n.SCREENSHARING_SESSION_TAG="scr-tag",n.CONFERENCE_OBJ_ROSTER_ID=(n.CONFERENCE_SESSION_ID<<16)+1,n.CONFERENCE_OBJ_ROSTER_NAME="node list",n.CONFERENCE_OBJ_ROSTER_TAG="node list tag",n.CONFERENCE_OBJ_QUEUE_ID=(n.CONFERENCE_SESSION_ID<<16)+2,n.CONFERENCE_OBJ_QUEUE_NAME="mic list",n.CONFERENCE_OBJ_QUEUE_TAG="mic list tag",n.CONFERENCE_OBJ_TABLE_ID=(n.CONFERENCE_SESSION_ID<<16)+3,n.CONFERENCE_OBJ_TABLE_NAME="tabbar list",n.CONFERENCE_OBJ_TABLE_TAG="tabbar list tag",n.CONFERENCE_OBJ_COUNTER_ID=(n.CONFERENCE_SESSION_ID<<16)+4,n.CONFERENCE_OBJ_COUNTER_NAME="id list",n.CONFERENCE_OBJ_COUNTER_TAG="id list tag",n.WEBSHARING_OBJ_TABLE_ID=(n.WEBSHARING_SESSION_ID<<16)+1,n.WEBSHARING_OBJ_TABLE_NAME="web list",n.WEBSHARING_OBJ_TABLE_TAG="web list tag",n.DOCSHARING_OBJ_TABLE_ID=(n.DOCSHARING_SESSION_ID<<16)+1,n.DOCSHARING_OBJ_TABLE_NAME="doc list",n.DOCSHARING_OBJ_TABLE_TAG="doc list tag",n.DOCSHARING_OBJ_TABLE_ID_H5=(n.DOCSHARING_SESSION_ID<<16)+2,n.DOCSHARING_OBJ_TABLE_NAME_H5="doc list h5",n.DOCSHARING_OBJ_TABLE_TAG_H5="doc list tag h5",n.WHITEBOARD_OBJ_TABLE_ID=(n.WHITEBOARD_SESSION_ID<<16)+1,n.WHITEBOARD_OBJ_TABLE_NAME="wbd list",n.WHITEBOARD_OBJ_TABLE_TAG="wbd list tag",n.MEDIA_OBJ_TABLE_ID=(n.MEDIA_SESSION_ID<<16)+1,n.MEDIA_OBJ_TABLE_NAME="med list",n.MEDIA_OBJ_TABLE_TAG="med list tag",n.CHAT_OBJ_TABLE_ID=(n.CHAT_SESSION_ID<<16)+1,n.CHAT_OBJ_TABLE_NAME="chat list",n.CHAT_OBJ_TABLE_TAG="chat list tag",n.AUDIO_OBJ_TABLE_ID=(n.AUDIO_SESSION_ID<<16)+1,n.AUDIO_OBJ_TABLE_NAME="audio channel list",n.AUDIO_OBJ_TABLE_TAG="audio channel list tag",n.VIDEO_OBJ_TABLE_ID=(n.VIDEO_SESSION_ID<<16)+1,n.VIDEO_OBJ_TABLE_NAME="video channel list",n.VIDEO_OBJ_TABLE_TAG="video channel list tag",n.SCREENSHARING_OBJ_TABLE_ID=(n.SCREENSHARING_SESSION_ID<<16)+1,n.SCREEN_OBJ_TABLE_NAME="scr list",n.SCREEN_OBJ_TABLE_TAG="scr list tag",n.POLL_OBJ_TABLE_ID=(n.POLL_SESSION_ID<<16)+1,n.VOTE_OBJ_TABLE_ID=(n.POLL_SESSION_ID<<16)+2,n.RECORD_OBJ_TABLE_ID=(n.POLL_SESSION_ID<<16)+3,n.SHAMLIVE_OBJ_TABLE_ID=(n.POLL_SESSION_ID<<16)+4,n.POLL_OBJ_TABLE_NAME="poll list",n.POLL_OBJ_TABLE_TAG="poll list tag",n.REG_TABLE_INSERT_TAIL=16777215,n.REG_TABLE_DELETE_ALL=16777215,n.CJS_RELEASED=0,n.CJS_JOINNING=1,n.CJS_JOINNED=2,n.WBA_CLOSE=1,n.WBA_CHANGE=2,n.WBA_OPEN=3,n.WBA_DOC_ANNOTATION=4,n.WBA_LASER_PEN=5;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&__REACT_HOT_LOADER__.register(n,"ApeConsts","D:/work/McuClient/src/apes/ApeConsts.js")})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n,r,i,o,s,a,u,f,l){var h=new _.RCSendDataPdu;return h.set("type",e),h.set("subType",t),h.set("initiator",n),h.set("confId",r),h.set("sessionId",i),h.set("channelId",o),h.set("upward",s),h.set("reliability",a),h.set("priority",u),h.set("peer",f),h.set("seg",l),h}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=n(29),a=r(s),u=n(26),f=r(u),l=n(13),h=r(l),d=n(8),c=r(d),E=a.default.newBuilder({convertFieldsToCamelCase:!0});a.default.loadProto(f.default,E);var _=E.build();_.decode_pdu=function(e){return _.RCSendDataPdu.decode(e)},_.create_connect_provider_request_pdu=function(e,t,n,r,o,s,a,u,f){return i(h.default.RCPDU_CONNECT_PROVIDER_REQUEST,e,t,n,r,o,!0,s,a,u,f)},_.create_uniform_pdu=function(e,t,n,r,o,s,a,u,f){return i(h.default.RCPDU_UNIFORM_SEND_DATA_REQUEST,e,t,n,r,o,!0,s,a,u,f)},_.create_normal_pdu=function(e,t,n,r,o,s,a,u,f,l){return i(h.default.RCPDU_SEND_DATA_REQUEST,e,t,n,r,o,s,a,u,f,l)},_.id2type=function(e){for(var t in h.default)if(h.default[t]===e)return t},_=o({},_,h.default,c.default);var p=_;t.default=p;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(E,"builder","D:/work/McuClient/src/pdu/index.js"),__REACT_HOT_LOADER__.register(_,"pdu","D:/work/McuClient/src/pdu/index.js"),__REACT_HOT_LOADER__.register(i,"create_pdu","D:/work/McuClient/src/pdu/index.js"),__REACT_HOT_LOADER__.register(p,"default","D:/work/McuClient/src/pdu/index.js"))})()},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){n(this,e),this.MAPS={}}return r(e,[{key:"on",value:function(e,t){if(e&&t){var n=this.MAPS[e];if(!n)return this.MAPS[e]=[t];n.push(t)}}},{key:"off",value:function(e,t){if(e){var n=this.MAPS[e];if(n){if(t)return n.splice(n.indexOf(t),1);n.length=0}}}},{key:"emit",value:function(e,t){if(e){var n=this.MAPS["*"];n&&n.length&&n.forEach(function(n){n(e,t)});var r=this.MAPS[e];r&&r.length&&r.forEach(function(e){e(t)})}}}]),e}(),o=i;t.default=o;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"Emiter","D:/work/McuClient/src/Emiter.js"),__REACT_HOT_LOADER__.register(o,"default","D:/work/McuClient/src/Emiter.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(4),f=r(u),l=n(5),h=r(l),d=n(12),c=r(d),E=n(1),_=r(E),p=n(2),g=r(p),R=n(3),y=r(R),T=n(11),C=r(T),S=n(8),b=r(S),I=_.default.getLoger("Ape"),v=function(e){function t(e,n,r){i(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return s._session_id=e,s._channel_id=e,s._session_name=n,s._session_tag=r,s._session_channels={},s._adapter_pdu=new f.default.RCAdapterPdu,s._confInfo=null,s._rCArrayBufferUtil=C.default,s._apeDelayed=!1,s._apeDelayedMsgs=[],s._apeDelayedTimer=0,s.on(f.default.RCPDU_SESSION_JOIN_RESPONSE,s._joinSessionHandler.bind(s)),s.on(f.default.RCPDU_CHANNEL_JOIN_RESPONSE,s._joinChannelHandler.bind(s)),s.on(f.default.RCPDU_REG_ADAPTER,s._pduMessageHandler.bind(s)),s.mcu=c.default,s.mcu.on(g.default.CONFERENCE_JOIN_SUCCESS,s._mcuConferenceJoinSuccessHandler.bind(s)),s.mcu.registerApe(s),s}return s(t,e),a(t,[{key:"regResponsePduHandler",value:function(){}},{key:"_pduMessageHandler",value:function(e){var t=this;return this._apeDelayed?void setTimeout(function(){t._pduRegAdapterHandler(e)},this._confInfo.mcuDelay||12e3):void this._pduRegAdapterHandler(e)}},{key:"_pduRegAdapterHandler",value:function(e){var t=f.default.RCAdapterPdu.decode(e),n=t.item,r=n.length;I.log(this._session_name+"数据同步消息.同步条数",r);for(var i=0;i<r;++i){var o=n[i],s=o.type,a=o.itemData;if(f.default.RCPDU_REG_UPDATE_OBJ===s){var u=f.default.RCRegistryUpdateObjPdu.decode(a),l=u.subType,h=u.objId,d=u.userData;switch(I.log("REG OBJECT EVENT ->",f.default.id2type(l)),l){case f.default.RCPDU_REG_ROSTER_INSERT_PDU:for(var c=f.default.RCRegstryRosterInsertItemPdu.decode(d),E=c.items,_=E.length,p=0;p<_;++p){var g=E[p],R=g.item_id,y=f.default.RCNodeInfoRecordPdu.decode(g.item_data);this.rosterInsertHandler(R,y)}break;case f.default.RCPDU_REG_ROSTER_DELETE_PDU:var T=f.default.RCRegistryRosterDeleteItemPdu.decode(d);this.rosterDelHandler(T.nodeId);break;case f.default.RCPDU_REG_ROSTER_UPDATE_PDU:for(var C=f.default.RCRegistryRosterUpdateItemPdu.decode(d),S=C.items,b=S.length,v=0;v<b;++v){var m=S[v],N=m.nodeId,O=f.default.RCNodeInfoRecordPdu.decode(m.nodeData);this.rosterUpdateHandler(N,O)}break;case f.default.RCPDU_REG_TABLE_INSERT_PDU:for(var A=f.default.RCRegistryTableInsertItemPdu.decode(d),P=A.items,w=P.length,D=0;D<w;++D){var U=P[D];this.tableInsertHandler(U.owner,U.itemIdx,U.itemData)}break;case f.default.RCPDU_REG_TABLE_DELETE_PDU:var L=f.default.RCRegistryTableDeleteItemPdu.decode(d);this.tableDeleteHandler(h,L);break;case f.default.RCPDU_REG_TABLE_UPDATE_PDU:for(var k=f.default.RCRegistryTableUpdateItemPdu.decode(d),B=k.items,M=B.length,G=0;G<M;++G){var F=B[G];this.tableUpdateHandler(F.owner,F.itemIdx,F.itemData)}break;case f.default.RCPDU_REG_QUEUE_UPDATE_PDU:case f.default.RCPDU_REG_QUEUE_DELETE_PDU:case f.default.RCPDU_REG_QUEUE_INSERT_PDU:I.warn("REG QUEUE ARE IGNORED")}}else if(f.default.RCPDU_REG_RESPONSE_OBJ==s){var H=f.default.RCRegistryResponseObjPdu.decode(a);this.regResponsePduHandler(H)}}}},{key:"rosterInsertHandler",value:function(e,t){I.warn(this._session_name+" rosterInsertHandler 应有子类具体覆盖处理.")}},{key:"rosterUpdateHandler",value:function(e,t){I.warn(this._session_name+" rosterUpdateHandler 应有子类具体覆盖处理.")}},{key:"rosterDelHandler",value:function(e){I.warn(this._session_name+" rosterDelHandler 应有子类具体覆盖处理.")}},{key:"tableInsertHandler",value:function(e,t){I.warn(this._session_name+" tableInsertHandler 应有子类具体覆盖处理.")}},{key:"tableUpdateHandler",value:function(e,t,n){I.warn(this._session_name+" tableUpdateHandler 应有子类具体覆盖处理.")}},{key:"tableDeleteHandler",value:function(e,t){I.warn(this._session_name+" tableDelHandler 应有子类具体覆盖处理.")}},{key:"_joinSessionHandler",value:function(e){I.log(this._session_name," -> 加入Session")}},{key:"_joinChannelHandler",value:function(e){var t=f.default.RCChannelJoinResponsePdu.decode(e);t.result===f.default.RET_SUCCESS?(I.log(this._session_name," -> 加入Channel成功. ChannelId",t.requestedChannelId),this._session_channels[t.requestedChannelId]=y.default.CJS_JOINNED):I.log(this._session_name," -> 加入Channel失败.",t)}},{key:"_mcuConferenceJoinSuccessHandler",value:function(e){I.log("创建Ape->","SessionId",this._session_id,"SessionName",this._session_name,"SessionTag",this._session_tag),this._confInfo=e;var t=new f.default.RCSessionJoinRequestPdu;t.id=this._session_id,t.name=this._session_name,t.tag=this._session_tag,t.sessionData=this._adapter_pdu.toArrayBuffer(),this.sendUniform(t,!0);var n=new f.default.RCChannelJoinRequestPdu;n.initiator=this.mcu.confInfo.nodeId,n.channelId=this._session_id,this.send(n)}},{key:"registerKey",value:function(e,t,n,r){var i=new f.default.RCAdapterItemPdu;i.type=f.default.RCPDU_REG_REGISTER_KEY;var o=new f.default.RCRegistryRegisterKeyPdu;o.id=e,o.name=t,o.tag=n,r.length&&(o.userData=r),i.itemData=o.toArrayBuffer(),this._adapter_pdu.item.push(i)}},{key:"registerObj",value:function(e,t,n,r,i,o){var s=new f.default.RCAdapterItemPdu;s.type=f.default.RCPDU_REG_REGISTER_OBJ;var a=new f.default.RCRegistryRegisterObjPdu;a.type=e,a.objId=t,a.name=n,a.tag=r,i&&(a.owner=i),o.length&&(a.userData=o),s.itemData=a.toArrayBuffer(),this._adapter_pdu.item.push(s)}},{key:"send",value:function(e){I.log("Ape发送数据NORMAL PDU",e);var t=f.default.create_normal_pdu(e.type,this._confInfo.nodeId,this._confInfo.confId,this._session_id,this._channel_id,!0,!0,b.default.DP_TOP,this._confInfo.topNodeID,b.default.SEG_ONCE);t.data=e.toArrayBuffer(),this.mcu.send(t)}},{key:"sendUniform",value:function(e,t){I.log("Ape发送数据UNIFORM PDU",e);var n=f.default.create_uniform_pdu(e.type,this._confInfo.nodeId,this._confInfo.confId,this._session_id,t?y.default.BROADCAST_CHANNEL_ID:this._channel_id,!0,b.default.DP_TOP,t?this._confInfo.topNodeID:e.peer||0,b.default.SEG_ONCE);n.data=e.toArrayBuffer(),this.mcu.send(n)}}]),t}(h.default),m=v;t.default=m;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(I,"loger","D:/work/McuClient/src/apes/Ape.js"),__REACT_HOT_LOADER__.register(v,"Ape","D:/work/McuClient/src/apes/Ape.js"),__REACT_HOT_LOADER__.register(m,"default","D:/work/McuClient/src/apes/Ape.js"))})()},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){"use strict";function n(){}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.NT_TERMINAL=0,n.NT_MULTIPORT_TERMINAL=1,n.NT_MCU=2,n.DP_TOP=0,n.DP_HIGH=1,n.DP_MEDIUM=2,n.DP_LOW=3,n.SEG_BEGIN=0,n.SEG_END=1,n.SEG_ONCE=2,n.RET_SUCCESS=0,n.RET_USER_REJECTED=1,n.RET_INVALID_CONFERENCE=2,n.RET_INVALID_PASSWORD=3,n.RET_INVALID_CONVENER_PASSWORD=4,n.RET_CHALLENGE_RESPONSE_REQUIRED=5,n.RET_INVALID_CHALLENGE_RESPONSE=6,n.RET_NO_CONNECTION=7,n.RET_FULL_CAPACITY=8;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&__REACT_HOT_LOADER__.register(n,"PduConsts","D:/work/McuClient/src/pdu/PduConsts.js")})()},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(6),f=r(u),l=n(3),h=r(l),d=n(2),c=r(d),E=n(4),_=r(E),p=n(17),g=n(16),R=r(g),y=n(1),T=r(y),C=T.default.getLoger("ConferApe"),S=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.default.CONFERENCE_SESSION_ID,h.default.CONFERENCE_SESSION_NAME,h.default.CONFERENCE_SESSION_TAG));return e.hostNodeId=-1,e.hostUserId="",e.rosters={},e.activeDocId="",e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(_.default.RCPDU_REG_REGISTER_ROSTER,h.default.CONFERENCE_OBJ_ROSTER_ID,h.default.CONFERENCE_OBJ_ROSTER_NAME,h.default.CONFERENCE_OBJ_ROSTER_TAG,0,new ArrayBuffer),e.registerObj(_.default.RCPDU_REG_REGISTER_QUEUE,h.default.CONFERENCE_OBJ_QUEUE_ID,h.default.CONFERENCE_OBJ_QUEUE_NAME,h.default.CONFERENCE_OBJ_QUEUE_TAG,0,new ArrayBuffer),e.registerObj(_.default.RCPDU_REG_REGISTER_TABLE,h.default.CONFERENCE_OBJ_TABLE_ID,h.default.CONFERENCE_OBJ_TABLE_NAME,h.default.CONFERENCE_OBJ_TABLE_TAG,0,new ArrayBuffer),e.registerObj(_.default.RCPDU_REG_REGISTER_COUNTER,h.default.CONFERENCE_OBJ_COUNTER_ID,h.default.CONFERENCE_OBJ_COUNTER_NAME,h.default.CONFERENCE_OBJ_COUNTER_TAG,0,new ArrayBuffer),e.on(_.default.RCPDU_SESSION_JOIN_RESPONSE,e._joinSessionHandler.bind(e)),e}return s(t,e),a(t,[{key:"_joinSessionHandler",value:function(e){var t=this.mcu.mcuConfInfo.self,n=new _.default.RCNodeInfoUserDataPdu;n.qq="",n.skype="",n.mobile="",t.userData=n.toArrayBuffer(),t.deviceType=3;var r=new _.default.RCRegistryRosterItemPdu;r.nodeId=t.nodeId,r.nodeData=t.toArrayBuffer();var i=new _.default.RCRegistryRosterUpdateItemPdu;i.type=_.default.RCPDU_REG_ROSTER_UPDATE_PDU,i.items.push(r);var o=new _.default.RCRegistryUpdateObjPdu;o.objId=h.default.CONFERENCE_OBJ_ROSTER_ID,o.subType=i.type,o.userData=i.toArrayBuffer();var s=new _.default.RCAdapterItemPdu;s.type=_.default.RCPDU_REG_UPDATE_OBJ,s.itemData=o.toArrayBuffer();var a=new _.default.RCAdapterPdu;a.type=_.default.RCPDU_REG_ADAPTER,a.item.push(s),this.sendUniform(a,!0)}},{key:"tableUpdateHandler",value:function(e,t,n){try{var r=_.default.RCTabUpdateDataRequestPdu.decode(n),i=new p.Zlib.Inflate(r.action.compact().view).decompress(),o=R.default.getStringFromBytes(i),s=o.match(/<TabType>(.+)<\/TabType>/);s.length>1&&"show.docsharing"==s[1]&&"true"==o.match(/<visible>(.+)<\/visible>/)[1]&&(this.activeDocId=o.match(/<TabID>(.+)<\/TabID>/)[1],this.emit(c.default.DOC_SWITCH,this.activeDocId))}catch(e){C.warn("ConferApe table update got exception.")}}},{key:"rosterInsertHandler",value:function(e,t){this.rosterUpdateHandler(e,t)}},{key:"rosterUpdateHandler",value:function(e,t){t.role!==h.default.NR_MASTER&&t.role!==h.default.NR_SLAVE||(this.hostNodeId=t.nodeId,this.hostUserId=t.userId),t.role===h.default.NR_NORMAL&&this.hostNodeId===t.nodeId&&(this.hostNodeId=-1,this.hostUserId="");var n=this.rosters[e];this.rosters[e]=t,n||this.emitRosterChange()}},{key:"rosterDelHandler",value:function(e){delete this.rosters[e],this.emitRosterChange(),e==this._confInfo.nodeId&&this.emit(c.default.CONFERENCE_EXIT)}},{key:"emitRosterChange",value:function(){this.emit(c.default.CONFERENCE_SHOW_ROSTER_NUM,Object.keys(this.rosters).length)}}]),t}(f.default),b=S;t.default=b;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(C,"loger","D:/work/McuClient/src/apes/ConferApe.js"),__REACT_HOT_LOADER__.register(S,"ConferApe","D:/work/McuClient/src/apes/ConferApe.js"),__REACT_HOT_LOADER__.register(b,"default","D:/work/McuClient/src/apes/ConferApe.js"))})()},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){n(this,e)}return r(e,null,[{key:"ab2str",value:function(e){return String.fromCharCode.apply(null,new Uint16Array(e))}},{key:"str2ab",value:function(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint16Array(t),r=0,i=e.length;r<i;r++)n[r]=e.charCodeAt(r);return t}},{key:"strToUint8Array",value:function(e){var t=void 0,n=void 0,r=void 0,i=void 0;t="",r=e.length;var o=[];for(n=0;n<r;n++)i=e.charCodeAt(n),i>=1&&i<=127?o.push(i):i>2047?(o.push(224|i>>12&15),o.push(128|i>>6&63),o.push(128|i>>0&63)):(o.push(192|i>>6&31),o.push(128|i>>0&63));return new Uint8Array(o)}},{key:"uint8ArrayToStr",value:function(e,t){var n=void 0,r=void 0,i=void 0,o=void 0,s=void 0,a=void 0;for(n="",i=e.buffer.byteLength,r=e.offset+t;r<e.limit;)switch(o=e.view[r++],o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:n+=String.fromCharCode(e.view[r-1]);break;case 12:case 13:s=e.view[r++],n+=String.fromCharCode((31&o)<<6|63&s);break;case 14:s=e.view[r++],a=e.view[r++],n+=String.fromCharCode((15&o)<<12|(63&s)<<6|(63&a)<<0)}return n}}]),e}(),o=i;t.default=o;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"ArrayBufferUtil","D:/work/McuClient/src/libs/ArrayBufferUtil.js"),__REACT_HOT_LOADER__.register(o,"default","D:/work/McuClient/src/libs/ArrayBufferUtil.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(5),f=r(u),l=n(2),h=r(l),d=n(1),c=r(d),E=n(25),_=r(E),p=n(4),g=r(p),R=n(13),y=r(R),T=n(8),C=r(T),S=n(3),b=r(S),I=n(10),v=(r(I),n(11)),m=r(v),N=n(28),O=r(N),A=c.default.getLoger("MCU"),P=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._apes={},e._everSocket=_.default,e._everSocket.on(_.default.OPEN,e._everSocketOpenHandler.bind(e)),e._everSocket.on(_.default.MESSAGE,e._everSocketMsgReceivedHandler.bind(e)),e}return s(t,e),a(t,[{key:"registerApe",value:function(e){this._apes[e._session_id]=e}},{key:"_everSocketOpenHandler",value:function(){A.log("MCU-发送加入会议请求.");var e=this.confInfo;e.nodeId=parseInt(Date.now()/1e3);var t=new g.default.RCConferenceJoinRequestPdu;t.type=2,t.initiator=e.nodeId,t.nodeType=C.default.NT_TERMINAL;var n=new g.default.RCConferenceDescriptorPdu;n.id=e.confId,n.name=new ArrayBuffer,n.mode=0,n.capacity=1,t.confDesc=n;var r=g.default.create_connect_provider_request_pdu(t.type,e.nodeId,e.confId,0,b.default.BROADCAST_CHANNEL_ID,!0,C.default.DP_TOP,e.topNodeID,C.default.SEG_ONCE);r.set("site",e.siteId),r.set("userId",e.userId),r.set("userName",O.default.fromByteArray(m.default.strToUint8Array(e.userName))),r.set("userRole",e.userRole),r.set("deviceType",""),r.set("data",t.toArrayBuffer()),this._everSocket.send(r.toArrayBuffer())}},{key:"_everSocketMsgReceivedHandler",value:function(e){var t=g.default.decode_pdu(e),n=t.get("type"),r=t.get("data");switch(A.log("MCU-FirstLayer封装消息","type",g.default.id2type(t.type),t.type,"sessionId",(0,b.default)(t.sessionId),t.sessionId),n){case y.default.RCPDU_CONNECT_PROVIDER_RESPONSE:var i=g.default.RCConferenceJoinResponsePdu.decode(r),o=i.get("result");switch(o){case C.default.RET_SUCCESS:this._updateMCUConfInfoDesc(i.get("confDesc")),this.emit(h.default.CONFERENCE_JOIN_SUCCESS,this.confInfo);break;case C.default.RET_FULL_CAPACITY:this.emit(h.default.CONFERENCE_JOIN_FULL);break;default:A.warn("JoinConfPdu-未知类型-等待处理.",o)}break;case y.default.RCPDU_SEND_DATA_REQUEST:var s=this._apes[t.sessionId],a=(0,b.default)(t.sessionId);if(s){var u=g.default.id2type(t.subType);A.log("MCU-SecondLayer封装消息","sessionId",a,t.sessionId,"subtype",u,t.subType),s.emit(t.subType,t.data)}else A.warn(a+"尚未注册");break;default:A.warn("PDU-未知类型-等待处理.",n)}}},{key:"_updateMCUConfInfoDesc",value:function(e){var t=this.mcuConfInfo.info;t._conference_name=m.default.uint8ArrayToStr(e.name,0),t._capacity=e.capacity,t._mode=e.mode}},{key:"send",value:function(e){this.connected?(A.log("MCU-发送会议数据....",e),this._everSocket.send(e.toArrayBuffer())):A.log("MCU-发送会议数据失败,MCU底层通道不可用")}},{key:"leaveMCU",value:function(){this._everSocket.end()}},{key:"joinMCU",value:function(e){A.log("开始建立EverSocket通道.",e),e.confId=parseInt(e.confId),this.confInfo=e;var t=new g.default.RCNodeInfoRecordPdu;t.name=this.confInfo.userName,t.nodeId=this.confInfo.nodeId,t.userId=this.confInfo.userId,t.role=1,t.level=0;var n={};n._conference_id=this.confInfo.confId,n._top_node_id=this.confInfo.topNodeID,this.mcuConfInfo={},this.mcuConfInfo.self=t,this.mcuConfInfo.info=n,this.confInfo.mcuConfInfo=this.mcuConfInfo,this._everSocket.begin(this.confInfo.MCUServerIP,this.confInfo.MCUServerPort)}},{key:"connected",get:function(){return!(!this._everSocket||!this._everSocket.connected)}}]),t}(f.default),w=new P;t.default=w;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(A,"loger","D:/work/McuClient/src/mcu.js"),__REACT_HOT_LOADER__.register(P,"MCU","D:/work/McuClient/src/mcu.js"),__REACT_HOT_LOADER__.register(w,"default","D:/work/McuClient/src/mcu.js"))})()},function(e,t){"use strict";function n(e){}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.RCPDU_CONNECT_PROVIDER_REQUEST=0,n.RCPDU_CONNECT_PROVIDER_RESPONSE=1,n.RCPDU_CONFERENCE_JOIN_REQUEST=2,n.RCPDU_CONFERENCE_JOIN_RESPONSE=3,n.RCPDU_CONFERENCE_INVITE_REQUEST=10,n.RCPDU_CONFERENCE_INVITE_RESPONSE=11,n.RCPDU_CONFERENCE_LOCK_REQUEST=20,n.RCPDU_CONFERENCE_LOCK_RESPONSE=21,n.RCPDU_CONFERENCE_LOCK_INDICATION=22,n.RCPDU_CONFERENCE_UNLOCK_REQUEST=30,n.RCPDU_CONFERENCE_UNLOCK_RESPONSE=31,n.RCPDU_CONFERENCE_UNLOCK_INDICATION=32,n.RCPDU_CONFERENCE_LEAVE_REQUEST=39,n.RCPDU_CONFERENCE_TERMINATE_REQUEST=40,n.RCPDU_CONFERENCE_TERMINATE_RESPONSE=41,n.RCPDU_CONFERENCE_TERMINATE_INDICATION=42,n.RCPDU_CONFERENCE_EJECT_USER_REQUEST=50,n.RCPDU_CONFERENCE_EJECT_USER_RESPONSE=51,n.RCPDU_CONFERENCE_EJECT_USER_INDICATION=52,n.RCPDU_ROSTER_UPDATE_INDICATION=60,n.RCPDU_REGISTRY_UPDATE_REQUEST=70,n.RCPDU_REGISTRY_UPDATE_RESPONSE=71,n.RCPDU_REGISTRY_UPDATE_INDICATION=72,n.RCPDU_FUNCTION_NOT_SUPPORTED_RESPONSE=80,n.RCPDU_SESSION_JOIN_REQUEST=90,n.RCPDU_SESSION_JOIN_RESPONSE=91,n.RCPDU_CHANNEL_GRAB_REQUEST=100,n.RCPDU_CHANNEL_GRAB_RESPONSE=101,n.RCPDU_CHANNEL_GRAB_INDICATION=102,n.RCPDU_CHANNEL_JOIN_REQUEST=103,n.RCPDU_CHANNEL_JOIN_RESPONSE=104,n.RCPDU_CHANNEL_LEAVE_REQUEST=105,n.RCPDU_CHANNEL_RELEASE_REQUEST=106,n.RCPDU_CHANNEL_RELEASE_INDICATION=107,n.RCPDU_SEND_DATA_REQUEST=120,n.RCPDU_SEND_DATA_REQUEST=120,n.RCPDU_SEND_DATA_INDICATION=121,n.RCPDU_UNIFORM_SEND_DATA_REQUEST=125,n.RCPDU_UNIFORM_SEND_DATA_INDICATION=126,n.RCPDU_TOKEN_GRAB_REQUEST=130,n.RCPDU_TOKEN_GRAB_CONFIRM=131,n.RCPDU_TOKEN_INHIBIT_REQUEST=132,n.RCPDU_TOKEN_INHIBIT_CONFIRM=133,n.RCPDU_TOKEN_GIVE_REQUEST=134,n.RCPDU_TOKEN_GIVE_INDICATION=135,n.RCPDU_TOKEN_GIVE_RESPONSE=136,n.RCPDU_TOKEN_GIVE_CONFIRM=137,n.RCPDU_TOKEN_PLEASE_REQUEST=138,n.RCPDU_TOKEN_PLEASE_INDICATION=139,n.RCPDU_TOKEN_RELEASE_REQUEST=140,n.RCPDU_TOKEN_RELEASE_CONFIRM=141,n.RCPDU_TOKEN_TEST_REQUEST=142,n.RCPDU_TOKEN_TEST_CONFIRM=143,n.RCPDU_REG_REGISTER_KEY=200,n.RCPDU_REG_UNREGISTER_KEY=201,n.RCPDU_REG_REGISTER_ROSTER=202,n.RCPDU_REG_REGISTER_TOKEN=203,n.RCPDU_REG_REGISTER_PARAMETER=204,n.RCPDU_REG_REGISTER_COUNTER=205,n.RCPDU_REG_REGISTER_TABLE=206,n.RCPDU_REG_REGISTER_CACHE=207,n.RCPDU_REG_REGISTER_OBJ=208,n.RCPDU_REG_UNREGISTER_OBJ=209,n.RCPDU_REG_UPDATE_OBJ=210,n.RCPDU_REG_ADAPTER=211,n.RCPDU_REG_CLEANUP_NODE=212,n.RCPDU_REG_REGISTER_QUEUE=213,n.RCPDU_REG_TABLE_INSERT_PDU=230,n.RCPDU_REG_TABLE_DELETE_PDU=231,n.RCPDU_REG_TABLE_UPDATE_PDU=232,n.RCPDU_REG_ROSTER_INSERT_PDU=240,n.RCPDU_REG_ROSTER_DELETE_PDU=241,n.RCPDU_REG_ROSTER_UPDATE_PDU=242,n.RCPDU_REG_PARAMETER_UPDATE_PDU=250,n.RCPDU_REG_QUEUE_INSERT_PDU=255,n.RCPDU_REG_QUEUE_DELETE_PDU=256,n.RCPDU_REG_QUEUE_UPDATE_PDU=257,n.RCPDU_CONFERENCE_SEND_DATA_REQUEST=259,n.RCPDU_VIDEO_SEND_DATA_REQUEST=260,n.RCPDU_AUDIO_SEND_DATA_REQUEST=261,n.RCPDU_GIFT_SEND_DATA_REQUEST=262,n.RCPDU_CHAT_SEND_DATA_REQUEST=263,
-n.RCPDU_VOTING_POLL_RECORD=265,n.RCPDU_REG_REQUEST_OBJ=290,n.RCPDU_REG_RESPONSE_OBJ=291,n.RCPDU_REG_COUNTER_REQUEST_PDU=292,n.RCPDU_REG_COUNTER_RESPONSE_PDU=293,n.RCPDU_INDEX_ADAPTER=300,n.RCPDU_INDEX_SERVER_USERS=301,n.RCPDU_INDEX_CONFERENCE_USER_JOINED=302,n.RCPDU_INDEX_CONFERENCE_USER_EXITED=303,n.RCPDU_INDEX_CONFERENCE_USERS=304;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&__REACT_HOT_LOADER__.register(n,"RCPduPackage","D:/work/McuClient/src/pdu/PduType.js")})()},function(e,t,n){var r,i,o;(function(e){!function(s,a){n(9).amd?(i=[n(15)],r=a,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(e.exports=o))):"object"==typeof e&&e&&e.exports?e.exports=function(){var e;try{e=n(15)}catch(e){}return a(e)}():(s.dcodeIO=s.dcodeIO||{}).ByteBuffer=a(s.dcodeIO.Long)}(this,function(e){"use strict";function t(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function n(){var e=[],t=[];return function(){return 0===arguments.length?t.join("")+u.apply(String,e):(e.length+arguments.length>1024&&(t.push(u.apply(String,e)),e.length=0),void Array.prototype.push.apply(e,arguments))}}function r(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,f=u>>1,l=-7,h=n?i-1:0,d=n?-1:1,c=e[t+h];for(h+=d,o=c&(1<<-l)-1,c>>=-l,l+=a;l>0;o=256*o+e[t+h],h+=d,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+h],h+=d,l-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:(c?-1:1)*(1/0);s+=Math.pow(2,r),o-=f}return(c?-1:1)*s*Math.pow(2,o-r)}function i(e,t,n,r,i,o){var s,a,u,f=8*o-i-1,l=(1<<f)-1,h=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,c=r?0:o-1,E=r?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+h>=1?d/u:d*Math.pow(2,1-h),t*u>=2&&(s++,u/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(t*u-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[n+c]=255&a,c+=E,a/=256,i-=8);for(s=s<<i|a,f+=i;f>0;e[n+c]=255&s,c+=E,s/=256,f-=8);e[n+c-E]|=128*_}var o=function(e,t,n){if("undefined"==typeof e&&(e=o.DEFAULT_CAPACITY),"undefined"==typeof t&&(t=o.DEFAULT_ENDIAN),"undefined"==typeof n&&(n=o.DEFAULT_NOASSERT),!n){if(e|=0,e<0)throw RangeError("Illegal capacity");t=!!t,n=!!n}this.buffer=0===e?a:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=t,this.noAssert=n};o.VERSION="5.0.1",o.LITTLE_ENDIAN=!0,o.BIG_ENDIAN=!1,o.DEFAULT_CAPACITY=16,o.DEFAULT_ENDIAN=o.BIG_ENDIAN,o.DEFAULT_NOASSERT=!1,o.Long=e||null;var s=o.prototype;s.__isByteBuffer__,Object.defineProperty(s,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var a=new ArrayBuffer(0),u=String.fromCharCode;o.accessor=function(){return Uint8Array},o.allocate=function(e,t,n){return new o(e,t,n)},o.concat=function(e,t,n,r){"boolean"!=typeof t&&"string"==typeof t||(r=n,n=t,t=void 0);for(var i,s=0,a=0,u=e.length;a<u;++a)o.isByteBuffer(e[a])||(e[a]=o.wrap(e[a],t)),i=e[a].limit-e[a].offset,i>0&&(s+=i);if(0===s)return new o(0,n,r);var f,l=new o(s,n,r);for(a=0;a<u;)f=e[a++],i=f.limit-f.offset,i<=0||(l.view.set(f.view.subarray(f.offset,f.limit),l.offset),l.offset+=i);return l.limit=l.offset,l.offset=0,l},o.isByteBuffer=function(e){return(e&&e.__isByteBuffer__)===!0},o.type=function(){return ArrayBuffer},o.wrap=function(e,t,n,r){if("string"!=typeof t&&(r=n,n=t,t=void 0),"string"==typeof e)switch("undefined"==typeof t&&(t="utf8"),t){case"base64":return o.fromBase64(e,n);case"hex":return o.fromHex(e,n);case"binary":return o.fromBinary(e,n);case"utf8":return o.fromUTF8(e,n);case"debug":return o.fromDebug(e,n);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");var i;if(o.isByteBuffer(e))return i=s.clone.call(e),i.markedOffset=-1,i;if(e instanceof Uint8Array)i=new o(0,n,r),e.length>0&&(i.buffer=e.buffer,i.offset=e.byteOffset,i.limit=e.byteOffset+e.byteLength,i.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)i=new o(0,n,r),e.byteLength>0&&(i.buffer=e,i.offset=0,i.limit=e.byteLength,i.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");i=new o(e.length,n,r),i.limit=e.length;for(var a=0;a<e.length;++a)i.view[a]=e[a]}return i},s.writeBitSet=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,i=t,o=e.length,s=o>>3,a=0;for(t+=this.writeVarint32(o,t);s--;)r=1&!!e[a++]|(1&!!e[a++])<<1|(1&!!e[a++])<<2|(1&!!e[a++])<<3|(1&!!e[a++])<<4|(1&!!e[a++])<<5|(1&!!e[a++])<<6|(1&!!e[a++])<<7,this.writeByte(r,t++);if(a<o){var u=0;for(r=0;a<o;)r|=(1&!!e[a++])<<u++;this.writeByte(r,t++)}return n?(this.offset=t,this):t-i},s.readBitSet=function(e){var t="undefined"==typeof e;t&&(e=this.offset);var n,r=this.readVarint32(e),i=r.value,o=i>>3,s=0,a=[];for(e+=r.length;o--;)n=this.readByte(e++),a[s++]=!!(1&n),a[s++]=!!(2&n),a[s++]=!!(4&n),a[s++]=!!(8&n),a[s++]=!!(16&n),a[s++]=!!(32&n),a[s++]=!!(64&n),a[s++]=!!(128&n);if(s<i){var u=0;for(n=this.readByte(e++);s<i;)a[s++]=!!(n>>u++&1)}return t&&(this.offset=e),a},s.readBytes=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}var r=this.slice(t,t+e);return n&&(this.offset+=e),r},s.writeBytes=s.append,s.writeInt8=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},s.writeByte=s.writeInt8,s.readInt8=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=this.view[e];return 128===(128&n)&&(n=-(255-n+1)),t&&(this.offset+=1),n},s.readByte=s.readInt8,s.writeUint8=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},s.writeUInt8=s.writeUint8,s.readUint8=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=this.view[e];return t&&(this.offset+=1),n},s.readUInt8=s.readUint8,s.writeInt16=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},s.writeShort=s.writeInt16,s.readInt16=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e],n|=this.view[e+1]<<8):(n=this.view[e]<<8,n|=this.view[e+1]),32768===(32768&n)&&(n=-(65535-n+1)),t&&(this.offset+=2),n},s.readShort=s.readInt16,s.writeUint16=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},s.writeUInt16=s.writeUint16,s.readUint16=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e],n|=this.view[e+1]<<8):(n=this.view[e]<<8,n|=this.view[e+1]),t&&(this.offset+=2),n},s.readUInt16=s.readUint16,s.writeInt32=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),n&&(this.offset+=4),this},s.writeInt=s.writeInt32,s.readInt32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0),n|=0,t&&(this.offset+=4),n},s.readInt=s.readInt32,s.writeUint32=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),n&&(this.offset+=4),this},s.writeUInt32=s.writeUint32,s.readUint32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0),t&&(this.offset+=4),n},s.readUInt32=s.readUint32,e&&(s.writeInt64=function(t,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),n+=8;var i=this.buffer.byteLength;n>i&&this.resize((i*=2)>n?i:n),n-=8;var o=t.low,s=t.high;return this.littleEndian?(this.view[n+3]=o>>>24&255,this.view[n+2]=o>>>16&255,this.view[n+1]=o>>>8&255,this.view[n]=255&o,n+=4,this.view[n+3]=s>>>24&255,this.view[n+2]=s>>>16&255,this.view[n+1]=s>>>8&255,this.view[n]=255&s):(this.view[n]=s>>>24&255,this.view[n+1]=s>>>16&255,this.view[n+2]=s>>>8&255,this.view[n+3]=255&s,n+=4,this.view[n]=o>>>24&255,this.view[n+1]=o>>>16&255,this.view[n+2]=o>>>8&255,this.view[n+3]=255&o),r&&(this.offset+=8),this},s.writeLong=s.writeInt64,s.readInt64=function(t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=0,i=0;this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0,t+=4,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0,t+=4,r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0);var o=new e(r,i,!1);return n&&(this.offset+=8),o},s.readLong=s.readInt64,s.writeUint64=function(t,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),n+=8;var i=this.buffer.byteLength;n>i&&this.resize((i*=2)>n?i:n),n-=8;var o=t.low,s=t.high;return this.littleEndian?(this.view[n+3]=o>>>24&255,this.view[n+2]=o>>>16&255,this.view[n+1]=o>>>8&255,this.view[n]=255&o,n+=4,this.view[n+3]=s>>>24&255,this.view[n+2]=s>>>16&255,this.view[n+1]=s>>>8&255,this.view[n]=255&s):(this.view[n]=s>>>24&255,this.view[n+1]=s>>>16&255,this.view[n+2]=s>>>8&255,this.view[n+3]=255&s,n+=4,this.view[n]=o>>>24&255,this.view[n+1]=o>>>16&255,this.view[n+2]=o>>>8&255,this.view[n+3]=255&o),r&&(this.offset+=8),this},s.writeUInt64=s.writeUint64,s.readUint64=function(t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=0,i=0;this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0,t+=4,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0,t+=4,r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0);var o=new e(r,i,!0);return n&&(this.offset+=8),o},s.readUInt64=s.readUint64),s.writeFloat32=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,i(this.view,e,t,this.littleEndian,23,4),n&&(this.offset+=4),this},s.writeFloat=s.writeFloat32,s.readFloat32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=r(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),n},s.readFloat=s.readFloat32,s.writeFloat64=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=8;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=8,i(this.view,e,t,this.littleEndian,52,8),n&&(this.offset+=8),this},s.writeDouble=s.writeFloat64,s.readFloat64=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var n=r(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),n},s.readDouble=s.readFloat64,o.MAX_VARINT32_BYTES=5,o.calculateVarint32=function(e){return e>>>=0,e<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},o.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},o.zigZagDecode32=function(e){return e>>>1^-(1&e)|0},s.writeVarint32=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,i=o.calculateVarint32(e);t+=i;var s=this.buffer.byteLength;for(t>s&&this.resize((s*=2)>t?s:t),t-=i,e>>>=0;e>=128;)r=127&e|128,this.view[t++]=r,e>>>=7;return this.view[t++]=e,n?(this.offset=t,this):i},s.writeVarint32ZigZag=function(e,t){return this.writeVarint32(o.zigZagEncode32(e),t)},s.readVarint32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n,r=0,i=0;do{if(!this.noAssert&&e>this.limit){var o=Error("Truncated");throw o.truncated=!0,o}n=this.view[e++],r<5&&(i|=(127&n)<<7*r),++r}while(0!==(128&n));return i|=0,t?(this.offset=e,i):{value:i,length:r}},s.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"==typeof t?t.value=o.zigZagDecode32(t.value):t=o.zigZagDecode32(t),t},e&&(o.MAX_VARINT64_BYTES=10,o.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var n=t.toInt()>>>0,r=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==r?n<16384?n<128?1:2:n<1<<21?3:4:r<16384?r<128?5:6:r<1<<21?7:8:i<128?9:10},o.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):t.unsigned!==!1&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},o.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):t.unsigned!==!1&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},s.writeVarint64=function(t,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):t.unsigned!==!1&&(t=t.toSigned());var i=o.calculateVarint64(t),s=t.toInt()>>>0,a=t.shiftRightUnsigned(28).toInt()>>>0,u=t.shiftRightUnsigned(56).toInt()>>>0;n+=i;var f=this.buffer.byteLength;switch(n>f&&this.resize((f*=2)>n?f:n),n-=i,i){case 10:this.view[n+9]=u>>>7&1;case 9:this.view[n+8]=9!==i?128|u:127&u;case 8:this.view[n+7]=8!==i?a>>>21|128:a>>>21&127;case 7:this.view[n+6]=7!==i?a>>>14|128:a>>>14&127;case 6:this.view[n+5]=6!==i?a>>>7|128:a>>>7&127;case 5:this.view[n+4]=5!==i?128|a:127&a;case 4:this.view[n+3]=4!==i?s>>>21|128:s>>>21&127;case 3:this.view[n+2]=3!==i?s>>>14|128:s>>>14&127;case 2:this.view[n+1]=2!==i?s>>>7|128:s>>>7&127;case 1:this.view[n]=1!==i?128|s:127&s}return r?(this.offset+=i,this):i},s.writeVarint64ZigZag=function(e,t){return this.writeVarint64(o.zigZagEncode64(e),t)},s.readVarint64=function(t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r=t,i=0,o=0,s=0,a=0;if(a=this.view[t++],i=127&a,128&a&&(a=this.view[t++],i|=(127&a)<<7,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],i|=(127&a)<<14,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],i|=(127&a)<<21,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],o=127&a,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],o|=(127&a)<<7,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],o|=(127&a)<<14,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],o|=(127&a)<<21,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],s=127&a,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],s|=(127&a)<<7,128&a||this.noAssert&&"undefined"==typeof a))))))))))throw Error("Buffer overrun");var u=e.fromBits(i|o<<28,o>>>4|s<<24,!1);return n?(this.offset=t,u):{value:u,length:t-r}},s.readVarint64ZigZag=function(t){var n=this.readVarint64(t);return n&&n.value instanceof e?n.value=o.zigZagDecode64(n.value):n=o.zigZagDecode64(n),n}),s.writeCString=function(e,n){var r="undefined"==typeof n;r&&(n=this.offset);var i,o=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(i=0;i<o;++i)if(0===e.charCodeAt(i))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}o=l.calculateUTF16asUTF8(t(e))[1],n+=o+1;var s=this.buffer.byteLength;return n>s&&this.resize((s*=2)>n?s:n),n-=o+1,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),this.view[n++]=0,r?(this.offset=n,this):o},s.readCString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,i=e,o=-1;return l.decodeUTF8toUTF16(function(){if(0===o)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return o=this.view[e++],0===o?null:o}.bind(this),r=n(),!0),t?(this.offset=e,r()):{string:r(),length:e-i}},s.writeIString=function(e,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,o=n;i=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],n+=4+i;var s=this.buffer.byteLength;if(n>s&&this.resize((s*=2)>n?s:n),n-=4+i,this.littleEndian?(this.view[n+3]=i>>>24&255,this.view[n+2]=i>>>16&255,this.view[n+1]=i>>>8&255,this.view[n]=255&i):(this.view[n]=i>>>24&255,this.view[n+1]=i>>>16&255,this.view[n+2]=i>>>8&255,this.view[n+3]=255&i),n+=4,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==o+4+i)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+4+i));return r?(this.offset=n,this):n-o},s.readIString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=e,r=this.readUint32(e),i=this.readUTF8String(r,o.METRICS_BYTES,e+=4);return e+=i.length,t?(this.offset=e,i.string):{string:i.string,length:e-n}},o.METRICS_CHARS="c",o.METRICS_BYTES="b",s.writeUTF8String=function(e,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,o=n;i=l.calculateUTF16asUTF8(t(e))[1],n+=i;var s=this.buffer.byteLength;return n>s&&this.resize((s*=2)>n?s:n),n-=i,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),r?(this.offset=n,this):n-o},s.writeString=s.writeUTF8String,o.calculateUTF8Chars=function(e){return l.calculateUTF16asUTF8(t(e))[0]},o.calculateUTF8Bytes=function(e){return l.calculateUTF16asUTF8(t(e))[1]},o.calculateString=o.calculateUTF8Bytes,s.readUTF8String=function(e,t,r){"number"==typeof t&&(r=t,t=void 0);var i="undefined"==typeof r;if(i&&(r=this.offset),"undefined"==typeof t&&(t=o.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!==0)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,r<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var s,a=0,u=r;if(t===o.METRICS_CHARS){if(s=n(),l.decodeUTF8(function(){return a<e&&r<this.limit?this.view[r++]:null}.bind(this),function(e){++a,l.UTF8toUTF16(e,s)}),a!==e)throw RangeError("Illegal range: Truncated data, "+a+" == "+e);return i?(this.offset=r,s()):{string:s(),length:r-u}}if(t===o.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||r%1!==0)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,r<0||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}var f=r+e;if(l.decodeUTF8toUTF16(function(){return r<f?this.view[r++]:null}.bind(this),s=n(),this.noAssert),r!==f)throw RangeError("Illegal range: Truncated data, "+r+" == "+f);return i?(this.offset=r,s()):{string:s(),length:r-u}}throw TypeError("Unsupported metrics: "+t)},s.readString=s.readUTF8String,s.writeVString=function(e,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,s,a=n;i=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],s=o.calculateVarint32(i),n+=s+i;var u=this.buffer.byteLength;if(n>u&&this.resize((u*=2)>n?u:n),n-=s+i,n+=this.writeVarint32(i,n),l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==a+i+s)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+i+s));return r?(this.offset=n,this):n-a},s.readVString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=e,r=this.readVarint32(e),i=this.readUTF8String(r.value,o.METRICS_BYTES,e+=r.length);return e+=i.length,t?(this.offset=e,i.string):{string:i.string,length:e-n}},s.append=function(e,t,n){"number"!=typeof t&&"string"==typeof t||(n=t,t=void 0);var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof o||(e=o.wrap(e,t));var i=e.limit-e.offset;if(i<=0)return this;n+=i;var s=this.buffer.byteLength;return n>s&&this.resize((s*=2)>n?s:n),n-=i,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=i,r&&(this.offset+=i),this},s.appendTo=function(e,t){return e.append(this,t),this},s.assert=function(e){return this.noAssert=!e,this},s.capacity=function(){return this.buffer.byteLength},s.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},s.clone=function(e){var t=new o(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},s.compact=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(0===e&&t===this.buffer.byteLength)return this;var n=t-e;if(0===n)return this.buffer=a,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var r=new ArrayBuffer(n),i=new Uint8Array(r);return i.set(this.view.subarray(e,t)),this.buffer=r,this.view=i,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=n,this},s.copy=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new o(0,this.littleEndian,this.noAssert);var n=t-e,r=new o(n,this.littleEndian,this.noAssert);return r.offset=0,r.limit=n,r.markedOffset>=0&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},s.copyTo=function(e,t,n,r){var i,s;if(!this.noAssert&&!o.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(s="undefined"==typeof t)?e.offset:0|t,n=(i="undefined"==typeof n)?this.offset:0|n,r="undefined"==typeof r?this.limit:0|r,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(n<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);
-var a=r-n;return 0===a?e:(e.ensureCapacity(t+a),e.view.set(this.view.subarray(n,r),t),i&&(this.offset+=a),s&&(e.offset+=a),this)},s.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},s.fill=function(e,t,n){var r="undefined"==typeof t;if(r&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),"undefined"==typeof t&&(t=this.offset),"undefined"==typeof n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!==0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(t>=n)return this;for(;t<n;)this.view[t++]=e;return r&&(this.offset=t),this},s.flip=function(){return this.limit=this.offset,this.offset=0,this},s.mark=function(e){if(e="undefined"==typeof e?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},s.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},s.LE=function(e){return this.littleEndian="undefined"==typeof e||!!e,this},s.BE=function(e){return this.littleEndian="undefined"!=typeof e&&!e,this},s.prepend=function(e,t,n){"number"!=typeof t&&"string"==typeof t||(n=t,t=void 0);var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof o||(e=o.wrap(e,t));var i=e.limit-e.offset;if(i<=0)return this;var s=i-n;if(s>0){var a=new ArrayBuffer(this.buffer.byteLength+s),u=new Uint8Array(a);u.set(this.view.subarray(n,this.buffer.byteLength),i),this.buffer=a,this.view=u,this.offset+=s,this.markedOffset>=0&&(this.markedOffset+=s),this.limit+=s,n+=s}else{new Uint8Array(this.buffer)}return this.view.set(e.view.subarray(e.offset,e.limit),n-i),e.offset=e.limit,r&&(this.offset-=i),this},s.prependTo=function(e,t){return e.prepend(this,t),this},s.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},s.remaining=function(){return this.limit-this.offset},s.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},s.resize=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if(e|=0,e<0)throw RangeError("Illegal capacity: 0 <= "+e)}if(this.buffer.byteLength<e){var t=new ArrayBuffer(e),n=new Uint8Array(t);n.set(this.view),this.buffer=t,this.view=n}return this},s.reverse=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t?this:(Array.prototype.reverse.call(this.view.subarray(e,t)),this)},s.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},s.slice=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var n=this.clone();return n.offset=e,n.limit=t,n},s.toBuffer=function(e){var t=this.offset,n=this.limit;if(!this.noAssert){if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!==0)throw TypeError("Illegal limit: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(!e&&0===t&&n===this.buffer.byteLength)return this.buffer;if(t===n)return a;var r=new ArrayBuffer(n-t);return new Uint8Array(r).set(new Uint8Array(this.buffer).subarray(t,n),0),r},s.toArrayBuffer=s.toBuffer,s.toString=function(e,t,n){if("undefined"==typeof e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(e="utf8",t=e,n=t),e){case"utf8":return this.toUTF8(t,n);case"base64":return this.toBase64(t,n);case"hex":return this.toHex(t,n);case"binary":return this.toBinary(t,n);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var f=function(){for(var e={},t=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],n=[],r=0,i=t.length;r<i;++r)n[t[r]]=r;return e.encode=function(e,n){for(var r,i;null!==(r=e());)n(t[r>>2&63]),i=(3&r)<<4,null!==(r=e())?(i|=r>>4&15,n(t[63&(i|r>>4&15)]),i=(15&r)<<2,null!==(r=e())?(n(t[63&(i|r>>6&3)]),n(t[63&r])):(n(t[63&i]),n(61))):(n(t[63&i]),n(61),n(61))},e.decode=function(e,t){function r(e){throw Error("Illegal character code: "+e)}for(var i,o,s;null!==(i=e());)if(o=n[i],"undefined"==typeof o&&r(i),null!==(i=e())&&(s=n[i],"undefined"==typeof s&&r(i),t(o<<2>>>0|(48&s)>>4),null!==(i=e()))){if(o=n[i],"undefined"==typeof o){if(61===i)break;r(i)}if(t((15&s)<<4>>>0|(60&o)>>2),null!==(i=e())){if(s=n[i],"undefined"==typeof s){if(61===i)break;r(i)}t((3&o)<<6>>>0|s)}}},e.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},e}();s.toBase64=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),e|=0,t|=0,e<0||t>this.capacity||e>t)throw RangeError("begin, end");var r;return f.encode(function(){return e<t?this.view[e++]:null}.bind(this),r=n()),r()},o.fromBase64=function(e,n){if("string"!=typeof e)throw TypeError("str");var r=new o(e.length/4*3,n),i=0;return f.decode(t(e),function(e){r.view[i++]=e}),r.limit=i,r},o.btoa=function(e){return o.fromBinary(e).toBase64()},o.atob=function(e){return o.fromBase64(e).toBinary()},s.toBinary=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),e|=0,t|=0,e<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var n=[],r=[];e<t;)n.push(this.view[e++]),n.length>=1024&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},o.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var n,r=0,i=e.length,s=new o(i,t);r<i;){if(n=e.charCodeAt(r),n>255)throw RangeError("illegal char code: "+n);s.view[r++]=n}return s.limit=i,s},s.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",o="",s="";n<r;){if(n!==-1&&(t=this.view[n],i+=t<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(o+=t>32&&t<127?String.fromCharCode(t):".")),++n,e&&n>0&&n%16===0&&n!==r){for(;i.length<51;)i+=" ";s+=i+o+"\n",i=o=""}i+=n===this.offset&&n===this.limit?n===this.markedOffset?"!":"|":n===this.offset?n===this.markedOffset?"[":"<":n===this.limit?n===this.markedOffset?"]":">":n===this.markedOffset?"'":e||0!==n&&n!==r?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";s+=i+o+"\n"}return e?s:i},o.fromDebug=function(e,t,n){for(var r,i,s=e.length,a=new o((s+1)/3|0,t,n),u=0,f=0,l=!1,h=!1,d=!1,c=!1,E=!1;u<s;){switch(r=e.charAt(u++)){case"!":if(!n){if(h||d||c){E=!0;break}h=d=c=!0}a.offset=a.markedOffset=a.limit=f,l=!1;break;case"|":if(!n){if(h||c){E=!0;break}h=c=!0}a.offset=a.limit=f,l=!1;break;case"[":if(!n){if(h||d){E=!0;break}h=d=!0}a.offset=a.markedOffset=f,l=!1;break;case"<":if(!n){if(h){E=!0;break}h=!0}a.offset=f,l=!1;break;case"]":if(!n){if(c||d){E=!0;break}c=d=!0}a.limit=a.markedOffset=f,l=!1;break;case">":if(!n){if(c){E=!0;break}c=!0}a.limit=f,l=!1;break;case"'":if(!n){if(d){E=!0;break}d=!0}a.markedOffset=f,l=!1;break;case" ":l=!1;break;default:if(!n&&l){E=!0;break}if(i=parseInt(r+e.charAt(u++),16),!n&&(isNaN(i)||i<0||i>255))throw TypeError("Illegal str: Not a debug encoded string");a.view[f++]=i,l=!0}if(E)throw TypeError("Illegal str: Invalid symbol at "+u)}if(!n){if(!h||!c)throw TypeError("Illegal str: Missing offset or limit");if(f<a.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+f+" < "+s)}return a},s.toHex=function(e,t){if(e="undefined"==typeof e?this.offset:e,t="undefined"==typeof t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var n,r=new Array(t-e);e<t;)n=this.view[e++],n<16?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},o.fromHex=function(e,t,n){if(!n){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!==0)throw TypeError("Illegal str: Length not a multiple of 2")}for(var r,i=e.length,s=new o(i/2|0,t),a=0,u=0;a<i;a+=2){if(r=parseInt(e.substring(a,a+2),16),!n&&(!isFinite(r)||r<0||r>255))throw TypeError("Illegal str: Contains non-hex characters");s.view[u++]=r}return s.limit=u,s};var l=function(){var e={};return e.MAX_CODEPOINT=1114111,e.encodeUTF8=function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):n<2048?(t(n>>6&31|192),t(63&n|128)):n<65536?(t(n>>12&15|224),t(n>>6&63|128),t(63&n|128)):(t(n>>18&7|240),t(n>>12&63|128),t(n>>6&63|128),t(63&n|128)),n=null},e.decodeUTF8=function(e,t){for(var n,r,i,o,s=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(n=e());)if(0===(128&n))t(n);else if(192===(224&n))null===(r=e())&&s([n,r]),t((31&n)<<6|63&r);else if(224===(240&n))(null===(r=e())||null===(i=e()))&&s([n,r,i]),t((15&n)<<12|(63&r)<<6|63&i);else{if(240!==(248&n))throw RangeError("Illegal starting byte: "+n);(null===(r=e())||null===(i=e())||null===(o=e()))&&s([n,r,i,o]),t((7&n)<<18|(63&r)<<12|(63&i)<<6|63&o)}},e.UTF16toUTF8=function(e,t){for(var n,r=null;;){if(null===(n=null!==r?r:e()))break;n>=55296&&n<=57343&&null!==(r=e())&&r>=56320&&r<=57343?(t(1024*(n-55296)+r-56320+65536),r=null):t(n)}null!==r&&t(r)},e.UTF8toUTF16=function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<=65535?t(n):(n-=65536,t((n>>10)+55296),t(n%1024+56320)),n=null},e.encodeUTF16toUTF8=function(t,n){e.UTF16toUTF8(t,function(t){e.encodeUTF8(t,n)})},e.decodeUTF8toUTF16=function(t,n){e.decodeUTF8(t,function(t){e.UTF8toUTF16(t,n)})},e.calculateCodePoint=function(e){return e<128?1:e<2048?2:e<65536?3:4},e.calculateUTF8=function(e){for(var t,n=0;null!==(t=e());)n+=t<128?1:t<2048?2:t<65536?3:4;return n},e.calculateUTF16asUTF8=function(t){var n=0,r=0;return e.UTF16toUTF8(t,function(e){++n,r+=e<128?1:e<2048?2:e<65536?3:4}),[n,r]},e}();return s.toUTF8=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;try{l.decodeUTF8toUTF16(function(){return e<t?this.view[e++]:null}.bind(this),r=n())}catch(n){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},o.fromUTF8=function(e,n,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new o(l.calculateUTF16asUTF8(t(e),!0)[1],n,r),s=0;return l.encodeUTF16toUTF8(t(e),function(e){i.view[s++]=e}),i.limit=s,i},o})}).call(t,n(7)(e))},function(e,t,n){var r,i,o;(function(e){!function(s,a){n(9).amd?(i=[],r=a,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(e.exports=o))):"object"==typeof e&&e&&e.exports?e.exports=a():(s.dcodeIO=s.dcodeIO||{}).Long=a()}(this,function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return(e&&e.__isLong__)===!0}function n(e,t){var n,r,o;return t?(e>>>=0,(o=0<=e&&e<256)&&(r=u[e])?r:(n=i(e,(0|e)<0?-1:0,!0),o&&(u[e]=n),n)):(e|=0,(o=-128<=e&&e<128)&&(r=a[e])?r:(n=i(e,e<0?-1:0,!1),o&&(a[e]=n),n))}function r(e,t){if(isNaN(e)||!isFinite(e))return t?p:_;if(t){if(e<0)return p;if(e>=d)return C}else{if(e<=-c)return S;if(e+1>=c)return T}return e<0?r(-e,t).neg():i(e%h|0,e/h|0,t)}function i(t,n,r){return new e(t,n,r)}function o(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return _;if("number"==typeof t?(n=t,t=!1):t=!!t,n=n||10,n<2||36<n)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return o(e.substring(1),t,n).neg();for(var s=r(f(n,8)),a=_,u=0;u<e.length;u+=8){var l=Math.min(8,e.length-u),h=parseInt(e.substring(u,u+l),n);if(l<8){var d=r(f(n,l));a=a.mul(d).add(r(h))}else a=a.mul(s),a=a.add(r(h))}return a.unsigned=t,a}function s(t){return t instanceof e?t:"number"==typeof t?r(t):"string"==typeof t?o(t):i(t.low,t.high,t.unsigned)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var a={},u={};e.fromInt=n,e.fromNumber=r,e.fromBits=i;var f=Math.pow;e.fromString=o,e.fromValue=s;var l=1<<24,h=4294967296,d=0x10000000000000000,c=d/2,E=n(l),_=n(0);e.ZERO=_;var p=n(0,!0);e.UZERO=p;var g=n(1);e.ONE=g;var R=n(1,!0);e.UONE=R;var y=n(-1);e.NEG_ONE=y;var T=i(-1,2147483647,!1);e.MAX_VALUE=T;var C=i(-1,-1,!0);e.MAX_UNSIGNED_VALUE=C;var S=i(0,-2147483648,!1);e.MIN_VALUE=S;var b=e.prototype;return b.toInt=function(){return this.unsigned?this.low>>>0:this.low},b.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},b.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(S)){var t=r(e),n=this.div(t),i=n.mul(t).sub(this);return n.toString(e)+i.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var o=r(f(e,6),this.unsigned),s=this,a="";;){var u=s.div(o),l=s.sub(u.mul(o)).toInt()>>>0,h=l.toString(e);if(s=u,s.isZero())return h+a;for(;h.length<6;)h="0"+h;a=""+h+a}},b.getHighBits=function(){return this.high},b.getHighBitsUnsigned=function(){return this.high>>>0},b.getLowBits=function(){return this.low},b.getLowBitsUnsigned=function(){return this.low>>>0},b.getNumBitsAbs=function(){if(this.isNegative())return this.eq(S)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},b.isZero=function(){return 0===this.high&&0===this.low},b.isNegative=function(){return!this.unsigned&&this.high<0},b.isPositive=function(){return this.unsigned||this.high>=0},b.isOdd=function(){return 1===(1&this.low)},b.isEven=function(){return 0===(1&this.low)},b.equals=function(e){return t(e)||(e=s(e)),(this.unsigned===e.unsigned||this.high>>>31!==1||e.high>>>31!==1)&&(this.high===e.high&&this.low===e.low)},b.eq=b.equals,b.notEquals=function(e){return!this.eq(e)},b.neq=b.notEquals,b.lessThan=function(e){return this.comp(e)<0},b.lt=b.lessThan,b.lessThanOrEqual=function(e){return this.comp(e)<=0},b.lte=b.lessThanOrEqual,b.greaterThan=function(e){return this.comp(e)>0},b.gt=b.greaterThan,b.greaterThanOrEqual=function(e){return this.comp(e)>=0},b.gte=b.greaterThanOrEqual,b.compare=function(e){if(t(e)||(e=s(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},b.comp=b.compare,b.negate=function(){return!this.unsigned&&this.eq(S)?S:this.not().add(g)},b.neg=b.negate,b.add=function(e){t(e)||(e=s(e));var n=this.high>>>16,r=65535&this.high,o=this.low>>>16,a=65535&this.low,u=e.high>>>16,f=65535&e.high,l=e.low>>>16,h=65535&e.low,d=0,c=0,E=0,_=0;return _+=a+h,E+=_>>>16,_&=65535,E+=o+l,c+=E>>>16,E&=65535,c+=r+f,d+=c>>>16,c&=65535,d+=n+u,d&=65535,i(E<<16|_,d<<16|c,this.unsigned)},b.subtract=function(e){return t(e)||(e=s(e)),this.add(e.neg())},b.sub=b.subtract,b.multiply=function(e){if(this.isZero())return _;if(t(e)||(e=s(e)),e.isZero())return _;if(this.eq(S))return e.isOdd()?S:_;if(e.eq(S))return this.isOdd()?S:_;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(E)&&e.lt(E))return r(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,o=65535&this.high,a=this.low>>>16,u=65535&this.low,f=e.high>>>16,l=65535&e.high,h=e.low>>>16,d=65535&e.low,c=0,p=0,g=0,R=0;return R+=u*d,g+=R>>>16,R&=65535,g+=a*d,p+=g>>>16,g&=65535,g+=u*h,p+=g>>>16,g&=65535,p+=o*d,c+=p>>>16,p&=65535,p+=a*h,c+=p>>>16,p&=65535,p+=u*l,c+=p>>>16,p&=65535,c+=n*d+o*h+a*l+u*f,c&=65535,i(g<<16|R,c<<16|p,this.unsigned)},b.mul=b.multiply,b.divide=function(e){if(t(e)||(e=s(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?p:_;var n,i,o;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return p;if(e.gt(this.shru(1)))return R;o=p}else{if(this.eq(S)){if(e.eq(g)||e.eq(y))return S;if(e.eq(S))return g;var a=this.shr(1);return n=a.div(e).shl(1),n.eq(_)?e.isNegative()?g:y:(i=this.sub(e.mul(n)),o=n.add(i.div(e)))}if(e.eq(S))return this.unsigned?p:_;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=_}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var u=Math.ceil(Math.log(n)/Math.LN2),l=u<=48?1:f(2,u-48),h=r(n),d=h.mul(e);d.isNegative()||d.gt(i);)n-=l,h=r(n,this.unsigned),d=h.mul(e);h.isZero()&&(h=g),o=o.add(h),i=i.sub(d)}return o},b.div=b.divide,b.modulo=function(e){return t(e)||(e=s(e)),this.sub(this.div(e).mul(e))},b.mod=b.modulo,b.not=function(){return i(~this.low,~this.high,this.unsigned)},b.and=function(e){return t(e)||(e=s(e)),i(this.low&e.low,this.high&e.high,this.unsigned)},b.or=function(e){return t(e)||(e=s(e)),i(this.low|e.low,this.high|e.high,this.unsigned)},b.xor=function(e){return t(e)||(e=s(e)),i(this.low^e.low,this.high^e.high,this.unsigned)},b.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0===(e&=63)?this:e<32?i(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):i(0,this.low<<e-32,this.unsigned)},b.shl=b.shiftLeft,b.shiftRight=function(e){return t(e)&&(e=e.toInt()),0===(e&=63)?this:e<32?i(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):i(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},b.shr=b.shiftRight,b.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),e&=63,0===e)return this;var n=this.high;if(e<32){var r=this.low;return i(r>>>e|n<<32-e,n>>>e,this.unsigned)}return 32===e?i(n,0,this.unsigned):i(n>>>e-32,0,this.unsigned)},b.shru=b.shiftRightUnsigned,b.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},b.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},b.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},b.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},b.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})}).call(t,n(7)(e))},function(e,t,n){(function(e){e.require&&(n(30),n(31));var t={isNotUTF8:function(e,n,r){try{t.getStringFromBytes(e,n,r,!0)}catch(e){return!0}return!1},getCharLength:function(e){return 240==(240&e)?4:224==(224&e)?3:192==(192&e)?2:e==(127&e)?1:0},getCharCode:function(e,n,r){var i=0,o="";if(n=n||0,r=r||t.getCharLength(e[n]),0==r)throw new Error(e[n].toString(2)+" is not a significative byte (offset:"+n+").");if(1===r)return e[n];if(o="00000000".slice(0,r)+1+"00000000".slice(r+1),e[n]&parseInt(o,2))throw Error("Index "+n+": A "+r+" bytes encoded char cannot encode the "+(r+1)+"th rank bit to 1.");for(o="0000".slice(0,r+1)+"11111111".slice(r+1),i+=(e[n]&parseInt(o,2))<<6*--r;r;){if(128!==(128&e[n+1])||64===(64&e[n+1]))throw Error("Index "+(n+1)+': Next bytes of encoded char must begin with a "10" bit sequence.');i+=(63&e[++n])<<6*--r}return i},getStringFromBytes:function(e,n,r,i){var o,s=[];for(n|=0,r="number"==typeof r?r:e.byteLength||e.length;n<r;n++){if(o=t.getCharLength(e[n]),n+o>r){if(i)throw Error("Index "+n+": Found a "+o+" bytes encoded char declaration but only "+(r-n)+" bytes are available.")}else s.push(String.fromCodePoint(t.getCharCode(e,n,o,i)));n+=o-1}return s.join("")},getBytesForCharCode:function(e){if(e<128)return 1;if(e<2048)return 2;if(e<65536)return 3;if(e<2097152)return 4;throw new Error("CharCode "+e+" cannot be encoded with UTF8.")},setBytesFromCharCode:function(e,n,r,i){if(e|=0,n=n||[],r|=0,i=i||t.getBytesForCharCode(e),1==i)n[r]=e;else for(n[r++]=(parseInt("1111".slice(0,i),2)<<8-i)+(e>>>6*--i);i>0;)n[r++]=e>>>6*--i&63|128;return n},setBytesFromString:function(e,n,r,i,o){e=e||"",n=n||[],r|=0,i="number"==typeof i?i:n.byteLength||1/0;for(var s=0,a=e.length;s<a;s++){var u=t.getBytesForCharCode(e[s].codePointAt(0));if(o&&r+u>i)throw new Error('Not enought bytes to encode the char "'+e[s]+'" at the offset "'+r+'".');t.setBytesFromCharCode(e[s].codePointAt(0),n,r,u,o),r+=u}return n}};e.exports=t}).call(t,n(7)(e))},function(e,t){(function(){"use strict";function e(e){throw e}function t(e,t){var n=e.split("."),r=S;!(n[0]in r)&&r.execScript&&r.execScript("var "+n[0]);for(var i;n.length&&(i=n.shift());)n.length||t===T?r=r[i]?r[i]:r[i]={}:r[i]=t}function n(t,n){this.index="number"==typeof n?n:0,this.i=0,this.buffer=t instanceof(b?Uint8Array:Array)?t:new(b?Uint8Array:Array)(32768),2*this.buffer.length<=this.index&&e(Error("invalid index")),this.buffer.length<=this.index&&this.f()}function r(e){this.buffer=new(b?Uint16Array:Array)(2*e),this.length=0}function i(e){var t,n,r,i,o,s,a,u,f,l,h=e.length,d=0,c=Number.POSITIVE_INFINITY;for(u=0;u<h;++u)e[u]>d&&(d=e[u]),e[u]<c&&(c=e[u]);for(t=1<<d,n=new(b?Uint32Array:Array)(t),r=1,i=0,o=2;r<=d;){for(u=0;u<h;++u)if(e[u]===r){for(s=0,a=i,f=0;f<r;++f)s=s<<1|1&a,a>>=1;for(l=r<<16|u,f=s;f<t;f+=o)n[f]=l;++i}++r,i<<=1,o<<=1}return[n,d,c]}function o(e,t){this.h=w,this.w=0,this.input=b&&e instanceof Array?new Uint8Array(e):e,this.b=0,t&&(t.lazy&&(this.w=t.lazy),"number"==typeof t.compressionType&&(this.h=t.compressionType),t.outputBuffer&&(this.a=b&&t.outputBuffer instanceof Array?new Uint8Array(t.outputBuffer):t.outputBuffer),"number"==typeof t.outputIndex&&(this.b=t.outputIndex)),this.a||(this.a=new(b?Uint8Array:Array)(32768))}function s(e,t){this.length=e,this.H=t}function a(t,n){function r(t,n){var r,i=t.H,o=[],s=0;r=k[t.length],o[s++]=65535&r,o[s++]=r>>16&255,o[s++]=r>>24;var a;switch(C){case 1===i:a=[0,i-1,0];break;case 2===i:a=[1,i-2,0];break;case 3===i:a=[2,i-3,0];break;case 4===i:a=[3,i-4,0];break;case 6>=i:a=[4,i-5,1];break;case 8>=i:a=[5,i-7,1];break;case 12>=i:a=[6,i-9,2];break;case 16>=i:a=[7,i-13,2];break;case 24>=i:a=[8,i-17,3];break;case 32>=i:a=[9,i-25,3];break;case 48>=i:a=[10,i-33,4];break;case 64>=i:a=[11,i-49,4];break;case 96>=i:a=[12,i-65,5];break;case 128>=i:a=[13,i-97,5];break;case 192>=i:a=[14,i-129,6];break;case 256>=i:a=[15,i-193,6];break;case 384>=i:a=[16,i-257,7];break;case 512>=i:a=[17,i-385,7];break;case 768>=i:a=[18,i-513,8];break;case 1024>=i:a=[19,i-769,8];break;case 1536>=i:a=[20,i-1025,9];break;case 2048>=i:a=[21,i-1537,9];break;case 3072>=i:a=[22,i-2049,10];break;case 4096>=i:a=[23,i-3073,10];break;case 6144>=i:a=[24,i-4097,11];break;case 8192>=i:a=[25,i-6145,11];break;case 12288>=i:a=[26,i-8193,12];break;case 16384>=i:a=[27,i-12289,12];break;case 24576>=i:a=[28,i-16385,13];break;case 32768>=i:a=[29,i-24577,13];break;default:e("invalid distance")}r=a,o[s++]=r[0],o[s++]=r[1],o[s++]=r[2];var u,f;for(u=0,f=o.length;u<f;++u)_[p++]=o[u];R[o[0]]++,y[o[3]]++,g=t.length+n-1,d=null}var i,o,s,a,f,l,h,d,c,E={},_=b?new Uint16Array(2*n.length):[],p=0,g=0,R=new(b?Uint32Array:Array)(286),y=new(b?Uint32Array:Array)(30),S=t.w;if(!b){for(s=0;285>=s;)R[s++]=0;for(s=0;29>=s;)y[s++]=0}for(R[256]=1,i=0,o=n.length;i<o;++i){for(s=f=0,a=3;s<a&&i+s!==o;++s)f=f<<8|n[i+s];if(E[f]===T&&(E[f]=[]),l=E[f],!(0<g--)){for(;0<l.length&&32768<i-l[0];)l.shift();if(i+3>=o){for(d&&r(d,-1),s=0,a=o-i;s<a;++s)c=n[i+s],_[p++]=c,++R[c];break}0<l.length?(h=u(n,i,l),d?d.length<h.length?(c=n[i-1],_[p++]=c,++R[c],r(h,0)):r(d,-1):h.length<S?d=h:r(h,0)):d?r(d,-1):(c=n[i],_[p++]=c,++R[c])}l.push(i)}return _[p++]=256,R[256]++,t.M=R,t.L=y,b?_.subarray(0,p):_}function u(e,t,n){var r,i,o,a,u,f,l=0,h=e.length;a=0,f=n.length;e:for(;a<f;a++){if(r=n[f-a-1],o=3,3<l){for(u=l;3<u;u--)if(e[r+u-1]!==e[t+u-1])continue e;o=l}for(;258>o&&t+o<h&&e[r+o]===e[t+o];)++o;if(o>l&&(i=r,l=o),258===o)break}return new s(l,t-i)}function f(e,t){var n,i,o,s,a,u=e.length,f=new r(572),h=new(b?Uint8Array:Array)(u);if(!b)for(s=0;s<u;s++)h[s]=0;for(s=0;s<u;++s)0<e[s]&&f.push(s,e[s]);if(n=Array(f.length/2),i=new(b?Uint32Array:Array)(f.length/2),1===n.length)return h[f.pop().index]=1,h;for(s=0,a=f.length/2;s<a;++s)n[s]=f.pop(),i[s]=n[s].value;for(o=l(i,i.length,t),s=0,a=n.length;s<a;++s)h[n[s].index]=o[s];return h}function l(e,t,n){function r(e){var n=c[e][E[e]];n===t?(r(e+1),r(e+1)):--h[n],++E[e]}var i,o,s,a,u,f=new(b?Uint16Array:Array)(n),l=new(b?Uint8Array:Array)(n),h=new(b?Uint8Array:Array)(t),d=Array(n),c=Array(n),E=Array(n),_=(1<<n)-t,p=1<<n-1;for(f[n-1]=t,o=0;o<n;++o)_<p?l[o]=0:(l[o]=1,_-=p),_<<=1,f[n-2-o]=(f[n-1-o]/2|0)+t;for(f[0]=l[0],d[0]=Array(f[0]),c[0]=Array(f[0]),o=1;o<n;++o)f[o]>2*f[o-1]+l[o]&&(f[o]=2*f[o-1]+l[o]),d[o]=Array(f[o]),c[o]=Array(f[o]);for(i=0;i<t;++i)h[i]=n;for(s=0;s<f[n-1];++s)d[n-1][s]=e[s],c[n-1][s]=s;for(i=0;i<n;++i)E[i]=0;for(1===l[n-1]&&(--h[0],++E[n-1]),o=n-2;0<=o;--o){for(a=i=0,u=E[o+1],s=0;s<f[o];s++)a=d[o+1][u]+d[o+1][u+1],a>e[i]?(d[o][s]=a,c[o][s]=t,u+=2):(d[o][s]=e[i],c[o][s]=i,++i);E[o]=0,1===l[o]&&r(o)}return h}function h(e){var t,n,r,i,o=new(b?Uint16Array:Array)(e.length),s=[],a=[],u=0;for(t=0,n=e.length;t<n;t++)s[e[t]]=(0|s[e[t]])+1;for(t=1,n=16;t<=n;t++)a[t]=u,u+=0|s[t],u<<=1;for(t=0,n=e.length;t<n;t++)for(u=a[e[t]],a[e[t]]+=1,r=o[t]=0,i=e[t];r<i;r++)o[t]=o[t]<<1|1&u,u>>>=1;return o}function d(t,n){switch(this.l=[],this.m=32768,this.e=this.g=this.c=this.q=0,this.input=b?new Uint8Array(t):t,this.s=!1,this.n=M,this.C=!1,!n&&(n={})||(n.index&&(this.c=n.index),n.bufferSize&&(this.m=n.bufferSize),n.bufferType&&(this.n=n.bufferType),n.resize&&(this.C=n.resize)),this.n){case B:this.b=32768,this.a=new(b?Uint8Array:Array)(32768+this.m+258);break;case M:this.b=0,this.a=new(b?Uint8Array:Array)(this.m),this.f=this.K,this.t=this.I,this.o=this.J;break;default:e(Error("invalid inflate mode"))}}function c(t,n){for(var r,i=t.g,o=t.e,s=t.input,a=t.c,u=s.length;o<n;)a>=u&&e(Error("input buffer is broken")),i|=s[a++]<<o,o+=8;return r=i&(1<<n)-1,t.g=i>>>n,t.e=o-n,t.c=a,r}function E(e,t){for(var n,r,i=e.g,o=e.e,s=e.input,a=e.c,u=s.length,f=t[0],l=t[1];o<l&&!(a>=u);)i|=s[a++]<<o,o+=8;return n=f[i&(1<<l)-1],r=n>>>16,e.g=i>>r,e.e=o-r,e.c=a,65535&n}function _(e){function t(e,t,n){var r,i,o,s=this.z;for(o=0;o<e;)switch(r=E(this,t)){case 16:for(i=3+c(this,2);i--;)n[o++]=s;break;case 17:for(i=3+c(this,3);i--;)n[o++]=0;s=0;break;case 18:for(i=11+c(this,7);i--;)n[o++]=0;s=0;break;default:s=n[o++]=r}return this.z=s,n}var n,r,o,s,a=c(e,5)+257,u=c(e,5)+1,f=c(e,4)+4,l=new(b?Uint8Array:Array)(q.length);for(s=0;s<f;++s)l[q[s]]=c(e,3);if(!b)for(s=f,f=l.length;s<f;++s)l[q[s]]=0;n=i(l),r=new(b?Uint8Array:Array)(a),o=new(b?Uint8Array:Array)(u),e.z=0,e.o(i(t.call(e,a,n,r)),i(t.call(e,u,n,o)))}function p(e){if("string"==typeof e){var t,n,r=e.split("");for(t=0,n=r.length;t<n;t++)r[t]=(255&r[t].charCodeAt(0))>>>0;e=r}for(var i,o=1,s=0,a=e.length,u=0;0<a;){i=1024<a?1024:a,a-=i;do o+=e[u++],s+=o;while(--i);o%=65521,s%=65521}return(s<<16|o)>>>0}function g(t,n){var r,i;switch(this.input=t,this.c=0,!n&&(n={})||(n.index&&(this.c=n.index),n.verify&&(this.N=n.verify)),r=t[this.c++],i=t[this.c++],15&r){case re:this.method=re;break;default:e(Error("unsupported compression method"))}0!==((r<<8)+i)%31&&e(Error("invalid fcheck flag:"+((r<<8)+i)%31)),32&i&&e(Error("fdict flag is not supported")),this.B=new d(t,{index:this.c,bufferSize:n.bufferSize,bufferType:n.bufferType,resize:n.resize})}function R(e,t){this.input=e,this.a=new(b?Uint8Array:Array)(32768),this.h=ie.k;var n,r={};!t&&(t={})||"number"!=typeof t.compressionType||(this.h=t.compressionType);for(n in t)r[n]=t[n];r.outputBuffer=this.a,this.A=new o(this.input,r)}function y(e,n){var r,i,o,s;if(Object.keys)r=Object.keys(n);else for(i in r=[],o=0,n)r[o++]=i;for(o=0,s=r.length;o<s;++o)i=r[o],t(e+"."+i,n[i])}var T=void 0,C=!0,S=this,b="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array&&"undefined"!=typeof DataView;n.prototype.f=function(){var e,t=this.buffer,n=t.length,r=new(b?Uint8Array:Array)(n<<1);if(b)r.set(t);else for(e=0;e<n;++e)r[e]=t[e];return this.buffer=r},n.prototype.d=function(e,t,n){var r,i=this.buffer,o=this.index,s=this.i,a=i[o];if(n&&1<t&&(e=8<t?(A[255&e]<<24|A[e>>>8&255]<<16|A[e>>>16&255]<<8|A[e>>>24&255])>>32-t:A[e]>>8-t),8>t+s)a=a<<t|e,s+=t;else for(r=0;r<t;++r)a=a<<1|e>>t-r-1&1,8===++s&&(s=0,i[o++]=A[a],a=0,o===i.length&&(i=this.f()));i[o]=a,this.buffer=i,this.i=s,this.index=o},n.prototype.finish=function(){var e,t=this.buffer,n=this.index;return 0<this.i&&(t[n]<<=8-this.i,t[n]=A[t[n]],n++),b?e=t.subarray(0,n):(t.length=n,e=t),e};var I,v=new(b?Uint8Array:Array)(256);for(I=0;256>I;++I){for(var m=I,N=m,O=7,m=m>>>1;m;m>>>=1)N<<=1,N|=1&m,--O;v[I]=(N<<O&255)>>>0}var A=v;r.prototype.getParent=function(e){return 2*((e-2)/4|0)},r.prototype.push=function(e,t){var n,r,i,o=this.buffer;for(n=this.length,o[this.length++]=t,o[this.length++]=e;0<n&&(r=this.getParent(n),o[n]>o[r]);)i=o[n],o[n]=o[r],o[r]=i,i=o[n+1],o[n+1]=o[r+1],o[r+1]=i,n=r;return this.length},r.prototype.pop=function(){var e,t,n,r,i,o=this.buffer;for(t=o[0],e=o[1],this.length-=2,o[0]=o[this.length],o[1]=o[this.length+1],i=0;(r=2*i+2,!(r>=this.length))&&(r+2<this.length&&o[r+2]>o[r]&&(r+=2),o[r]>o[i]);)n=o[i],o[i]=o[r],o[r]=n,n=o[i+1],o[i+1]=o[r+1],o[r+1]=n,i=r;return{index:e,value:t,length:this.length}};var P,w=2,D={NONE:0,r:1,k:w,O:3},U=[];for(P=0;288>P;P++)switch(C){case 143>=P:U.push([P+48,8]);break;case 255>=P:U.push([P-144+400,9]);break;case 279>=P:U.push([P-256+0,7]);break;case 287>=P:U.push([P-280+192,8]);break;default:e("invalid literal: "+P)}o.prototype.j=function(){var t,r,i,o,s=this.input;switch(this.h){case 0:for(i=0,o=s.length;i<o;){r=b?s.subarray(i,i+65535):s.slice(i,i+65535),i+=r.length;var u=r,l=i===o,d=T,c=T,E=T,_=T,p=T,g=this.a,R=this.b;if(b){for(g=new Uint8Array(this.a.buffer);g.length<=R+u.length+5;)g=new Uint8Array(g.length<<1);g.set(this.a)}if(d=l?1:0,g[R++]=0|d,c=u.length,E=~c+65536&65535,g[R++]=255&c,g[R++]=c>>>8&255,g[R++]=255&E,g[R++]=E>>>8&255,b)g.set(u,R),
-R+=u.length,g=g.subarray(0,R);else{for(_=0,p=u.length;_<p;++_)g[R++]=u[_];g.length=R}this.b=R,this.a=g}break;case 1:var y=new n(b?new Uint8Array(this.a.buffer):this.a,this.b);y.d(1,1,C),y.d(1,2,C);var S,I,v,m=a(this,s);for(S=0,I=m.length;S<I;S++)if(v=m[S],n.prototype.d.apply(y,U[v]),256<v)y.d(m[++S],m[++S],C),y.d(m[++S],5),y.d(m[++S],m[++S],C);else if(256===v)break;this.a=y.finish(),this.b=this.a.length;break;case w:var N,O,A,P,D,L,k,B,M,G,F,H,x,q,j,V=new n(b?new Uint8Array(this.a.buffer):this.a,this.b),Y=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],J=Array(19);for(N=w,V.d(1,1,C),V.d(N,2,C),O=a(this,s),L=f(this.M,15),k=h(L),B=f(this.L,7),M=h(B),A=286;257<A&&0===L[A-1];A--);for(P=30;1<P&&0===B[P-1];P--);var W,Q,z,K,Z,$,X=A,ee=P,te=new(b?Uint32Array:Array)(X+ee),ne=new(b?Uint32Array:Array)(316),re=new(b?Uint8Array:Array)(19);for(W=Q=0;W<X;W++)te[Q++]=L[W];for(W=0;W<ee;W++)te[Q++]=B[W];if(!b)for(W=0,K=re.length;W<K;++W)re[W]=0;for(W=Z=0,K=te.length;W<K;W+=Q){for(Q=1;W+Q<K&&te[W+Q]===te[W];++Q);if(z=Q,0===te[W])if(3>z)for(;0<z--;)ne[Z++]=0,re[0]++;else for(;0<z;)$=138>z?z:138,$>z-3&&$<z&&($=z-3),10>=$?(ne[Z++]=17,ne[Z++]=$-3,re[17]++):(ne[Z++]=18,ne[Z++]=$-11,re[18]++),z-=$;else if(ne[Z++]=te[W],re[te[W]]++,z--,3>z)for(;0<z--;)ne[Z++]=te[W],re[te[W]]++;else for(;0<z;)$=6>z?z:6,$>z-3&&$<z&&($=z-3),ne[Z++]=16,ne[Z++]=$-3,re[16]++,z-=$}for(t=b?ne.subarray(0,Z):ne.slice(0,Z),G=f(re,7),q=0;19>q;q++)J[q]=G[Y[q]];for(D=19;4<D&&0===J[D-1];D--);for(F=h(G),V.d(A-257,5,C),V.d(P-1,5,C),V.d(D-4,4,C),q=0;q<D;q++)V.d(J[q],3,C);for(q=0,j=t.length;q<j;q++)if(H=t[q],V.d(F[H],G[H],C),16<=H){switch(q++,H){case 16:x=2;break;case 17:x=3;break;case 18:x=7;break;default:e("invalid code: "+H)}V.d(t[q],x,C)}var ie,oe,se,ae,ue,fe,le,he,de=[k,L],ce=[M,B];for(ue=de[0],fe=de[1],le=ce[0],he=ce[1],ie=0,oe=O.length;ie<oe;++ie)if(se=O[ie],V.d(ue[se],fe[se],C),256<se)V.d(O[++ie],O[++ie],C),ae=O[++ie],V.d(le[ae],he[ae],C),V.d(O[++ie],O[++ie],C);else if(256===se)break;this.a=V.finish(),this.b=this.a.length;break;default:e("invalid compression type")}return this.a};var L=function(){function t(t){switch(C){case 3===t:return[257,t-3,0];case 4===t:return[258,t-4,0];case 5===t:return[259,t-5,0];case 6===t:return[260,t-6,0];case 7===t:return[261,t-7,0];case 8===t:return[262,t-8,0];case 9===t:return[263,t-9,0];case 10===t:return[264,t-10,0];case 12>=t:return[265,t-11,1];case 14>=t:return[266,t-13,1];case 16>=t:return[267,t-15,1];case 18>=t:return[268,t-17,1];case 22>=t:return[269,t-19,2];case 26>=t:return[270,t-23,2];case 30>=t:return[271,t-27,2];case 34>=t:return[272,t-31,2];case 42>=t:return[273,t-35,3];case 50>=t:return[274,t-43,3];case 58>=t:return[275,t-51,3];case 66>=t:return[276,t-59,3];case 82>=t:return[277,t-67,4];case 98>=t:return[278,t-83,4];case 114>=t:return[279,t-99,4];case 130>=t:return[280,t-115,4];case 162>=t:return[281,t-131,5];case 194>=t:return[282,t-163,5];case 226>=t:return[283,t-195,5];case 257>=t:return[284,t-227,5];case 258===t:return[285,t-258,0];default:e("invalid length: "+t)}}var n,r,i=[];for(n=3;258>=n;n++)r=t(n),i[n]=r[2]<<24|r[1]<<16|r[0];return i}(),k=b?new Uint32Array(L):L,B=0,M=1,G={F:B,D:M};d.prototype.p=function(){for(;!this.s;){var t=c(this,3);switch(1&t&&(this.s=C),t>>>=1){case 0:var n=this.input,r=this.c,i=this.a,o=this.b,s=n.length,a=T,u=T,f=i.length,l=T;switch(this.e=this.g=0,r+1>=s&&e(Error("invalid uncompressed block header: LEN")),a=n[r++]|n[r++]<<8,r+1>=s&&e(Error("invalid uncompressed block header: NLEN")),u=n[r++]|n[r++]<<8,a===~u&&e(Error("invalid uncompressed block header: length verify")),r+a>n.length&&e(Error("input buffer is broken")),this.n){case B:for(;o+a>i.length;){if(l=f-o,a-=l,b)i.set(n.subarray(r,r+l),o),o+=l,r+=l;else for(;l--;)i[o++]=n[r++];this.b=o,i=this.f(),o=this.b}break;case M:for(;o+a>i.length;)i=this.f({v:2});break;default:e(Error("invalid inflate mode"))}if(b)i.set(n.subarray(r,r+a),o),o+=a,r+=a;else for(;a--;)i[o++]=n[r++];this.c=r,this.b=o,this.a=i;break;case 1:this.o(ee,ne);break;case 2:_(this);break;default:e(Error("unknown BTYPE: "+t))}}return this.t()};var F,H,x=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],q=b?new Uint16Array(x):x,j=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],V=b?new Uint16Array(j):j,Y=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],J=b?new Uint8Array(Y):Y,W=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Q=b?new Uint16Array(W):W,z=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],K=b?new Uint8Array(z):z,Z=new(b?Uint8Array:Array)(288);for(F=0,H=Z.length;F<H;++F)Z[F]=143>=F?8:255>=F?9:279>=F?7:8;var $,X,ee=i(Z),te=new(b?Uint8Array:Array)(30);for($=0,X=te.length;$<X;++$)te[$]=5;var ne=i(te);d.prototype.o=function(e,t){var n=this.a,r=this.b;this.u=e;for(var i,o,s,a,u=n.length-258;256!==(i=E(this,e));)if(256>i)r>=u&&(this.b=r,n=this.f(),r=this.b),n[r++]=i;else for(o=i-257,a=V[o],0<J[o]&&(a+=c(this,J[o])),i=E(this,t),s=Q[i],0<K[i]&&(s+=c(this,K[i])),r>=u&&(this.b=r,n=this.f(),r=this.b);a--;)n[r]=n[r++-s];for(;8<=this.e;)this.e-=8,this.c--;this.b=r},d.prototype.J=function(e,t){var n=this.a,r=this.b;this.u=e;for(var i,o,s,a,u=n.length;256!==(i=E(this,e));)if(256>i)r>=u&&(n=this.f(),u=n.length),n[r++]=i;else for(o=i-257,a=V[o],0<J[o]&&(a+=c(this,J[o])),i=E(this,t),s=Q[i],0<K[i]&&(s+=c(this,K[i])),r+a>u&&(n=this.f(),u=n.length);a--;)n[r]=n[r++-s];for(;8<=this.e;)this.e-=8,this.c--;this.b=r},d.prototype.f=function(){var e,t,n=new(b?Uint8Array:Array)(this.b-32768),r=this.b-32768,i=this.a;if(b)n.set(i.subarray(32768,n.length));else for(e=0,t=n.length;e<t;++e)n[e]=i[e+32768];if(this.l.push(n),this.q+=n.length,b)i.set(i.subarray(r,r+32768));else for(e=0;32768>e;++e)i[e]=i[r+e];return this.b=32768,i},d.prototype.K=function(e){var t,n,r,i,o=this.input.length/this.c+1|0,s=this.input,a=this.a;return e&&("number"==typeof e.v&&(o=e.v),"number"==typeof e.G&&(o+=e.G)),2>o?(n=(s.length-this.c)/this.u[2],i=258*(n/2)|0,r=i<a.length?a.length+i:a.length<<1):r=a.length*o,b?(t=new Uint8Array(r),t.set(a)):t=a,this.a=t},d.prototype.t=function(){var e,t,n,r,i,o=0,s=this.a,a=this.l,u=new(b?Uint8Array:Array)(this.q+(this.b-32768));if(0===a.length)return b?this.a.subarray(32768,this.b):this.a.slice(32768,this.b);for(t=0,n=a.length;t<n;++t)for(e=a[t],r=0,i=e.length;r<i;++r)u[o++]=e[r];for(t=32768,n=this.b;t<n;++t)u[o++]=s[t];return this.l=[],this.buffer=u},d.prototype.I=function(){var e,t=this.b;return b?this.C?(e=new Uint8Array(t),e.set(this.a.subarray(0,t))):e=this.a.subarray(0,t):(this.a.length>t&&(this.a.length=t),e=this.a),this.buffer=e},g.prototype.p=function(){var t,n,r=this.input;return t=this.B.p(),this.c=this.B.c,this.N&&(n=(r[this.c++]<<24|r[this.c++]<<16|r[this.c++]<<8|r[this.c++])>>>0,n!==p(t)&&e(Error("invalid adler-32 checksum"))),t};var re=8,ie=D;R.prototype.j=function(){var t,n,r,i,o,s,a,u=0;switch(a=this.a,t=re){case re:n=Math.LOG2E*Math.log(32768)-8;break;default:e(Error("invalid compression method"))}switch(r=n<<4|t,a[u++]=r,t){case re:switch(this.h){case ie.NONE:o=0;break;case ie.r:o=1;break;case ie.k:o=2;break;default:e(Error("unsupported compression type"))}break;default:e(Error("invalid compression method"))}return i=o<<6|0,a[u++]=i|31-(256*r+i)%31,s=p(this.input),this.A.b=u,a=this.A.j(),u=a.length,b&&(a=new Uint8Array(a.buffer),a.length<=u+4&&(this.a=new Uint8Array(a.length+4),this.a.set(a),a=this.a),a=a.subarray(0,u+4)),a[u++]=s>>24&255,a[u++]=s>>16&255,a[u++]=s>>8&255,a[u++]=255&s,a},t("Zlib.Inflate",g),t("Zlib.Inflate.prototype.decompress",g.prototype.p),y("Zlib.Inflate.BufferType",{ADAPTIVE:G.D,BLOCK:G.F}),t("Zlib.Deflate",R),t("Zlib.Deflate.compress",function(e,t){return new R(e,t).j()}),t("Zlib.Deflate.prototype.compress",R.prototype.j),y("Zlib.Deflate.CompressionType",{NONE:ie.NONE,FIXED:ie.r,DYNAMIC:ie.k})}).call(this)},function(e,t){},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(5),f=r(u),l=n(20),h=r(l),d=n(12),c=r(d),E=n(2),_=r(E),p=n(1),g=r(p),R=n(10),y=r(R),T=n(21),C=r(T),S=n(23),b=r(S),I=n(22),v=r(I),m=n(24),N=r(m),O=g.default.getLoger("MessageEngine"),A=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.confInfo=null,e.h5Sass=h.default,e.h5Sass.on("*",function(t,n){return e.emit(t,n)}),e.h5Sass.on(h.default.SUCCESS,e._h5SassSuccessHandler.bind(e)),e.mcu=c.default,e.mcu.on("*",function(t,n){return e.emit(t,n)}),e.mcu.on(_.default.CONFERENCE_JOIN_SUCCESS,e._conferenceJoinSuccessHandler.bind(e)),e.conferApe=new y.default,e.conferApe.on("*",function(t,n){return e.emit(t,n)}),e.conferApe.on(_.default.DOC_SWITCH,e.docSwitchHandler.bind(e)),e.chat_ape=new C.default,e.chat_ape.on("*",function(t,n){return e.emit(t,n)}),e.video_ape=new b.default,e.video_ape.on("*",function(t,n){return e.emit(t,n)}),e.doc_ape=new v.default,e.doc_ape.on("*",function(t,n){return e.emit(t,n)}),e.doc_ape.on(_.default.DOC_UPDATE,e.docUpdateHandler.bind(e)),e.doc_ape.on(_.default.DOC_DEL,e.docDeleteHandler.bind(e)),e.wb_ape=new N.default,e.wb_ape.on("*",function(t,n){return e.emit(t,n)}),e.wb_ape.on(_.default.ANNO_UPDATE,e.annoUpdateHandler.bind(e)),e.on(_.default.DOC_SHOW,e.docShowHandler.bind(e)),e.init=e._init,e}return s(t,e),a(t,[{key:"_init",value:function(e){console.log("Engine init "+e)}},{key:"annoUpdateHandler",value:function(e){var t=this.conferApe.activeDocId,n=this.doc_ape.docList[t];n&&e.id==n.wbid&&this.emit(_.default.DOC_ANNO,e)}},{key:"docShowHandler",value:function(e){O.log("Doc Show ->"+e.id+"|"+e.curPageNo);var t=this.wb_ape.annoInfos[e.wbid];t?this.emit(_.default.DOC_ANNO,t):this.emit(_.default.DOC_ANNO)}},{key:"docSwitchHandler",value:function(){var e=this.conferApe.activeDocId;O.log("Switch Doc Active -> "+e);var t=this.doc_ape.docList[e];t&&this.emit(_.default.DOC_SHOW,t)}},{key:"docUpdateHandler",value:function(e){O.log("Doc UpdateId ->"+e.id+"| activeDocId ->"+this.conferApe.activeDocId),e.id==this.conferApe.activeDocId&&this.emit(_.default.DOC_SHOW,e)}},{key:"docDeleteHandler",value:function(e){e.id==this.conferApe.activeDocId&&this.emit(_.default.DOC_DEL,e)}},{key:"_conferenceJoinSuccessHandler",value:function(){this.h5Sass.getClassDetail()}},{key:"_h5SassSuccessHandler",value:function(){O.log("加入底层MCU会议."),this.mcu.joinMCU(this.confInfo)}},{key:"joinClass",value:function(e){this.confInfo=e,this.h5Sass.sassChecking(e)}},{key:"leaveClass",value:function(){this.mcu.leaveMCU()}},{key:"conferenceHandler",value:function(e){var t={type:e,data:null};this.emit(t.type,t)}},{key:"sendChatMsg",value:function(e,t){this.chat_ape&&this.chat_ape.sendChatMsg(e,t)}}]),t}(f.default),P=A;t.default=P,A.MessageTypes=_.default,A.data={aa:"aa",bb:11,cc:"cccc"};(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(O,"loger","D:/work/McuClient/src/MessageEngine.js"),__REACT_HOT_LOADER__.register(A,"MessageEngine","D:/work/McuClient/src/MessageEngine.js"),__REACT_HOT_LOADER__.register(P,"default","D:/work/McuClient/src/MessageEngine.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(5),f=r(u),l=n(1),h=r(l),d=n(2),c=r(d),E=h.default.getLoger("H5Sass"),_={},p=function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this))}return s(t,e),a(t,[{key:"sassChecking",value:function(e){return E.log("发起Sass校验",e),this.confInfo=e,"true"===this.confInfo.nopassword?this.sendPWDChecking():void this.sendMD5Checking()}},{key:"sendPWDChecking",value:function(){var e=this,t="http://"+this.confInfo.portal+"/3m/getCheckMeetinig.do?siteId="+this.confInfo.siteId+"&classId="+this.confInfo.confId+"&password="+this.confInfo.password;E.log("会议密码校验",t),fetch(t,{timeout:5e3}).then(function(t){if(200===t.status)return t.text();throw E.error("会议密码校验-网络异常.状态码:"+t.status),e.emit(c.default.NET_ERROR),""}).then(function(t){return"false"===t?(E.error("会议密码校验-失败."),e.emit(c.default.CONFERENCE_SHOW_WRONG_PASSWORD)):"true"===t?(E.log("会议密码校验-成功."),void e.sendMD5Checking()):(E.error("会议密码校验-协议异常."),void e.emit(c.default.PRO_ERROR))}).catch(function(t){E.error("会议密码校验-异常.状态码:"+t),e.emit(c.default.NET_ERROR)})}},{key:"sendMD5Checking",value:function(){var e=this,n="http://"+this.confInfo.portal+"/3m/meeting/md5CheckMeeting.do?siteId="+this.confInfo.siteId+"&meetingNumber="+this.confInfo.confId+"&userId="+this.confInfo.userId+"&userName="+this.confInfo.userName+"&userType="+this.confInfo.userType+"&nopassword="+this.confInfo.nopassword+"&md5="+this.confInfo.md5;E.log("H5SassMD5校验",n),fetch(n,{timeout:5e3}).then(function(t){if(200===t.status)return t.json();throw E.error("H5SassMD5校验-网络异常.状态码:"+t.status),e.emit(c.default.NET_ERROR),""}).then(function(n){if("true"==n.flag){if(n.h5_mcu_list){var r=n.h5_mcu_list.split(";")[0];e.confInfo.MCUServerIP=r.split(":")[0],e.confInfo.MCUServerPort=r.split(":")[1]}e.confInfo.maxVideoChannels=n.maxVideoChannels,e.confInfo.maxAudioChannels=n.maxAudioChannels,e.confInfo.maxMediaChannels=e.confInfo.maxVideoChannels+e.confInfo.maxAudioChannels,E.log("H5Sass校验完成"),e.emit(t.SUCCESS)}else E.log("H5SassMD5校验-失败."),e.emit(c.default.CONFERENCE_JOIN_FAILED)}).catch(function(t){E.error("H5SassMD5校验-异常.状态码:"+t),e.emit(c.default.NET_ERROR)})}},{key:"getClassDetail",value:function(){var e=this,t="http://"+this.confInfo.portal+"/3m/meeting/getClassH5.do?classNumber="+this.confInfo.confId;E.log("H5Sass获取Class详情.",t),fetch(t,{timeout:5e3}).then(function(t){if(t.ok)return t.json();throw E.error("H5Sass获取Class详情-网络异常.状态码:"+t.status),e.emit(c.default.NET_ERROR),""}).then(function(t){0===t.errorCode?(E.log("H5Sass获取Class详情完成"),e.emit(c.default.CONFERENCE_SHOW_DETAIL,t)):(E.warn("H5Sass获取Class详情失败."),e.emit(c.default.NET_ERROR))}).catch(function(t){E.error("H5Sass获取Class详情异常.状态码:"+t),e.emit(c.default.NET_ERROR)})}}]),t}(f.default);p.prototype.SUCCESS=p.SUCCESS="h5sass.success";var g=new p;t.default=g;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(E,"loger","D:/work/McuClient/src/Sass.js"),__REACT_HOT_LOADER__.register(_,"confInfo","D:/work/McuClient/src/Sass.js"),__REACT_HOT_LOADER__.register(p,"H5Sass","D:/work/McuClient/src/Sass.js"),__REACT_HOT_LOADER__.register(g,"default","D:/work/McuClient/src/Sass.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(6),f=r(u),l=n(3),h=r(l),d=n(4),c=r(d),E=n(1),_=r(E),p=n(2),g=r(p),R=_.default.getLoger("ChatApe"),y=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.default.CHAT_SESSION_ID,h.default.CHAT_SESSION_NAME,h.default.CHAT_SESSION_TAG));return e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(c.default.RCPDU_REG_REGISTER_TABLE,h.default.CHAT_OBJ_TABLE_ID,h.default.CHAT_OBJ_TABLE_NAME,h.default.CHAT_OBJ_TABLE_TAG,0,new ArrayBuffer),e.on(c.default.RCPDU_CHAT_SEND_DATA_REQUEST,e.chatMsgIncomingHandler.bind(e)),e}return s(t,e),a(t,[{key:"chatMsgIncomingHandler",value:function(e){}},{key:"sendChatMsg",value:function(e,t){R.log("发送聊天消息.",e,t);var n=new c.default.RCChatSendDataRequestPdu;n.type=c.default.RCPDU_CHAT_SEND_DATA_REQUEST,n.initiator=this._confInfo.nodeId,n.peer=e,n.isPublic=!0,n.userData=this._rCArrayBufferUtil.strToUint8Array("h5"+t),n.fromName=this._rCArrayBufferUtil.strToUint8Array("h5"+this._confInfo.userName),n.fromRole=this._confInfo.classRole,n.isPublic||0===n.peer?this.sendUniform(n):this.send(n)}},{key:"chatMsgIncomingHandler",value:function(e){var t=c.default.RCChatSendDataRequestPdu.decode(e),n={};n.fromNodeID=t.initiator,n.toNodeID=t.peer,n.message=this._rCArrayBufferUtil.uint8ArrayToStr(t.userData,2),n.fromName=this._rCArrayBufferUtil.uint8ArrayToStr(t.fromName,2),n.fromRole=t.fromRole,R.log("接受聊天消息.",n),this.emit(g.default.CHAT_RECEIVE,n)}}]),t}(f.default),T=y;t.default=T;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(R,"loger","D:/work/McuClient/src/apes/ChatApe.js"),__REACT_HOT_LOADER__.register(y,"ChatApe","D:/work/McuClient/src/apes/ChatApe.js"),__REACT_HOT_LOADER__.register(T,"default","D:/work/McuClient/src/apes/ChatApe.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(6),f=r(u),l=n(3),h=r(l),d=n(4),c=r(d),E=n(1),_=r(E),p=n(2),g=r(p),R=_.default.getLoger("DocApe"),y=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.default.DOCSHARING_SESSION_ID,h.default.DOCSHARING_SESSION_NAME,h.default.DOCSHARING_SESSION_TAG));return e.docList={},e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(c.default.RCPDU_REG_REGISTER_TABLE,h.default.DOCSHARING_OBJ_TABLE_ID_H5,h.default.DOCSHARING_OBJ_TABLE_NAME_H5,h.default.DOCSHARING_OBJ_TABLE_TAG_H5,0,new ArrayBuffer),e._apeDelayed=!0,e}return s(t,e),a(t,[{key:"tableInsertHandler",value:function(e,t,n){this.tableUpdateHandler(e,t,n)}},{key:"tableDeleteHandler",value:function(e,t){var n={};n.type=h.default.DOCUMENT_DEL,this.emit(g.default.DOC_DEL,n)}},{key:"tableUpdateHandler",value:function(e,t,n){try{var r=c.default.RCDocSendDataRequestPdu.decode(n);r.type=h.default.DOCUMENT_LOAD,r.ext=r.name.substr(r.name.indexOf(".")+1),r.wbid=(r.id<<10)+r.curPageNo,r.isPicture=~["bmp","png","gif","jpg","jpeg"].indexOf(r.ext),r.isPicture?(r.namePath=r.uri.substring(0,r.uri.lastIndexOf(".")),r.loadURL=r.namePath+"."+r.ext):(r.namePath=r.uri.substring(0,r.uri.lastIndexOf("/")),r.loadURL=r.namePath+"/"+r.curPageNo+".jpg"),this.docList[t]=r,this.emit(g.default.DOC_UPDATE,r),R.log("Doc update ->"+t)}catch(e){R.warn("Doc Table Update Decode包异常")}}}]),t}(f.default),T=y;t.default=T;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(R,"loger","D:/work/McuClient/src/apes/DocApe.js"),__REACT_HOT_LOADER__.register(y,"DocApe","D:/work/McuClient/src/apes/DocApe.js"),__REACT_HOT_LOADER__.register(T,"default","D:/work/McuClient/src/apes/DocApe.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(6),f=r(u),l=n(3),h=r(l),d=n(4),c=r(d),E=n(1),_=r(E),p=n(2),g=r(p),R=_.default.getLoger("VideoChat"),y=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.default.VIDEO_SESSION_ID,h.default.VIDEO_SESSION_NAME,h.default.VIDEO_SESSION_TAG));return e.videoChannels={},e.activeChannelId=0,e.activeURL="",e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(c.default.RCPDU_REG_REGISTER_TABLE,h.default.VIDEO_OBJ_TABLE_ID,h.default.VIDEO_OBJ_TABLE_NAME,h.default.VIDEO_OBJ_TABLE_TAG,0,new ArrayBuffer),e.on(c.default.RCPDU_VIDEO_SEND_DATA_REQUEST,e.videoIncomingHandler.bind(e)),e}return s(t,e),a(t,[{key:"videoIncomingHandler",value:function(e){var t=c.default.VideoSendDataRequestPdu.decode(e),n={};n._initiator=t.initiator,n._is_key_frame=t.keyFrame,n._sequence_id=t.sequenceId,n._slice_id=t.sliceId,n._data=t.userData,R.log("接受视频消息.",n),this.emit(g.default.VIDEO_SHOW,n)}},{key:"tableUpdateHandler",value:function(e,t,n){var r=c.default.RCVideoChannelInfoRecordPdu.decode(n);switch(r.owner=e,r.channelId=t,r.status=0===e?h.default.CGS_RELEASED:r.status,this.videoChannels[t]=r,r.status){case h.default.CGS_RELEASED:case h.default.CGS_PENDING:case h.default.CGS_GRABBING:this.activeChannelId===r.channelId&&(this.activeChannelId=0,this.activeURL="",this.emitVideoChange());break;case h.default.CGS_OPENNED:this.activeChannelId=r.channelId,"1"===this._confInfo.msType?this.activeURL="http://dazhi.3mang.com/live/"+this._confInfo.confId+"/"+this._confInfo.confId+"_"+r.channelId+"_flash_cam_mic_aac/playlist.m3u8":this.activeURL="http://hls.3mang.com/live/"+this._confInfo.confId+"_"+r.channelId+"_flash_cam_mic_aac/playlist.m3u8",this.emitVideoChange()}}},{key:"emitVideoChange",value:function(){this.emit(g.default.VIDEO_SHOW,{activeChannelId:this.activeChannelId,HLSURL:this.activeURL})}}]),t}(f.default),T=y;t.default=T;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(R,"loger","D:/work/McuClient/src/apes/VideoApe.js"),__REACT_HOT_LOADER__.register(y,"VideoChat","D:/work/McuClient/src/apes/VideoApe.js"),__REACT_HOT_LOADER__.register(T,"default","D:/work/McuClient/src/apes/VideoApe.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(6),f=r(u),l=n(3),h=r(l),d=n(4),c=r(d),E=n(1),_=r(E),p=n(2),g=r(p),R=n(17),y=n(16),T=r(y),C=_.default.getLoger("WhiteBoardApe"),S=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.default.WHITEBOARD_SESSION_ID,h.default.WHITEBOARD_SESSION_NAME,h.default.WHITEBOARD_SESSION_TAG));return e.annoInfos={},e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(c.default.RCPDU_REG_REGISTER_TABLE,h.default.WHITEBOARD_OBJ_TABLE_ID,h.default.WHITEBOARD_OBJ_TABLE_NAME,h.default.WHITEBOARD_OBJ_TABLE_TAG,0,new ArrayBuffer),e.on(c.default.RCPDU_CONFERENCE_SEND_DATA_REQUEST,e.whiteboardMsgComingHandler.bind(e)),e._apeDelayed=!0,e}return s(t,e),a(t,[{key:"whiteboardMsgComingHandler",value:function(e){C.warn("whiteboardMsgComingHandler needs to be handled.")}},{key:"tableInsertHandler",value:function(e,t){this.emitDocChange(h.default.DOCUMENT_DEL)}},{key:"tableUpdateHandler",value:function(e,t,n){var r=c.default.RCWhiteboardDataRequestPdu.decode(n);if(r.type==h.default.WBA_DOC_ANNOTATION){var i=new R.Zlib.Inflate(r.action.compact().view).decompress(),o={id:t,svg:T.default.getStringFromBytes(i)};this.annoInfos[t]=o,this.emit(g.default.ANNO_UPDATE,o)}else C.log("白板动作忽略,类型:",(0,h.default)(r.type))}}]),t}(f.default),b=S;t.default=b;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(C,"loger","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(S,"WhiteBoardApe","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(b,"default","D:/work/McuClient/src/apes/WhiteBoardApe.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(5),f=r(u),l=n(1),h=r(l),d=h.default.getLoger("EverSocket"),c=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._connected=!1,e._lastActiveTime=0,e._enableEverSocket=!1,e}return s(t,e),a(t,[{key:"begin",value:function(e,t){d.log("开始WebSocket应用."),this._enableEverSocket=!0,this.wsURL="ws://"+e+":"+t,this._newConnection()}},{key:"end",value:function(){d.log("停止WebSocket应用."),this._clear()}},{key:"send",value:function(e){this._connected?(d.log("SEND MESSAGE---->"),this.websocket.send(e)):d.warn("WebSocket未建立连接.消息忽略")}},{key:"_setConnected",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._connected=e,this._connected?this.emit(t.OPEN):this.emit(t.CLOSED)}},{key:"_newConnection",value:function(){this.websocket=new WebSocket(this.wsURL),this.websocket.binaryType="arraybuffer",this.websocket.onopen=this._onOpen.bind(this),this.websocket.onclose=this._onClose.bind(this),this.websocket.onerror=this._onError.bind(this),this.websocket.onmessage=this._onMessage.bind(this)}},{key:"_reConnection",value:function(){var e=this;this._clear(),this.reConnectionTimeout=window.setTimeout(function(){d.log("WebSocket重新建立."),window.clearTimeout(e.reConnectionTimeout),e._newConnection()},t.RECONN_INTERVAL)}},{key:"_clear",value:function(){d.log("WebSocket,Timers销毁"),window.clearInterval(this.pingTimer),window.clearInterval(this.pongTimer),this.websocket.onopen=void 0,this.websocket.onclose=void 0,this.websocket.onerror=void 0,this.websocket.onmessage=void 0;try{this.websocket.close()}catch(e){d.log("ignore errors")}this.websocket=void 0,this._enableEverSocket=!1,this._setConnected(!1)}},{key:"_onOpen",value:function(){d.log("WebSocket建立成功",this.wsURL),this._setConnected()}},{key:"_onClose",value:function(e){d.log("WebSocket连接断开 CODE:"+e.code+" REASON:"+e.reason+" CLEAN: "+e.wasClean,this.wsURL),this._reConnection()}},{key:"_onError",value:function(){d.log("WebSocket错误出现"),this._connected=!1,this._reConnection()}},{key:"_onMessage",value:function(e){d.log("<----RECEIVE MESSAGE"),this._lastActiveTime=Date.now();var n=e.data;n.byteLength>0&&this.emit(t.MESSAGE,n)}},{key:"_sendPingHandler",value:function(){this._connected?this.websocket.send(new ArrayBuffer):this._reConnection()}},{key:"_checkPongHandler",value:function(){var e=Date.now();this._lastActiveTime&&this._lastActiveTime>=e-t.PONG_INTERVAL&&this._lastActiveTime<=e||(d.warn("---服务器PINGPONG超时-----"),this._reConnection())}},{key:"connected",get:function(){return this._connected}}]),t}(f.default);c.prototype.PONG_INTERVAL=c.PONG_INTERVAL=5e3,c.prototype.PING_INTERVAL=c.PING_INTERVAL=3e3,c.prototype.RECONN_INTERVAL=c.RECONN_INTERVAL=2e3,c.prototype.CONNECTING=c.CONNECTING=0,c.prototype.OPEN=c.OPEN=1,c.prototype.CLOSING=c.CLOSING=2,c.prototype.CLOSED=c.CLOSED=3,c.prototype.MESSAGE=c.MESSAGE=4;var E=new c;t.default=E;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(d,"loger","D:/work/McuClient/src/everSocket.js"),__REACT_HOT_LOADER__.register(c,"EverSocket","D:/work/McuClient/src/everSocket.js"),__REACT_HOT_LOADER__.register(E,"default","D:/work/McuClient/src/everSocket.js"))})()},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n='\n//start\n// pdu_def.proto\n\n// syntax = "proto3";\n\noption optimize_for = LITE_RUNTIME;\nenum RCPduPriority_E {\n    DP_TOP = 0;\n    DP_HIGH = 1;\n    DP_MEDIUM = 2;\n    DP_LOW = 3;\n}\n\nenum RCPduSegment_E {\n    SEG_BEGIN = 0;\n    SEG_END = 1;\n    SEG_ONCE = 2;\n}\n\nenum RCPduTokenStatus_E {\n    TS_NOT_IN_USE = 0;\n    TS_SELF_GRABBED = 1;\n    TS_OTHER_GRABBED = 2;\n    TS_SELF_INHIBITED = 3;\n    TS_OTHER_INHIBITED = 4;\n    TS_SELF_RECIPIENT = 5;\n    TS_SELF_GIVING = 6;\n    TS_OTHER_GIVING = 7;\n}\n\nenum RCPduType_E {\n// GCC PDU\n    RCPDU_CONNECT_PROVIDER_REQUEST = 0;\n    RCPDU_CONNECT_PROVIDER_RESPONSE = 1;\n    RCPDU_CONFERENCE_JOIN_REQUEST = 2;\n    RCPDU_CONFERENCE_JOIN_RESPONSE = 3;\n    RCPDU_CONFERENCE_INVITE_REQUEST = 10;\n    RCPDU_CONFERENCE_INVITE_RESPONSE = 11;\n    RCPDU_CONFERENCE_LOCK_REQUEST = 20;\n    RCPDU_CONFERENCE_LOCK_RESPONSE = 21;\n    RCPDU_CONFERENCE_LOCK_INDICATION = 22;\n    RCPDU_CONFERENCE_UNLOCK_REQUEST = 30;\n    RCPDU_CONFERENCE_UNLOCK_RESPONSE = 31;\n    RCPDU_CONFERENCE_UNLOCK_INDICATION = 32;\n    RCPDU_CONFERENCE_LEAVE_REQUEST = 39;\n    RCPDU_CONFERENCE_TERMINATE_REQUEST = 40;\n    RCPDU_CONFERENCE_TERMINATE_RESPONSE = 41;\n    RCPDU_CONFERENCE_TERMINATE_INDICATION = 42;\n    RCPDU_CONFERENCE_EJECT_USER_REQUEST = 50;\n    RCPDU_CONFERENCE_EJECT_USER_RESPONSE = 51;\n    RCPDU_CONFERENCE_EJECT_USER_INDICATION = 52;\n    RCPDU_ROSTER_UPDATE_INDICATION = 60;\n    RCPDU_REGISTRY_UPDATE_REQUEST = 70; // INCLUDE ALL OBJS OPERATION\n    RCPDU_REGISTRY_UPDATE_RESPONSE = 71;\n    RCPDU_REGISTRY_UPDATE_INDICATION = 72;\n    RCPDU_FUNCTION_NOT_SUPPORTED_RESPONSE = 80;\n\n    // MCS PDU\n    RCPDU_SESSION_JOIN_REQUEST = 90;\n    RCPDU_SESSION_JOIN_RESPONSE = 91;\n    RCPDU_CHANNEL_GRAB_REQUEST = 100;\n    RCPDU_CHANNEL_GRAB_RESPONSE = 101;\n    RCPDU_CHANNEL_GRAB_INDICATION = 102;\n    RCPDU_CHANNEL_JOIN_REQUEST = 103;\n    RCPDU_CHANNEL_JOIN_RESPONSE = 104;\n    RCPDU_CHANNEL_LEAVE_REQUEST = 105;\n    RCPDU_CHANNEL_RELEASE_REQUEST = 106;\n    RCPDU_CHANNEL_RELEASE_INDICATION = 107;\n    RCPDU_SEND_DATA_REQUEST = 120;\n    RCPDU_SEND_DATA_INDICATION = 121;\n    RCPDU_UNIFORM_SEND_DATA_REQUEST = 125;\n    RCPDU_UNIFORM_SEND_DATA_INDICATION = 126;\n    RCPDU_TOKEN_GRAB_REQUEST = 130;\n    RCPDU_TOKEN_GRAB_CONFIRM = 131;\n    RCPDU_TOKEN_INHIBIT_REQUEST = 132;\n    RCPDU_TOKEN_INHIBIT_CONFIRM = 133;\n    RCPDU_TOKEN_GIVE_REQUEST = 134;\n    RCPDU_TOKEN_GIVE_INDICATION = 135;\n    RCPDU_TOKEN_GIVE_RESPONSE = 136;\n    RCPDU_TOKEN_GIVE_CONFIRM = 137;\n    RCPDU_TOKEN_PLEASE_REQUEST = 138;\n    RCPDU_TOKEN_PLEASE_INDICATION = 139;\n    RCPDU_TOKEN_RELEASE_REQUEST = 140;\n    RCPDU_TOKEN_RELEASE_CONFIRM = 141;\n    RCPDU_TOKEN_TEST_REQUEST = 142;\n    RCPDU_TOKEN_TEST_CONFIRM = 143;\n\n    // Registry PDU\n    RCPDU_REG_REGISTER_KEY = 200;\n    RCPDU_REG_UNREGISTER_KEY = 201;\n    RCPDU_REG_REGISTER_ROSTER = 202;\n    RCPDU_REG_REGISTER_TOKEN = 203;\n    RCPDU_REG_REGISTER_PARAMETER = 204;\n    RCPDU_REG_REGISTER_COUNTER = 205;\n    RCPDU_REG_REGISTER_TABLE = 206;\n    RCPDU_REG_REGISTER_CACHE = 207;\n    RCPDU_REG_REGISTER_OBJ = 208;\n    RCPDU_REG_UNREGISTER_OBJ = 209;\n    RCPDU_REG_UPDATE_OBJ = 210;\n    RCPDU_REG_ADAPTER = 211;\n    RCPDU_REG_CLEANUP_NODE = 212;\n    RCPDU_REG_REGISTER_QUEUE = 213;\n\n    // Registry Obj update PDU\n    RCPDU_REG_TABLE_INSERT_PDU = 230;\n    RCPDU_REG_TABLE_DELETE_PDU = 231;\n    RCPDU_REG_TABLE_UPDATE_PDU = 232;\n    RCPDU_REG_ROSTER_INSERT_PDU = 240;\n    RCPDU_REG_ROSTER_DELETE_PDU = 241;\n    RCPDU_REG_ROSTER_UPDATE_PDU = 242;\n    RCPDU_REG_PARAMETER_UPDATE_PDU = 250;\n    RCPDU_REG_QUEUE_INSERT_PDU = 255;\n    RCPDU_REG_QUEUE_DELETE_PDU = 256;\n    RCPDU_REG_QUEUE_UPDATE_PDU = 257;\n\n    // data\n    RCPDU_CONFERENCE_SEND_DATA_REQUEST = 259;\n    RCPDU_VIDEO_SEND_DATA_REQUEST = 260;\n    RCPDU_AUDIO_SEND_DATA_REQUEST = 261;\n    RCPDU_GIFT_SEND_DATA_REQUEST = 262;\n    RCPDU_CHAT_SEND_DATA_REQUEST = 263;\n    RCPDU_VOTING_POLL_RECORD = 265;\n\n    // Registry resource request or response PDU\n    RCPDU_REG_REQUEST_OBJ = 290;\n    RCPDU_REG_RESPONSE_OBJ = 291;\n    RCPDU_REG_COUNTER_REQUEST_PDU = 292;\n    RCPDU_REG_COUNTER_RESPONSE_PDU = 293;\n\n    // Index exchange\n    RCPDU_INDEX_ADAPTER = 300;\n    RCPDU_INDEX_SERVER_USERS = 301;\n    RCPDU_INDEX_CONFERENCE_USER_JOINED = 302;\n    RCPDU_INDEX_CONFERENCE_USER_EXITED = 303;\n    RCPDU_INDEX_CONFERENCE_USERS = 304;\n}\n\nenum RCPduNodeType_E {\n    NT_TERMINAL = 0;\n    NT_MULTIPORT_TERMINAL = 1;\n    NT_MCU = 2;\n}\n\nenum RCPduReason_E {\n    RSN_USERINITIATED = 0;\n    RSN_DISCONNECTED = 1;\n    RSN_SUPER_LEFT = 2;\n}\n\nenum RCPduResult_E {\n    RET_SUCCESS = 0;\n    RET_USER_REJECTED = 1;\n    RET_INVALID_CONFERENCE = 2;\n    RET_INVALID_PASSWORD = 3;\n    RET_INVALID_CONVENER_PASSWORD = 4;\n    RET_CHALLENGE_RESPONSE_REQUIRED = 5;\n    RET_INVALID_CHALLENGE_RESPONSE = 6;\n    RET_NO_CONNECTION = 7;\n    RET_FULL_CAPACITY = 8;\n}\n\nenum RCPduNodeCategory_E {\n    NC_CONVENTIONAL = 0;\n    NC_COUNTED = 1;\n    NC_ANONYMOUS = 2;\n}\n\nmessage RCConferenceDescriptorPdu {\n    required uint32 id = 1;\n    required bytes name = 2;\n    optional bytes description = 3;\n    //optional string net_address       = 4;\n    optional uint32 mode = 4;\n    optional string password = 5;\n    optional uint32 capacity = 6;\n    optional bytes user_data = 7;\n}\n\nmessage RCNodeRecordPdu {\n    required uint32 id = 1;\n    optional uint32 superior_node = 2;\n    required RCPduNodeType_E type = 3;\n    required string name = 4;\n    required uint32 capability = 5;\n    optional string net_address = 6;\n    optional RCPduNodeCategory_E category = 7;\n}\n\nmessage RCApplicationRecordPdu {\n    required uint32 id = 1; // session id\n    required string name = 2;\n    required string tag = 3;\n    repeated uint32 channel_ids = 4 [packed = true];\n    optional uint32 capability = 5;\n}\n\n//reg.proto\n\noption optimize_for = LITE_RUNTIME;\nmessage RCRegistryRegisterKeyPdu {\n    required RCPduType_E type = 1 [default = RCPDU_REG_REGISTER_KEY];\n    required uint32 id = 2;\n    required string name = 3;\n    required string tag = 4;\n    optional bytes user_data = 5;\n}\n\nmessage RCRegistryUnregisterKeyPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_UNREGISTER_KEY];\n    required uint32 key_id = 2;\n}\n\nmessage RCRegistryRegisterObjPdu {\n    optional RCPduType_E type = 1;\n    required uint32 obj_id = 2;\n    required string name = 3;\n    required string tag = 4;\n    optional uint32 owner = 5;\n    optional bytes user_data = 6;\n}\n\nmessage RCRegistryUnregisterObjPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_UNREGISTER_OBJ];\n    required uint32 obj_id = 2;\n}\n\nmessage RCRegistryUpdateObjPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_UPDATE_OBJ];\n    required RCPduType_E sub_type = 2;\n    required uint32 obj_id = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCAdapterItemPdu {\n    required RCPduType_E type = 1;\n    required bytes item_data = 2;\n}\n\n// adapter pdu that used to package a list of pdu.\nmessage RCAdapterPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_ADAPTER];\n    repeated RCAdapterItemPdu item = 2;\n}\n\n// table operation pdu\nmessage RCRegistryTableItemPdu {\n    required uint32 item_idx = 1;\n    required uint32 owner = 2;\n    required bytes item_data = 3;\n}\n\nmessage RCRegistryTableInsertItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_TABLE_INSERT_PDU];\n    repeated RCRegistryTableItemPdu items = 2;\n}\n\nmessage RCRegistryTableDeleteItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_TABLE_DELETE_PDU];\n    repeated uint32 item_idx = 2;\n}\n\nmessage RCRegistryTableUpdateItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_TABLE_UPDATE_PDU];\n    repeated RCRegistryTableItemPdu items = 2;\n}\n\n// roster operation pdu\nmessage RCRegistryRosterItemPdu {\n    required uint32 node_id = 1;\n    required bytes node_data = 2;\n}\n\nmessage RCRegistryRosterInsertItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_ROSTER_INSERT_PDU];\n    repeated RCRegistryRosterItemPdu items = 2;\n}\n\nmessage RCRegistryRosterDeleteItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_ROSTER_DELETE_PDU];\n    required uint32 node_id = 2;\n}\n\nmessage RCRegistryRosterUpdateItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_ROSTER_UPDATE_PDU];\n    repeated RCRegistryRosterItemPdu items = 2;\n}\n\n//message RCCleanupNodePdu\n//{\n//  optional RCPduType_E    type                = 1 [default = RCPDU_REG_CLEANUP_NODE];\n//  required uint32         node_id             = 2;\n//}\n\n// parameter operation pdu\nmessage RCRegistryParameterUpdatePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_PARAMETER_UPDATE_PDU];\n    required uint32 value = 2 [default = 0];\n    optional uint32 begin_bit = 3 [default = 31];\n    optional uint32 end_bit = 4;\n}\n\n// queue operation pdu\nmessage RCRegistryQueueItemPdu {\n    required uint32 owner = 1;\n    required uint32 item_id = 2;\n    optional bytes item_data = 3;\n    optional uint32 item_idx = 4;\n}\n\nmessage RCRegstryQueueInsertItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_QUEUE_INSERT_PDU];\n    repeated RCRegistryQueueItemPdu items = 2;\n}\n\nmessage RCRegistryQueueDeleteItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_QUEUE_DELETE_PDU];\n    required uint32 item_id = 2;\n}\n\nmessage RCRegistryQueueUpdateItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_QUEUE_UPDATE_PDU];\n    repeated RCRegistryQueueItemPdu items = 2;\n}\n\nmessage RCRegistryRequestObjPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_REQUEST_OBJ];\n    required RCPduType_E sub_type = 2;\n    required uint32 obj_id = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCRegistryResponseObjPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_RESPONSE_OBJ];\n    required RCPduType_E sub_type = 2;\n    required uint32 obj_id = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCRegistryCounterRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_COUNTER_REQUEST_PDU];\n    required uint32 count = 2;\n}\n\nmessage RCRegistryCounterResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_COUNTER_RESPONSE_PDU];\n    required uint32 start = 2;\n    required uint32 end = 3;\n}\n\n// mcs\noption optimize_for = LITE_RUNTIME;\n\n// Session management\nmessage RCSessionJoinRequestPdu {\n    required RCPduType_E type = 1 [default = RCPDU_SESSION_JOIN_REQUEST];\n    required uint32 id = 2;\n    required string name = 3;\n    required string tag = 4;\n    optional bytes session_data = 5; //聚合在一起的registry信息\n}\n\nmessage RCSessionJoinResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_SESSION_JOIN_RESPONSE];\n    required uint32 id = 2;\n    optional bytes response_data = 3;\n}\n\n// Channel management\nmessage RCChannelGrabRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_GRAB_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 channel_id = 3;\n}\n\nmessage RCChannelGrabResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_GRAB_RESPONSE];\n    required uint32 initiator = 2;\n    required uint32 requested_channel_id = 3;\n    required RCPduResult_E result = 4;\n    optional uint32 channel_id = 5;\n}\n\nmessage RCChannelGrabIndicationPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_GRAB_INDICATION];\n    required uint32 initiator = 2;\n    optional uint32 channel_id = 3;\n}\n\nmessage RCChannelJoinRequestPdu {\n    required RCPduType_E type = 1 [default = RCPDU_CHANNEL_JOIN_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 channel_id = 3;\n}\n\nmessage RCChannelJoinResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_JOIN_RESPONSE];\n    required uint32 initiator = 2;\n    required uint32 requested_channel_id = 3;\n    required RCPduResult_E result = 4;\n}\n\nmessage RCChannelLeaveRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_LEAVE_REQUEST];\n    required uint32 initiator = 2;\n    repeated uint32 channel_ids = 3 [packed = true];\n}\n\nmessage RCChannelReleaseRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_RELEASE_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 channel_id = 3;\n}\n\nmessage RCChannelReleaseIndicationPdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CHANNEL_RELEASE_INDICATION];\n    required uint32 initiator = 2;\n    required uint32 channel_id = 3;\n}\n\n// Data transfer\nmessage RCSendDataPdu {\n    required RCPduType_E type = 1 [default = RCPDU_SEND_DATA_REQUEST];\n    required RCPduType_E sub_type = 2;\n    required uint32 initiator = 3;\n    required uint32 conf_id = 4;\n    required uint32 session_id = 5;\n    required uint32 channel_id = 6;\n    required bool upward = 7;\n    required bool reliability = 8;\n    required RCPduPriority_E priority = 9;\n    required bytes data = 10;\n    optional uint32 peer = 11;\n    optional RCPduSegment_E seg = 12;\n    optional uint32 total_size = 13;\n    optional uint32 site_id = 14;\n    optional string user_id = 15;\n    optional string user_name = 16;\n    optional string user_role = 17;\n    optional string device_type = 18;\n    optional string site = 19;\n}\n\n//  Token management\nmessage RCTokenGrabRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GRAB_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenGrabConfirmPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GRAB_CONFIRM];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required RCPduResult_E result = 4;\n    required RCPduTokenStatus_E status = 5;\n}\n\nmessage RCTokenInhibitRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_INHIBIT_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenInhibitConfirmPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_INHIBIT_CONFIRM];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required RCPduResult_E result = 4;\n    required RCPduTokenStatus_E status = 5;\n}\n\nmessage RCTokenGiveRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GIVE_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required uint64 recipient = 4;\n}\n\nmessage RCTokenGiveIndicationPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GIVE_INDICATION];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required uint64 recipient = 4;\n}\n\nmessage RCTokenGiveResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GIVE_RESPONSE];\n    required uint32 token_id = 2;\n    required uint64 recipient = 3;\n    required RCPduResult_E result = 4;\n}\n\nmessage RCTokenGiveConfirmPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GIVE_CONFIRM];\n    required uint32 token_id = 2;\n    required uint64 recipient = 3;\n    required RCPduResult_E result = 4;\n    required RCPduTokenStatus_E status = 5;\n}\n\nmessage RCTokenPleaseRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_PLEASE_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenPleaseIndicationPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_PLEASE_INDICATION];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenReleaseRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_RELEASE_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenReleaseConfirmPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_TEST_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required RCPduResult_E result = 4;\n    required RCPduTokenStatus_E status = 5;\n}\n\nmessage RCTokenTestRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_TEST_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenTestConfirmPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_TEST_CONFIRM];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required RCPduTokenStatus_E status = 4;\n}\n\n//gcc.proto\n\noption optimize_for = LITE_RUNTIME;\nmessage RCConferenceJoinRequestPdu {\n    required RCPduType_E type = 1 [default = RCPDU_CONFERENCE_JOIN_REQUEST];\n    required uint32 initiator = 2;\n    required RCPduNodeType_E node_type = 3;\n    required RCConferenceDescriptorPdu conf_desc = 4;\n}\n\nmessage RCConferenceJoinResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_JOIN_RESPONSE];\n    required uint32 conf_id = 2;\n    required RCPduResult_E result = 3;\n    optional RCConferenceDescriptorPdu conf_desc = 4;\n}\n\nmessage RCConferenceInviteRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_INVITE_REQUEST];\n    required uint32 initiator = 2;\n    required RCConferenceDescriptorPdu conf_desc = 3;\n}\n\nmessage RCConferenceInviteResponsePdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_INVITE_RESPONSE];\n    required RCPduResult_E result = 2;\n    optional bytes user_data = 3;\n}\n\nmessage RCConferenceLockRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_LOCK_REQUEST];\n}\n\nmessage RCConferenceLockResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_LOCK_RESPONSE];\n    required RCPduResult_E result = 2;\n}\n\nmessage RCConferenceLockIndicationPdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_LOCK_INDICATION];\n}\n\nmessage RCConferenceUnlockRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_UNLOCK_REQUEST];\n}\n\nmessage RCConferenceUnlockResponsePdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_UNLOCK_RESPONSE];\n    required RCPduResult_E result = 2;\n}\n\nmessage RCConferenceUnlockIndicationPdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_UNLOCK_INDICATION];\n}\n\nmessage RCConferenceLeaveRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_LEAVE_REQUEST];\n    required RCPduReason_E reason = 2;\n}\n\nmessage RCConferenceTerminateRequestPdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_TERMINATE_REQUEST];\n    required RCPduReason_E reason = 2;\n}\n\nmessage RCConferenceTerminateResponsePdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_TERMINATE_RESPONSE];\n    required RCPduResult_E result = 2;\n}\n\nmessage RCConferenceTerminateIndicationPdu { // MCS_Uniform_Send_Data on GCC_Broadcast_Channel\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_TERMINATE_INDICATION];\n    required RCPduReason_E reason = 2;\n}\n\nmessage RCConferenceEjectUserRequestPdu { // MCS_Send_Data on Node ID Channel of Top GCC\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_EJECT_USER_REQUEST];\n    required uint32 ejected_node_id = 2;\n    required RCPduReason_E reason = 3;\n}\n\nmessage RCConferenceEjectUserResponsePdu { // MCS_Send_Data on Node ID Channel of requester\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_EJECT_USER_RESPONSE];\n    required uint32 ejected_node_id = 2;\n    required RCPduResult_E result = 3;\n}\n\nmessage RCConferenceEjectUserIndicationPdu { // MCS_Uniform_Send_Data on GCC_Broadcast_Channel\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_EJECT_USER_INDICATION];\n    required uint32 ejected_node_id = 2;\n    required RCPduReason_E reason = 3;\n}\n\nmessage RCRosterUpdateIndicationPdu { // MCS_Send_Data on Node ID Channel or\n// MCS_Uniform_Send_Data on GCC_Broadcast_Channel\n    optional RCPduType_E type = 1 [default = RCPDU_ROSTER_UPDATE_INDICATION];\n    required bool full_refresh = 2; // Conference Roster and all\n    repeated RCNodeRecordPdu node_record = 3;\n    repeated RCApplicationRecordPdu app_record = 4;\n}\n\nmessage RCRegistryUpdateRequestPdu { // MCS_Send_Data on Node ID Channel of Top GCC\n    optional RCPduType_E type = 1 [default = RCPDU_REGISTRY_UPDATE_REQUEST];\n    required uint32 key_id = 2;\n    required uint32 obj_id = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCRegistryUpdateIndicationPdu { // MCS_Send_Data on Node ID Channel of Top GCC\n    optional RCPduType_E type = 1 [default = RCPDU_REGISTRY_UPDATE_RESPONSE];\n    required uint32 key_id = 2;\n    required uint32 obj_id = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCRegistryUpdateResponsePdu { // MCS_Send_Data on Node ID Channel of requester\n    optional RCPduType_E type = 1 [default = RCPDU_REGISTRY_UPDATE_INDICATION];\n    required uint32 key_id = 2;\n    required uint32 obj_id = 3;\n    required RCPduResult_E result = 4;\n}\n\nmessage RCFunctionNotSupportedResponsePdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_FUNCTION_NOT_SUPPORTED_RESPONSE];\n    required uint32 request_pdu_id = 2;\n}\n\n//ape.proto\n\noption optimize_for = LITE_RUNTIME;\nmessage RCConferenceSendDataRequestPdu {\n    optional uint32 initiator = 1;\n    optional uint32 peer = 2;\n    required bool is_public = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCChatSendDataRequestPdu {\n    optional uint32 initiator = 1;\n    optional uint32 peer = 2;\n    required bool is_public = 3;\n    required bytes user_data = 4;\n    required uint32 from_role = 5;\n    required bytes from_name = 6;\n}\n\nmessage RCChatSendH5DataRequestPdu {\n    optional uint32 initiator = 1;\n    optional uint32 peer = 2;\n    required bool is_public = 3;\n    required string user_data = 4;\n    required string from_role = 5;\n    required string from_name = 6;\n}\n\nmessage RCDocSendDataRequestPdu {\n    required int32 id = 1;\n    required string doc_type = 2;\n    required string uri  = 3;\n    optional int32 owner = 4;\n    optional int32 from = 5;\n    optional string name = 6;\n    optional int32 cur_page_no = 7;\n    optional int32 cur_H = 8;\n    optional int32 cur_V = 9;\n    optional int32 scale = 10;\n    optional int32 page_num = 11;\n}\n\nmessage RCGiftSendDataRequestPdu {\n    optional uint32 initiator = 1;\n    required uint32 peer = 2;\n    required uint32 index = 3;\n    required uint32 num = 4;\n    optional bytes user_data = 5;\n}\n\nmessage RCAudioSendDataRequestPdu {\n    optional uint32 initiator = 1;\n    required bytes user_data = 2;\n}\n\nmessage RCVideoSendDataRequestPdu {\n    optional uint32 initiator = 1;\n    required bool key_frame = 2;\n    required uint32 sequence_id = 3;\n    required uint32 slice_id = 4;\n    required bytes user_data = 5;\n}\n\nmessage RCAudioChannelInfoRecordPdu {\n    required uint32 status = 1;\n    required uint32 device_id = 2;\n    required uint32 framerate = 3;\n    required uint32 bitrate = 4;\n    required uint32 codec = 5;\n}\n\nmessage RCVideoChannelInfoRecordPdu {\n    optional uint32 status = 1;\n    optional uint32 device_id = 2;\n    optional uint32 width = 3;\n    optional uint32 height = 4;\n    optional uint32 framerate = 5;\n    optional uint32 bitrate = 6;\n    optional uint32 codec = 7;\n    optional string peer_id = 8;\n    optional string url = 9;\n    optional uint32 type = 10;\n    optional string shamlive = 11;\n    optional uint32 livetype = 12;\n    optional uint32 releaseGrab = 13;\n    optional string curTime = 14;\n}\n\nmessage RCAudioDeviceInfoRecordPdu {\n    required uint32 device_id = 1;\n    required string device_name = 2;\n}\n\nmessage RCVideoDeviceInfoRecordPdu {\n    required uint32 device_id = 1;\n    required string device_name = 2;\n}\n\nmessage RCNodeInfoRecordPdu {\n    required uint32 node_id = 1;\n    required string name = 2;\n    required uint32 role = 3;\n    required uint32 level = 4;\n    repeated RCAudioDeviceInfoRecordPdu audio_records = 5;\n    repeated RCVideoDeviceInfoRecordPdu video_records = 6;\n    optional uint32 status = 7;\n    optional bytes user_data = 8;\n    optional string user_id = 9;\n    optional uint32 handUpTime = 10;\n    optional uint32 deviceType = 11;\n    optional uint32 mobileDirection = 12;\n}\n\nmessage RCVotingPollSettingsPdu {\n    required bool timer = 1;\n    optional uint32 time_limit = 2;\n    optional uint32 total_score = 3;\n}\n\nmessage RCVotingPollResultPdu {\n    required string title = 1;\n    required string content = 2;\n    optional uint32 score = 3;\n}\n\nmessage RCVotingPollQuestionPdu {\n    required uint32 index = 1;\n    required uint32 type = 2;\n    required string title = 3;\n    repeated string options = 4;\n    optional uint32 score = 5;\n    optional uint32 time_limit = 6;\n    optional string restrict_input = 7;\n    optional uint32 char_limit = 8;\n    optional string answer = 9;\n    repeated uint32 selections = 10;\n    repeated string responses = 11;\n}\n\nmessage RCVotingPollRecordPdu {\n    required RCVotingPollSettingsPdu settings = 1;\n    required string title = 2;\n    repeated RCVotingPollResultPdu results = 3;\n    repeated RCVotingPollQuestionPdu questions = 4;\n}\n\nmessage RCNodeInfoUserDataPdu {\n    optional string qq = 1;\n    optional string skype = 2;\n    optional string mobile = 3;\n}\n\nmessage RCWhiteboardDataRequestPdu {\n    required uint32 id = 1;\n    required uint32 type = 2;\n    required uint32 initiator = 3;\n    optional bytes action = 4;\n    optional uint32 uncomprLen = 5;\n}\n\nmessage RCTabUpdateDataRequestPdu {\n    optional uint32 id = 1;\n    optional bytes action = 2;\n    optional uint32 uncomprLen =3;\n}\n\n\n\n//end\n';
-t.default=n;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&__REACT_HOT_LOADER__.register(n,"default","D:/work/McuClient/src/pdu/pro.js")})()},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function o(e){if(h===clearTimeout)return clearTimeout(e);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(e);try{return h(e)}catch(t){try{return h.call(null,e)}catch(t){return h.call(this,e)}}}function s(){_&&c&&(_=!1,c.length?E=c.concat(E):p=-1,E.length&&a())}function a(){if(!_){var e=i(s);_=!0;for(var t=E.length;t;){for(c=E,E=[];++p<t;)c&&c[p].run();p=-1,t=E.length}c=null,_=!1,o(e)}}function u(e,t){this.fun=e,this.array=t}function f(){}var l,h,d=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{h="function"==typeof clearTimeout?clearTimeout:r}catch(e){h=r}}();var c,E=[],_=!1,p=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];E.push(new u(e,t)),1!==E.length||_||i(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=f,d.addListener=f,d.once=f,d.off=f,d.removeListener=f,d.removeAllListeners=f,d.emit=f,d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t){"use strict";function n(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function r(e){return 3*e.length/4-n(e)}function i(e){var t,r,i,o,s,a,u=e.length;s=n(e),a=new l(3*u/4-s),i=s>0?u-4:u;var h=0;for(t=0,r=0;t<i;t+=4,r+=3)o=f[e.charCodeAt(t)]<<18|f[e.charCodeAt(t+1)]<<12|f[e.charCodeAt(t+2)]<<6|f[e.charCodeAt(t+3)],a[h++]=o>>16&255,a[h++]=o>>8&255,a[h++]=255&o;return 2===s?(o=f[e.charCodeAt(t)]<<2|f[e.charCodeAt(t+1)]>>4,a[h++]=255&o):1===s&&(o=f[e.charCodeAt(t)]<<10|f[e.charCodeAt(t+1)]<<4|f[e.charCodeAt(t+2)]>>2,a[h++]=o>>8&255,a[h++]=255&o),a}function o(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function s(e,t,n){for(var r,i=[],s=t;s<n;s+=3)r=(e[s]<<16)+(e[s+1]<<8)+e[s+2],i.push(o(r));return i.join("")}function a(e){for(var t,n=e.length,r=n%3,i="",o=[],a=16383,f=0,l=n-r;f<l;f+=a)o.push(s(e,f,f+a>l?l:f+a));return 1===r?(t=e[n-1],i+=u[t>>2],i+=u[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=u[t>>10],i+=u[t>>4&63],i+=u[t<<2&63],i+="="),o.push(i),o.join("")}t.byteLength=r,t.toByteArray=i,t.fromByteArray=a;for(var u=[],f=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,c=h.length;d<c;++d)u[d]=h[d],f[h.charCodeAt(d)]=d;f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63},function(e,t,n){var r,i,o;(function(e,s){!function(e,a){n(9).amd?(i=[n(14)],r=a,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(s.exports=o))):"object"==typeof s&&s&&s.exports?s.exports=a(n(14),!0):(e.dcodeIO=e.dcodeIO||{}).ProtoBuf=a(e.dcodeIO.ByteBuffer)}(this,function(t,r){"use strict";var i={};return i.ByteBuffer=t,i.Long=t.Long||null,i.VERSION="5.0.1",i.WIRE_TYPES={},i.WIRE_TYPES.VARINT=0,i.WIRE_TYPES.BITS64=1,i.WIRE_TYPES.LDELIM=2,i.WIRE_TYPES.STARTGROUP=3,i.WIRE_TYPES.ENDGROUP=4,i.WIRE_TYPES.BITS32=5,i.PACKABLE_WIRE_TYPES=[i.WIRE_TYPES.VARINT,i.WIRE_TYPES.BITS64,i.WIRE_TYPES.BITS32],i.TYPES={int32:{name:"int32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.ZERO:void 0},uint64:{name:"uint64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.UZERO:void 0},sint64:{name:"sint64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.ZERO:void 0},bool:{name:"bool",wireType:i.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:i.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:i.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:i.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:i.WIRE_TYPES.BITS64,defaultValue:i.Long?i.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:i.WIRE_TYPES.BITS64,defaultValue:i.Long?i.Long.ZERO:void 0},float:{name:"float",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:i.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:i.WIRE_TYPES.STARTGROUP,defaultValue:null}},i.MAP_KEY_TYPES=[i.TYPES.int32,i.TYPES.sint32,i.TYPES.sfixed32,i.TYPES.uint32,i.TYPES.fixed32,i.TYPES.int64,i.TYPES.sint64,i.TYPES.sfixed64,i.TYPES.uint64,i.TYPES.fixed64,i.TYPES.bool,i.TYPES.string,i.TYPES.bytes],i.ID_MIN=1,i.ID_MAX=536870911,i.convertFieldsToCamelCase=!1,i.populateAccessors=!0,i.populateDefaults=!0,i.Util=function(){var t={};return t.IS_NODE=!("object"!=typeof e||e+""!="[object process]"||e.browser),t.XHR=function(){for(var e=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],t=null,n=0;n<e.length;n++){try{t=e[n]()}catch(e){continue}break}if(!t)throw Error("XMLHttpRequest is not supported");return t},t.fetch=function(e,r){if(r&&"function"!=typeof r&&(r=null),t.IS_NODE){var i=n(32);if(r)i.readFile(e,function(e,t){r(e?null:""+t)});else try{return i.readFileSync(e)}catch(e){return null}}else{var o=t.XHR();if(o.open("GET",e,!!r),o.setRequestHeader("Accept","text/plain"),"function"==typeof o.overrideMimeType&&o.overrideMimeType("text/plain"),!r)return o.send(null),200==o.status||0==o.status&&"string"==typeof o.responseText?o.responseText:null;if(o.onreadystatechange=function(){4==o.readyState&&r(200==o.status||0==o.status&&"string"==typeof o.responseText?o.responseText:null)},4==o.readyState)return;o.send(null)}},t.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,function(e,t){return t.toUpperCase()})},t}(),i.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},i.DotProto=function(e,t){function n(e,n){var r=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))r=parseInt(e);else if(t.NUMBER_HEX.test(e))r=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);r=parseInt(e.substring(1),8)}if(r=i*r|0,!n&&r<0)throw Error("illegal id value: "+(i<0?"-":"")+e);return r}function r(e){var n=1;if("-"==e.charAt(0)&&(n=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return n*parseInt(e,10);if(t.NUMBER_HEX.test(e))return n*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return n*parseInt(e.substring(1),8);if("inf"===e)return n*(1/0);if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return n*parseFloat(e);throw Error("illegal number value: "+(n<0?"-":"")+e)}function i(e,t,n){"undefined"==typeof e[t]?e[t]=n:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(n))}var o={},s=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},a=s.prototype;a._readString=function(){var e='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;e.lastIndex=this.index-1;var n=e.exec(this.source);if(!n)throw Error("unterminated string");return this.index=e.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,n[1]},a.next=function(){if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();var e,n,r;do{for(e=!1;t.WHITESPACE.test(r=this.source.charAt(this.index));)if("\n"===r&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(r=this.source.charAt(this.index)))return"/";do{if("\n"===r&&++this.line,++this.index===this.source.length)return null;n=r,r=this.source.charAt(this.index)}while("*"!==n||"/"!==r);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;var i=this.index;t.DELIM.lastIndex=0;var o=t.DELIM.test(this.source.charAt(i++));if(!o)for(;i<this.source.length&&!t.DELIM.test(this.source.charAt(i));)++i;var s=this.source.substring(this.index,this.index=i);return'"'!==s&&"'"!==s||(this._stringOpen=s),s},a.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},a.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},a.omit=function(e){return this.peek()===e&&(this.next(),!0)},a.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},o.Tokenizer=s;var u=function(e){this.tn=new s(e),this.proto3=!1},f=u.prototype;return f.parse=function(){var e,n,r={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},i=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!i||null!==r.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),r.package=e;break;case"import":if(!i)throw Error("unexpected 'import'");e=this.tn.peek(),("public"===e||(n="weak"===e))&&this.tn.next(),e=this._readString(),this.tn.skip(";"),n||r.imports.push(e);break;case"syntax":if(!i)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(r.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(r,null),i=!1;break;case"enum":this._parseEnum(r),i=!1;break;case"option":this._parseOption(r);break;case"service":this._parseService(r);break;case"extend":this._parseExtend(r);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete r.name,r},u.parse=function(e){return new u(e).parse()},f._readString=function(){var e,t,n="";do{if(t=this.tn.next(),"'"!==t&&'"'!==t)throw Error("illegal string delimiter: "+t);n+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return n},f._readValue=function(e){var n=this.tn.peek();if('"'===n||"'"===n)return this._readString();if(this.tn.next(),t.NUMBER.test(n))return r(n);if(t.BOOL.test(n))return"true"===n.toLowerCase();if(e&&t.TYPEREF.test(n))return n;throw Error("illegal value: "+n)},f._parseOption=function(e,n){var r=this.tn.next(),i=!1;if("("===r&&(i=!0,r=this.tn.next()),!t.TYPEREF.test(r))throw Error("illegal option name: "+r);var o=r;i&&(this.tn.skip(")"),o="("+o+")",r=this.tn.peek(),t.FQTYPEREF.test(r)&&(o+=r,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,o),n||this.tn.skip(";")},f._parseOptionValue=function(e,n){var r=this.tn.peek();if("{"!==r)i(e.options,n,this._readValue(!0));else for(this.tn.skip("{");"}"!==(r=this.tn.next());){if(!t.NAME.test(r))throw Error("illegal option name: "+n+"."+r);this.tn.omit(":")?i(e.options,n+"."+r,this._readValue(!0)):this._parseOptionValue(e,n+"."+r)}},f._parseService=function(e){var n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal service name at line "+this.tn.line+": "+n);var r=n,i={name:r,rpc:{},options:{}};for(this.tn.skip("{");"}"!==(n=this.tn.next());)if("option"===n)this._parseOption(i);else{if("rpc"!==n)throw Error("illegal service token: "+n);this._parseServiceRPC(i)}this.tn.omit(";"),e.services.push(i)},f._parseServiceRPC=function(e){var n="rpc",r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal rpc service method name: "+r);var i=r,o={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};if(this.tn.skip("("),r=this.tn.next(),"stream"===r.toLowerCase()&&(o.request_stream=!0,r=this.tn.next()),!t.TYPEREF.test(r))throw Error("illegal rpc service request type: "+r);if(o.request=r,this.tn.skip(")"),r=this.tn.next(),"returns"!==r.toLowerCase())throw Error("illegal rpc service request type delimiter: "+r);if(this.tn.skip("("),r=this.tn.next(),"stream"===r.toLowerCase()&&(o.response_stream=!0,r=this.tn.next()),o.response=r,this.tn.skip(")"),r=this.tn.peek(),"{"===r){for(this.tn.next();"}"!==(r=this.tn.next());){if("option"!==r)throw Error("illegal rpc service token: "+r);this._parseOption(o)}this.tn.omit(";")}else this.tn.skip(";");"undefined"==typeof e[n]&&(e[n]={}),e[n][i]=o},f._parseMessage=function(e,r){var i=!!r,o=this.tn.next(),s={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(o))throw Error("illegal "+(i?"group":"message")+" name: "+o);for(s.name=o,i&&(this.tn.skip("="),r.id=n(this.tn.next()),s.isGroup=!0),o=this.tn.peek(),"["===o&&r&&this._parseFieldOptions(r),this.tn.skip("{");"}"!==(o=this.tn.next());)if(t.RULE.test(o))this._parseMessageField(s,o);else if("oneof"===o)this._parseMessageOneOf(s);else if("enum"===o)this._parseEnum(s);else if("message"===o)this._parseMessage(s);else if("option"===o)this._parseOption(s);else if("service"===o)this._parseService(s);else if("extensions"===o)s.extensions=this._parseExtensionRanges();else if("reserved"===o)this._parseIgnored();else if("extend"===o)this._parseExtend(s);else{if(!t.TYPEREF.test(o))throw Error("illegal message token: "+o);if(!this.proto3)throw Error("illegal field rule: "+o);this._parseMessageField(s,"optional",o)}return this.tn.omit(";"),e.messages.push(s),s},f._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},f._parseMessageField=function(e,r,i){if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);var o,s={rule:r,type:"",name:"",options:{},id:0};if("map"===r){if(i)throw Error("illegal type: "+i);if(this.tn.skip("<"),o=this.tn.next(),!t.TYPE.test(o)&&!t.TYPEREF.test(o))throw Error("illegal message field type: "+o);if(s.keytype=o,this.tn.skip(","),o=this.tn.next(),!t.TYPE.test(o)&&!t.TYPEREF.test(o))throw Error("illegal message field: "+o);if(s.type=o,this.tn.skip(">"),o=this.tn.next(),!t.NAME.test(o))throw Error("illegal message field name: "+o);s.name=o,this.tn.skip("="),s.id=n(this.tn.next()),o=this.tn.peek(),"["===o&&this._parseFieldOptions(s),this.tn.skip(";")}else if(i="undefined"!=typeof i?i:this.tn.next(),"group"===i){var a=this._parseMessage(e,s);if(!/^[A-Z]/.test(a.name))throw Error("illegal group name: "+a.name);s.type=a.name,s.name=a.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(s.type=i,o=this.tn.next(),!t.NAME.test(o))throw Error("illegal message field name: "+o);s.name=o,this.tn.skip("="),s.id=n(this.tn.next()),o=this.tn.peek(),"["===o&&this._parseFieldOptions(s),this.tn.skip(";")}return e.fields.push(s),s},f._parseMessageOneOf=function(e){var n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal oneof name: "+n);var r,i=n,o=[];for(this.tn.skip("{");"}"!==(n=this.tn.next());)r=this._parseMessageField(e,"optional",n),r.oneof=i,o.push(r.id);this.tn.omit(";"),e.oneofs[i]=o},f._parseFieldOptions=function(e){this.tn.skip("[");for(var t,n=!0;"]"!==(t=this.tn.peek());)n||this.tn.skip(","),this._parseOption(e,!0),n=!1;this.tn.next()},f._parseEnum=function(e){var r={name:"",values:[],options:{}},i=this.tn.next();if(!t.NAME.test(i))throw Error("illegal name: "+i);for(r.name=i,this.tn.skip("{");"}"!==(i=this.tn.next());)if("option"===i)this._parseOption(r);else{if(!t.NAME.test(i))throw Error("illegal name: "+i);this.tn.skip("=");var o={name:i,id:n(this.tn.next(),!0)};i=this.tn.peek(),"["===i&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),r.values.push(o)}this.tn.omit(";"),e.enums.push(r)},f._parseExtensionRanges=function(){var t,n,i,o=[];do{for(n=[];;){switch(t=this.tn.next()){case"min":i=e.ID_MIN;break;case"max":i=e.ID_MAX;break;default:i=r(t)}if(n.push(i),2===n.length)break;if("to"!==this.tn.peek()){n.push(i);break}this.tn.next()}o.push(n)}while(this.tn.omit(","));return this.tn.skip(";"),o},f._parseExtend=function(e){var n=this.tn.next();if(!t.TYPEREF.test(n))throw Error("illegal extend reference: "+n);var r={ref:n,fields:[]};for(this.tn.skip("{");"}"!==(n=this.tn.next());)if(t.RULE.test(n))this._parseMessageField(r,n);else{if(!t.TYPEREF.test(n))throw Error("illegal extend token: "+n);if(!this.proto3)throw Error("illegal field rule: "+n);this._parseMessageField(r,"optional",n)}return this.tn.omit(";"),e.messages.push(r),r},f.toString=function(){return"Parser at line "+this.tn.line},o.Parser=u,o}(i,i.Lang),i.Reflect=function(e){function n(n){if("string"==typeof n&&(n=e.TYPES[n]),"undefined"==typeof n.defaultValue)throw Error("default value for type "+n.name+" is not supported");return n==e.TYPES.bytes?new t(0):n.defaultValue}function r(t,n){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low===t.low&&t.high===t.high)return new e.Long(t.low,t.high,"undefined"==typeof n?t.unsigned:n);if("string"==typeof t)return e.Long.fromString(t,n||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,n||!1);throw Error("not convertible to Long")}function i(t,n){var r=n.readVarint32(),o=7&r,s=r>>>3;switch(o){case e.WIRE_TYPES.VARINT:do r=n.readUint8();while(128===(128&r));break;case e.WIRE_TYPES.BITS64:n.offset+=8;break;case e.WIRE_TYPES.LDELIM:r=n.readVarint32(),n.offset+=r;break;case e.WIRE_TYPES.STARTGROUP:i(s,n);break;case e.WIRE_TYPES.ENDGROUP:if(s===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+s+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:n.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+o)}return!0}var o={},s=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},a=s.prototype;a.fqn=function(){for(var e=this.name,t=this;;){if(t=t.parent,null==t)break;e=t.name+"."+e}return e},a.toString=function(e){return(e?this.className+" ":"")+this.fqn()},a.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},o.T=s;var u=function(e,t,n,r,i){s.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=i||"proto2"},f=u.prototype=Object.create(s.prototype);f.getChildren=function(e){if(e=e||null,null==e)return this.children.slice();for(var t=[],n=0,r=this.children.length;n<r;++n)this.children[n]instanceof e&&t.push(this.children[n]);return t},f.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof d.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof d.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},f.getChild=function(e){for(var t="number"==typeof e?"id":"name",n=0,r=this.children.length;n<r;++n)if(this.children[n][t]===e)return this.children[n];return null},f.resolve=function(e,t){var n="string"==typeof e?e.split("."):e,r=this,i=0;if(""===n[i]){for(;null!==r.parent;)r=r.parent;i++}var s;do{do{if(!(r instanceof o.Namespace)){r=null;break}if(s=r.getChild(n[i]),!s||!(s instanceof o.T)||t&&!(s instanceof o.Namespace)){r=null;break}r=s,i++}while(i<n.length);if(null!=r)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=r);return r},f.qn=function(e){var t=[],n=e;do t.unshift(n.name),n=n.parent;while(null!==n);for(var r=1;r<=t.length;r++){var i=t.slice(t.length-r);if(e===this.resolve(i,e instanceof o.Namespace))return i.join(".")}return e.fqn()},f.build=function(){for(var e,t={},n=this.children,r=0,i=n.length;r<i;++r)e=n[r],e instanceof u&&(t[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(t,"$options",{value:this.buildOpt()}),t},f.buildOpt=function(){for(var e={},t=Object.keys(this.options),n=0,r=t.length;n<r;++n){var i=t[n],o=this.options[t[n]];e[i]=o}return e},f.getOption=function(e){return"undefined"==typeof e?this.options:"undefined"!=typeof this.options[e]?this.options[e]:null},o.Namespace=u;var l=function(t,n,r,i){if(this.type=t,this.resolvedType=n,this.isMapKey=r,this.syntax=i,r&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},h=l.prototype;l.defaultFieldValue=n,h.verifyValue=function(n){function i(e,t){throw Error("Illegal value for "+o.toString(!0)+" of type "+o.type.name+": "+e+" ("+t+")")}var o=this;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof n||n===n&&n%1!==0)&&i(typeof n,"not an integer"),n>4294967295?0|n:n;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof n||n===n&&n%1!==0)&&i(typeof n,"not an integer"),n<0?n>>>0:n;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return r(n,!1)}catch(e){i(typeof n,e.message)}else i(typeof n,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return r(n,!0)}catch(e){i(typeof n,e.message)}else i(typeof n,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof n&&i(typeof n,"not a boolean"),n;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof n&&i(typeof n,"not a number"),n;case e.TYPES.string:return"string"==typeof n||n&&n instanceof String||i(typeof n,"not a string"),""+n;case e.TYPES.bytes:return t.isByteBuffer(n)?n:t.wrap(n,"base64");case e.TYPES.enum:var s=this.resolvedType.getChildren(e.Reflect.Enum.Value);for(u=0;u<s.length;u++){if(s[u].name==n)return s[u].id;if(s[u].id==n)return s[u].id}if("proto3"===this.syntax)return("number"!=typeof n||n===n&&n%1!==0)&&i(typeof n,"not an integer"),(n>4294967295||n<0)&&i(typeof n,"not in range for uint32"),n;i(n,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(n&&"object"==typeof n||i(typeof n,"object expected"),n instanceof this.resolvedType.clazz)return n;if(n instanceof e.Builder.Message){var a={};for(var u in n)n.hasOwnProperty(u)&&(a[u]=n[u]);n=a}return new this.resolvedType.clazz(n)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+n+" (undefined type "+this.type+")")},h.calculateLength=function(n,r){if(null===r)return 0;var i;switch(this.type){case e.TYPES.int32:return r<0?t.calculateVarint64(r):t.calculateVarint32(r);case e.TYPES.uint32:return t.calculateVarint32(r);case e.TYPES.sint32:return t.calculateVarint32(t.zigZagEncode32(r));case e.TYPES.fixed32:case e.TYPES.sfixed32:case e.TYPES.float:return 4;case e.TYPES.int64:case e.TYPES.uint64:return t.calculateVarint64(r);case e.TYPES.sint64:return t.calculateVarint64(t.zigZagEncode64(r));case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES.enum:return t.calculateVarint32(r);case e.TYPES.double:return 8;case e.TYPES.string:return i=t.calculateUTF8Bytes(r),t.calculateVarint32(i)+i;case e.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");return t.calculateVarint32(r.remaining())+r.remaining();case e.TYPES.message:return i=this.resolvedType.calculate(r),t.calculateVarint32(i)+i;case e.TYPES.group:return i=this.resolvedType.calculate(r),i+t.calculateVarint32(n<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")},h.encodeValue=function(n,r,i){if(null===r)return i;switch(this.type){case e.TYPES.int32:r<0?i.writeVarint64(r):i.writeVarint32(r);break;case e.TYPES.uint32:i.writeVarint32(r);break;case e.TYPES.sint32:i.writeVarint32ZigZag(r);break;case e.TYPES.fixed32:i.writeUint32(r);break;case e.TYPES.sfixed32:i.writeInt32(r);break;case e.TYPES.int64:case e.TYPES.uint64:i.writeVarint64(r);break;case e.TYPES.sint64:i.writeVarint64ZigZag(r);break;case e.TYPES.fixed64:i.writeUint64(r);break;case e.TYPES.sfixed64:i.writeInt64(r);break;case e.TYPES.bool:"string"==typeof r?i.writeVarint32("false"===r.toLowerCase()?0:!!r):i.writeVarint32(r?1:0);break;case e.TYPES.enum:i.writeVarint32(r);break;case e.TYPES.float:i.writeFloat32(r);break;case e.TYPES.double:i.writeFloat64(r);break;case e.TYPES.string:i.writeVString(r);break;case e.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");var o=r.offset;i.writeVarint32(r.remaining()),i.append(r),r.offset=o;break;case e.TYPES.message:var s=(new t).LE();this.resolvedType.encode(r,s),i.writeVarint32(s.offset),i.append(s.flip());break;case e.TYPES.group:this.resolvedType.encode(r,i),i.writeVarint32(n<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")}return i},h.decode=function(t,n,r){if(n!=this.type.wireType)throw Error("Unexpected wire type for element");var i,o;switch(this.type){case e.TYPES.int32:return 0|t.readVarint32();case e.TYPES.uint32:return t.readVarint32()>>>0;case e.TYPES.sint32:return 0|t.readVarint32ZigZag();case e.TYPES.fixed32:return t.readUint32()>>>0;case e.TYPES.sfixed32:return 0|t.readInt32();case e.TYPES.int64:return t.readVarint64();case e.TYPES.uint64:return t.readVarint64().toUnsigned();case e.TYPES.sint64:return t.readVarint64ZigZag();case e.TYPES.fixed64:return t.readUint64();case e.TYPES.sfixed64:return t.readInt64();case e.TYPES.bool:return!!t.readVarint32();case e.TYPES.enum:return t.readVarint32();case e.TYPES.float:return t.readFloat();case e.TYPES.double:return t.readDouble();case e.TYPES.string:return t.readVString();case e.TYPES.bytes:if(o=t.readVarint32(),t.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+t.remaining());return i=t.clone(),i.limit=i.offset+o,t.offset+=o,i;case e.TYPES.message:return o=t.readVarint32(),this.resolvedType.decode(t,o);case e.TYPES.group:return this.resolvedType.decode(t,-1,r)}throw Error("[INTERNAL] Illegal decode type")},h.valueFromString=function(n){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(n));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(n);case e.TYPES.bool:return"true"===n;case e.TYPES.string:return this.verifyValue(n);case e.TYPES.bytes:return t.fromBinary(n)}},h.valueToString=function(t){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===e.TYPES.bytes?t.toString("binary"):t.toString()},o.Element=l;var d=function(e,t,n,r,i,o){u.call(this,e,t,n,r,o),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},c=d.prototype=Object.create(u.prototype);c.build=function(n){if(this.clazz&&!n)return this.clazz;var r=function(e,n){function r(n,i,o,s){if(null===n||"object"!=typeof n){if(s&&s instanceof e.Reflect.Enum){var a=e.Reflect.Enum.getName(s.object,n);if(null!==a)return a}return n}if(t.isByteBuffer(n))return i?n.toBase64():n.toBuffer();if(e.Long.isLong(n))return o?n.toString():e.Long.fromValue(n);var u;if(Array.isArray(n))return u=[],n.forEach(function(e,t){u[t]=r(e,i,o,s)}),u;if(u={},n instanceof e.Map){for(var f=n.entries(),l=f.next();!l.done;l=f.next())u[n.keyElem.valueToString(l.value[0])]=r(l.value[1],i,o,n.valueElem.resolvedType);return u}var h=n.$type,d=void 0;for(var c in n)n.hasOwnProperty(c)&&(h&&(d=h.getChild(c))?u[c]=r(n[c],i,o,d.resolvedType):u[c]=r(n[c],i,o));return u}var i=n.getChildren(e.Reflect.Message.Field),o=n.getChildren(e.Reflect.Message.OneOf),s=function(r,a){e.Builder.Message.call(this);for(var u=0,f=o.length;u<f;++u)this[o[u].name]=null;for(u=0,f=i.length;u<f;++u){var l=i[u];this[l.name]=l.repeated?[]:l.map?new e.Map(l):null,!l.required&&"proto3"!==n.syntax||null===l.defaultValue||(this[l.name]=l.defaultValue)}if(arguments.length>0){var h;if(1!==arguments.length||null===r||"object"!=typeof r||!("function"!=typeof r.encode||r instanceof s)||Array.isArray(r)||r instanceof e.Map||t.isByteBuffer(r)||r instanceof ArrayBuffer||e.Long&&r instanceof e.Long)for(u=0,f=arguments.length;u<f;++u)"undefined"!=typeof(h=arguments[u])&&this.$set(i[u].name,h);else this.$set(r)}},a=s.prototype=Object.create(e.Builder.Message.prototype);a.add=function(t,r,i){var o=n._fieldsByName[t];if(!i){if(!o)throw Error(this+"#"+t+" is undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+o.toString(!0));if(!o.repeated)throw Error(this+"#"+t+" is not a repeated field");r=o.verifyValue(r,!0)}return null===this[t]&&(this[t]=[]),this[t].push(r),this},a.$add=a.add,a.set=function(t,r,i){if(t&&"object"==typeof t){i=r;for(var o in t)t.hasOwnProperty(o)&&"undefined"!=typeof(r=t[o])&&this.$set(o,r,i);return this}var s=n._fieldsByName[t];if(i)this[t]=r;else{if(!s)throw Error(this+"#"+t+" is not a field: undefined");if(!(s instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+s.toString(!0));this[s.name]=r=s.verifyValue(r)}if(s&&s.oneof){var a=this[s.oneof.name];null!==r?(null!==a&&a!==s.name&&(this[a]=null),this[s.oneof.name]=s.name):a===t&&(this[s.oneof.name]=null)}return this},a.$set=a.set,a.get=function(t,r){if(r)return this[t];var i=n._fieldsByName[t];if(!(i&&i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: undefined");if(!(i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+i.toString(!0));return this[i.name]},a.$get=a.get;for(var u=0;u<i.length;u++){var f=i[u];f instanceof e.Reflect.Message.ExtensionField||n.builder.options.populateAccessors&&function(e){var t=e.originalName.replace(/(_[a-zA-Z])/g,function(e){return e.toUpperCase().replace("_","")});t=t.substring(0,1).toUpperCase()+t.substring(1);var r=e.originalName.replace(/([A-Z])/g,function(e){return"_"+e}),i=function(t,n){return this[e.name]=n?t:e.verifyValue(t),this},o=function(){return this[e.name]};null===n.getChild("set"+t)&&(a["set"+t]=i),null===n.getChild("set_"+r)&&(a["set_"+r]=i),null===n.getChild("get"+t)&&(a["get"+t]=o),null===n.getChild("get_"+r)&&(a["get_"+r]=o)}(f)}a.encode=function(e,r){"boolean"==typeof e&&(r=e,e=void 0);var i=!1;e||(e=new t,i=!0);var o=e.littleEndian;try{return n.encode(this,e.LE(),r),(i?e.flip():e).LE(o)}catch(t){throw e.LE(o),t}},s.encode=function(e,t,n){return new s(e).encode(t,n)},a.calculate=function(){return n.calculate(this)},a.encodeDelimited=function(e,r){var i=!1;e||(e=new t,i=!0);var o=(new t).LE();return n.encode(this,o,r).flip(),e.writeVarint32(o.remaining()),e.append(o),i?e.flip():e},a.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},a.toArrayBuffer=a.encodeAB,a.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){
-throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},a.toBuffer=a.encodeNB,a.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},a.toBase64=a.encode64,a.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},a.toHex=a.encodeHex,a.toRaw=function(e,t){return r(this,!!e,!!t,this.$type)},a.encodeJSON=function(){return JSON.stringify(r(this,!0,!0,this.$type))},s.decode=function(e,r,i){"string"==typeof r&&(i=r,r=-1),"string"==typeof e&&(e=t.wrap(e,i?i:"base64")),e=t.isByteBuffer(e)?e:t.wrap(e);var o=e.littleEndian;try{var s=n.decode(e.LE());return e.LE(o),s}catch(t){throw e.LE(o),t}},s.decodeDelimited=function(e,r){if("string"==typeof e&&(e=t.wrap(e,r?r:"base64")),e=t.isByteBuffer(e)?e:t.wrap(e),e.remaining()<1)return null;var i=e.offset,o=e.readVarint32();if(e.remaining()<o)return e.offset=i,null;try{var s=n.decode(e.slice(e.offset,e.offset+o).LE());return e.offset+=o,s}catch(t){throw e.offset+=o,t}},s.decode64=function(e){return s.decode(e,"base64")},s.decodeHex=function(e){return s.decode(e,"hex")},s.decodeJSON=function(e){return new s(JSON.parse(e))},a.toString=function(){return n.toString()};return Object.defineProperty&&(Object.defineProperty(s,"$options",{value:n.buildOpt()}),Object.defineProperty(a,"$options",{value:s.$options}),Object.defineProperty(s,"$type",{value:n}),Object.defineProperty(a,"$type",{value:n})),s}(e,this);this._fields=[],this._fieldsById={},this._fieldsByName={};for(var i,o=0,s=this.children.length;o<s;o++)if(i=this.children[o],i instanceof R||i instanceof d||i instanceof S){if(r.hasOwnProperty(i.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+i.toString(!0)+" cannot override static property '"+i.name+"'");r[i.name]=i.build()}else if(i instanceof d.Field)i.build(),this._fields.push(i),this._fieldsById[i.id]=i,this._fieldsByName[i.name]=i;else if(!(i instanceof d.OneOf||i instanceof C))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[o].toString(!0));return this.clazz=r},c.encode=function(e,t,n){for(var r,i,o=null,s=0,a=this._fields.length;s<a;++s)r=this._fields[s],i=e[r.name],r.required&&null===i?null===o&&(o=r):r.encode(n?i:r.verifyValue(i),t,e);if(null!==o){var u=Error("Missing at least one required field for "+this.toString(!0)+": "+o);throw u.encoded=t,u}return t},c.calculate=function(e){for(var t,n,r=0,i=0,o=this._fields.length;i<o;++i){if(t=this._fields[i],n=e[t.name],t.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);r+=t.calculate(n,e)}return r},c.decode=function(t,n,r){n="number"==typeof n?n:-1;for(var o,s,a,u,f=t.offset,l=new this.clazz;t.offset<f+n||n===-1&&t.remaining()>0;){if(o=t.readVarint32(),s=7&o,a=o>>>3,s===e.WIRE_TYPES.ENDGROUP){if(a!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(r?r+" expected":"not a group")+")");break}if(u=this._fieldsById[a]){if(u.repeated&&!u.options.packed)l[u.name].push(u.decode(s,t));else if(u.map){var h=u.decode(s,t);l[u.name].set(h[0],h[1])}else if(l[u.name]=u.decode(s,t),u.oneof){var d=l[u.oneof.name];null!==d&&d!==u.name&&(l[d]=null),l[u.oneof.name]=u.name}}else switch(s){case e.WIRE_TYPES.VARINT:t.readVarint32();break;case e.WIRE_TYPES.BITS32:t.offset+=4;break;case e.WIRE_TYPES.BITS64:t.offset+=8;break;case e.WIRE_TYPES.LDELIM:var c=t.readVarint32();t.offset+=c;break;case e.WIRE_TYPES.STARTGROUP:for(;i(a,t););break;default:throw Error("Illegal wire type for unknown field "+a+" in "+this.toString(!0)+"#decode: "+s)}}for(var E=0,_=this._fields.length;E<_;++E)if(u=this._fields[E],null===l[u.name])if("proto3"===this.syntax)l[u.name]=u.defaultValue;else{if(u.required){var p=Error("Missing at least one required field for "+this.toString(!0)+": "+u.name);throw p.decoded=l,p}e.populateDefaults&&null!==u.defaultValue&&(l[u.name]=u.defaultValue)}return l},o.Message=d;var E=function(t,n,r,i,o,a,u,f,l,h){s.call(this,t,n,a),this.className="Message.Field",this.required="required"===r,this.repeated="repeated"===r,this.map="map"===r,this.keyType=i||null,this.type=o,this.resolvedType=null,this.id=u,this.options=f||{},this.defaultValue=null,this.oneof=l||null,this.syntax=h||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof d.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},_=E.prototype=Object.create(s.prototype);_.build=function(){this.element=new l(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new l(this.keyType,void 0,!0,this.syntax)),"proto3"!==this.syntax||this.repeated||this.map?"undefined"!=typeof this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=l.defaultFieldValue(this.type)},_.verifyValue=function(t,n){function r(e,t){throw Error("Illegal value for "+i.toString(!0)+" of type "+i.type.name+": "+e+" ("+t+")")}n=n||!1;var i=this;if(null===t)return this.required&&r(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&r(typeof t,"proto3 field without field presence cannot be null"),null;var o;if(this.repeated&&!n){Array.isArray(t)||(t=[t]);var s=[];for(o=0;o<t.length;o++)s.push(this.element.verifyValue(t[o]));return s}return this.map&&!n?t instanceof e.Map?t:(t instanceof Object||r(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&r(typeof t,"no array expected"),this.element.verifyValue(t))},_.hasWirePresence=function(t,n){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&n[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},_.encode=function(n,r,i){if(null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===n||this.repeated&&0==n.length)return r;try{if(this.repeated){var o;if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){r.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r.ensureCapacity(r.offset+=1);var s=r.offset;for(o=0;o<n.length;o++)this.element.encodeValue(this.id,n[o],r);var a=r.offset-s,u=t.calculateVarint32(a);if(u>1){var f=r.slice(s,r.offset);s+=u-1,r.offset=s,r.append(f)}r.writeVarint32(a,s-u)}else for(o=0;o<n.length;o++)r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,n[o],r)}else this.map?n.forEach(function(n,i,o){var s=t.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,i)+t.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,n);r.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r.writeVarint32(s),r.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,i,r),r.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,n,r)},this):this.hasWirePresence(n,i)&&(r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,n,r))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+n+" ("+e+")")}return r},_.calculate=function(n,r){if(n=this.verifyValue(n),null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===n||this.repeated&&0==n.length)return 0;var i=0;try{if(this.repeated){var o,s;if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(i+=t.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),s=0,o=0;o<n.length;o++)s+=this.element.calculateLength(this.id,n[o]);i+=t.calculateVarint32(s),i+=s}else for(o=0;o<n.length;o++)i+=t.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,n[o])}else this.map?n.forEach(function(n,r,o){var s=t.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,r)+t.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,n);i+=t.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i+=t.calculateVarint32(s),i+=s},this):this.hasWirePresence(n,r)&&(i+=t.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,n))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+n+" ("+e+")")}return i},_.decode=function(t,n,r){var i,o,s=!this.map&&t==this.type.wireType||!r&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM;if(!s)throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!r){o=n.readVarint32(),o=n.offset+o;for(var a=[];n.offset<o;)a.push(this.decode(this.type.wireType,n,!0));return a}if(this.map){var u=l.defaultFieldValue(this.keyType);if(i=l.defaultFieldValue(this.type),o=n.readVarint32(),n.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+n.remaining());var f=n.clone();for(f.limit=f.offset+o,n.offset+=o;f.remaining()>0;){var h=f.readVarint32();t=7&h;var d=h>>>3;if(1===d)u=this.keyElement.decode(f,t,d);else{if(2!==d)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(f,t,d)}}return[u,i]}return this.element.decode(n,t,this.id)},o.Message.Field=E;var p=function(e,t,n,r,i,o,s){E.call(this,e,t,n,null,r,i,o,s),this.extension};p.prototype=Object.create(E.prototype),o.Message.ExtensionField=p;var g=function(e,t,n){s.call(this,e,t,n),this.fields=[]};o.Message.OneOf=g;var R=function(e,t,n,r,i){u.call(this,e,t,n,r,i),this.className="Enum",this.object=null};R.getName=function(e,t){for(var n,r=Object.keys(e),i=0;i<r.length;++i)if(e[n=r[i]]===t)return n;return null};var y=R.prototype=Object.create(u.prototype);y.build=function(t){if(this.object&&!t)return this.object;for(var n=new e.Builder.Enum,r=this.getChildren(R.Value),i=0,o=r.length;i<o;++i)n[r[i].name]=r[i].id;return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=n},o.Enum=R;var T=function(e,t,n,r){s.call(this,e,t,n),this.className="Enum.Value",this.id=r};T.prototype=Object.create(s.prototype),o.Enum.Value=T;var C=function(e,t,n,r){s.call(this,e,t,n),this.field=r};C.prototype=Object.create(s.prototype),o.Extension=C;var S=function(e,t,n,r){u.call(this,e,t,n,r),this.className="Service",this.clazz=null},b=S.prototype=Object.create(u.prototype);b.build=function(n){return this.clazz&&!n?this.clazz:this.clazz=function(e,n){for(var r=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,n){setTimeout(n.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},i=r.prototype=Object.create(e.Builder.Service.prototype),o=n.getChildren(e.Reflect.Service.RPCMethod),s=0;s<o.length;s++)!function(e){i[e.name]=function(r,i){try{try{r=e.resolvedRequestType.clazz.decode(t.wrap(r))}catch(e){if(!(e instanceof TypeError))throw e}if(null===r||"object"!=typeof r)throw Error("Illegal arguments");r instanceof e.resolvedRequestType.clazz||(r=new e.resolvedRequestType.clazz(r)),this.rpcImpl(e.fqn(),r,function(t,r){if(t)return void i(t);null===r&&(r="");try{r=e.resolvedResponseType.clazz.decode(r)}catch(e){}return r&&r instanceof e.resolvedResponseType.clazz?void i(null,r):void i(Error("Illegal response type received in service method "+n.name+"#"+e.name))})}catch(e){setTimeout(i.bind(this,e),0)}},r[e.name]=function(t,n,i){new r(t)[e.name](n,i)},Object.defineProperty&&(Object.defineProperty(r[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(i[e.name],"$options",{value:r[e.name].$options}))}(o[s]);return Object.defineProperty&&(Object.defineProperty(r,"$options",{value:n.buildOpt()}),Object.defineProperty(i,"$options",{value:r.$options}),Object.defineProperty(r,"$type",{value:n}),Object.defineProperty(i,"$type",{value:n})),r}(e,this)},o.Service=S;var I=function(e,t,n,r){s.call(this,e,t,n),this.className="Service.Method",this.options=r||{}},v=I.prototype=Object.create(s.prototype);v.buildOpt=f.buildOpt,o.Service.Method=I;var m=function(e,t,n,r,i,o,s,a){I.call(this,e,t,n,a),this.className="Service.RPCMethod",this.requestName=r,this.responseName=i,this.requestStream=o,this.responseStream=s,this.resolvedRequestType=null,this.resolvedResponseType=null};return m.prototype=Object.create(I.prototype),o.Service.RPCMethod=m,o}(i),i.Builder=function(e,t,r){function i(e){e.messages&&e.messages.forEach(function(t){t.syntax=e.syntax,i(t)}),e.enums&&e.enums.forEach(function(t){t.syntax=e.syntax})}var o=function(e){this.ns=new r.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},s=o.prototype;return o.isMessage=function(e){return"string"==typeof e.name&&("undefined"==typeof e.values&&"undefined"==typeof e.rpc)},o.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&"undefined"!=typeof e.id},o.isEnum=function(e){return"string"==typeof e.name&&!("undefined"==typeof e.values||!Array.isArray(e.values)||0===e.values.length)},o.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},o.isExtend=function(e){return"string"==typeof e.ref},s.reset=function(){return this.ptr=this.ns,this},s.define=function(e){if("string"!=typeof e||!t.TYPEREF.test(e))throw Error("illegal namespace: "+e);return e.split(".").forEach(function(e){var t=this.ptr.getChild(e);null===t&&this.ptr.addChild(t=new r.Namespace(this,this.ptr,e)),this.ptr=t},this),this},s.create=function(t){if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(var n=[t];n.length>0;){if(t=n.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){var i=t.shift();if(o.isMessage(i)){var s=new r.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax),a={};i.oneofs&&Object.keys(i.oneofs).forEach(function(e){s.addChild(a[e]=new r.Message.OneOf(this,s,e))},this),i.fields&&i.fields.forEach(function(e){if(null!==s.getChild(0|e.id))throw Error("duplicate or invalid field id in "+s.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+s.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=a[e.oneof]))throw Error("illegal oneof in "+s.name+"#"+e.name+": "+e.oneof);e=new r.Message.Field(this,s,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),t&&t.fields.push(e),s.addChild(e)},this);var u=[];if(i.enums&&i.enums.forEach(function(e){u.push(e)}),i.messages&&i.messages.forEach(function(e){u.push(e)}),i.services&&i.services.forEach(function(e){u.push(e)}),i.extensions&&("number"==typeof i.extensions[0]?s.extensions=[i.extensions]:s.extensions=i.extensions),this.ptr.addChild(s),u.length>0){n.push(t),t=u,u=null,this.ptr=s,s=null;continue}u=null}else if(o.isEnum(i))s=new r.Enum(this,this.ptr,i.name,i.options,i.syntax),i.values.forEach(function(e){s.addChild(new r.Enum.Value(this,s,e.name,e.id))},this),this.ptr.addChild(s);else if(o.isService(i))s=new r.Service(this,this.ptr,i.name,i.options),Object.keys(i.rpc).forEach(function(e){var t=i.rpc[e];s.addChild(new r.Service.RPCMethod(this,s,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))},this),this.ptr.addChild(s);else{if(!o.isExtend(i))throw Error("not a valid definition: "+JSON.stringify(i));if(s=this.ptr.resolve(i.ref,!0))i.fields.forEach(function(t){if(null!==s.getChild(0|t.id))throw Error("duplicate extended field id in "+s.name+": "+t.id);if(s.extensions){var n=!1;if(s.extensions.forEach(function(e){t.id>=e[0]&&t.id<=e[1]&&(n=!0)}),!n)throw Error("illegal extended field id in "+s.name+": "+t.id+" (not within valid ranges)")}var i=t.name;this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i));var o=new r.Message.ExtensionField(this,s,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),a=new r.Extension(this,this.ptr,t.name,o);o.extension=a,this.ptr.addChild(a),s.addChild(o)},this);else if(!/\.?google\.protobuf\./.test(i.ref))throw Error("extended message "+i.ref+" is not defined")}i=null,s=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},s.import=function(t,r){var o="/";if("string"==typeof r){if(e.Util.IS_NODE&&(r=n(18).resolve(r)),this.files[r]===!0)return this.reset();this.files[r]=!0}else if("object"==typeof r){var s=r.root;e.Util.IS_NODE&&(s=n(18).resolve(s)),(s.indexOf("\\")>=0||r.file.indexOf("\\")>=0)&&(o="\\");var a=s+o+r.file;if(this.files[a]===!0)return this.reset();this.files[a]=!0}if(t.imports&&t.imports.length>0){var u,f=!1;"object"==typeof r?(this.importRoot=r.root,f=!0,u=this.importRoot,r=r.file,(u.indexOf("\\")>=0||r.indexOf("\\")>=0)&&(o="\\")):"string"==typeof r?this.importRoot?u=this.importRoot:r.indexOf("/")>=0?(u=r.replace(/\/[^\/]*$/,""),""===u&&(u="/")):r.indexOf("\\")>=0?(u=r.replace(/\\[^\\]*$/,""),o="\\"):u=".":u=null;for(var l=0;l<t.imports.length;l++)if("string"==typeof t.imports[l]){if(!u)throw Error("cannot determine import root");var h=t.imports[l];if("google/protobuf/descriptor.proto"===h)continue;if(h=u+o+h,this.files[h]===!0)continue;/\.proto$/i.test(h)&&!e.DotProto&&(h=h.replace(/\.proto$/,".json"));var d=e.Util.fetch(h);if(null===d)throw Error("failed to import '"+h+"' in '"+r+"': file not found");/\.json$/i.test(h)?this.import(JSON.parse(d+""),h):this.import(e.DotProto.Parser.parse(d),h)}else r?/\.(\w+)$/.test(r)?this.import(t.imports[l],r.replace(/^(.+)\.(\w+)$/,function(e,t,n){return t+"_import"+l+"."+n})):this.import(t.imports[l],r+"_import"+l):this.import(t.imports[l]);f&&(this.importRoot=null)}t.package&&this.define(t.package),t.syntax&&i(t);var c=this.ptr;return t.options&&Object.keys(t.options).forEach(function(e){c.options[e]=t.options[e]}),t.messages&&(this.create(t.messages),this.ptr=c),t.enums&&(this.create(t.enums),this.ptr=c),t.services&&(this.create(t.services),this.ptr=c),t.extends&&this.create(t.extends),this.reset()},s.resolveAll=function(){var n;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof r.Namespace)this.ptr.children.forEach(function(e){this.ptr=e,this.resolveAll()},this);else if(this.ptr instanceof r.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(n=(this.ptr instanceof r.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0),!n)throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=n,n instanceof r.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==n.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(n instanceof r.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=n.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(n=this.ptr.parent.resolve(this.ptr.requestName,!0),!(n&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=n,n=this.ptr.parent.resolve(this.ptr.responseName,!0),!(n&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=n}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},s.build=function(e){if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(var t="string"==typeof e?e.split("."):e,n=this.result,r=0;r<t.length;r++){if(!n[t[r]]){n=null;break}n=n[t[r]]}return n},s.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},s.toString=function(){return"Builder"},o.Message=function(){},o.Enum=function(){},o.Service=function(){},o}(i,i.Lang,i.Reflect),i.Map=function(e,t){function n(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}var r=function(e,n){if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new t.Element(e.keyType,null,!0,e.syntax),this.valueElem=new t.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),n)for(var r=Object.keys(n),i=0;i<r.length;i++){var o=this.keyElem.valueFromString(r[i]),s=this.valueElem.verifyValue(n[r[i]]);this.map[this.keyElem.valueToString(o)]={key:o,value:s}}},i=r.prototype;return i.clear=function(){this.map={}},i.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),n=t in this.map;return delete this.map[t],n},i.entries=function(){for(var e,t=[],r=Object.keys(this.map),i=0;i<r.length;i++)t.push([(e=this.map[r[i]]).key,e.value]);return n(t)},i.keys=function(){for(var e=[],t=Object.keys(this.map),r=0;r<t.length;r++)e.push(this.map[t[r]].key);return n(e)},i.values=function(){for(var e=[],t=Object.keys(this.map),r=0;r<t.length;r++)e.push(this.map[t[r]].value);return n(e)},i.forEach=function(e,t){for(var n,r=Object.keys(this.map),i=0;i<r.length;i++)e.call(t,(n=this.map[r[i]]).value,n.key,this)},i.set=function(e,t){var n=this.keyElem.verifyValue(e),r=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(n)]={key:n,value:r},this},i.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));if(t in this.map)return this.map[t].value},i.has=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));return t in this.map},r}(i,i.Reflect),i.loadProto=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=void 0),i.loadJson(i.DotProto.Parser.parse(e),t,n)},i.protoFromString=i.loadProto,i.loadProtoFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return i.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,function(r){if(null===r)return void t(Error("Failed to fetch file"));try{t(null,i.loadProto(r,n,e))}catch(e){t(e)}});var r=i.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:i.loadProto(r,n,e)},i.protoFromFile=i.loadProtoFile,i.newBuilder=function(e){return e=e||{},"undefined"==typeof e.convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=i.convertFieldsToCamelCase),"undefined"==typeof e.populateAccessors&&(e.populateAccessors=i.populateAccessors),new i.Builder(e)},i.loadJson=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=null),t&&"object"==typeof t||(t=i.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,n),t.resolveAll(),t},i.loadJsonFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return i.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,function(r){if(null===r)return void t(Error("Failed to fetch file"));try{t(null,i.loadJson(JSON.parse(r),n,e))}catch(e){t(e)}});var r=i.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:i.loadJson(JSON.parse(r),n,e)},i})}).call(t,n(27),n(7)(e))},function(e,t){String.fromCodePoint||!function(){var e=function(){try{var e={},t=Object.defineProperty,n=t(e,e,e)&&t}catch(e){}return n}(),t=String.fromCharCode,n=Math.floor,r=function(e){var r,i,o=16384,s=[],a=-1,u=arguments.length;if(!u)return"";for(var f="";++a<u;){var l=Number(arguments[a]);if(!isFinite(l)||l<0||l>1114111||n(l)!=l)throw RangeError("Invalid code point: "+l);l<=65535?s.push(l):(l-=65536,r=(l>>10)+55296,i=l%1024+56320,s.push(r,i)),(a+1==u||s.length>o)&&(f+=t.apply(null,s),s.length=0)}return f};e?e(String,"fromCodePoint",{value:r,configurable:!0,writable:!0}):String.fromCodePoint=r}()},function(e,t){String.prototype.codePointAt||!function(){"use strict";var e=function(){try{var e={},t=Object.defineProperty,n=t(e,e,e)&&t}catch(e){}return n}(),t=function(e){if(null==this)throw TypeError();var t=String(this),n=t.length,r=e?Number(e):0;if(r!=r&&(r=0),!(r<0||r>=n)){var i,o=t.charCodeAt(r);return o>=55296&&o<=56319&&n>r+1&&(i=t.charCodeAt(r+1),i>=56320&&i<=57343)?1024*(o-55296)+i-56320+65536:o}};e?e(String.prototype,"codePointAt",{value:t,configurable:!0,writable:!0}):String.prototype.codePointAt=t}()},18]))});
\ No newline at end of file
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MCUClientEngine=t():e.MCUClientEngine=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))switch(typeof e[t]){case"function":break;case"object":e[t]=function(t){var n=t.slice(1),r=e[t[0]];return function(e,t,i){r.apply(this,[e,t,i].concat(n))}}(e[t]);break;default:e[t]=e[e[t]]}return e}([function(e,t,n){e.exports=n(21)},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){n(this,e),this.info=t||"",this.id=this.initId()}return r(e,[{key:"initId",value:function(){var e=this.info.constructor.name.toLowerCase();return"string"===e?this.info:"object"===e?this.info.mid||"":""}},{key:"log",value:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];this._log(e.LOG,n)}},{key:"warn",value:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];this._log(e.WARN,n)}},{key:"error",value:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];this._log(e.ERROR,n)}},{key:"_log",value:function(t,n){n=JSON.stringify(n);var r=this.id+" -> "+n;if(t>=e.logLevel)switch(t){case e.LOG:console.log(r);break;case e.WARN:console.warn(r);break;case e.ERROR:console.error(r)}}}]),e}();i.LOG=0,i.WARN=1,i.ERROR=2,i.NO=1/0,i.logLevel=i.LOG;var o={getLoger:function(e){return new i(e)},setLogLevel:function(e){i.logLevel=e},LOG:i.LOG,WARN:i.WARN,ERROR:i.ERROR,NO:i.NO};t.default=o;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"Loger","D:/work/McuClient/src/Loger.js"),__REACT_HOT_LOADER__.register(o,"default","D:/work/McuClient/src/Loger.js"))})()},function(e,t){"use strict";function n(){}Object.defineProperty(t,"__esModule",{value:!0}),n.CONFERENCE_SHOW_USERNAME="show.name.input",n.CONFERENCE_SHOW_ILLEGAL="illegal.user",n.CONFERENCE_SHOW_USERNAME_PASSWORD="show.name.pasword.input",n.CONFERENCE_SHOW_WRONG_PASSWORD="password.wrong",n.CONFERENCE_JOIN_FAILED="join.conference.failed",n.CONFERENCE_JOIN_SUCCESS="join.conference.success",n.CONFERENCE_JOIN_FULL="full.capacity",n.CONFERENCE_EXIT="conference.exit",n.CONFERENCE_JOIN_CONFILICT="have.been.logged.elsewhere",n.CONFERENCE_SHOW_DETAIL="class_detail.message",n.CONFERENCE_SHOW_ROSTER_NUM="roster_num.message",n.NET_ERROR="net_error",n.PRO_ERROR="pro_error",n.VIDEO_SHOW="video.message",n.DOC_SHOW="document.message",n.DOC_SWITCH="document.switch",n.DOC_UPDATE="document.update",n.DOC_DEL="document.delete",n.DOC_ANNO="document.anno",n.CHAT_RECEIVE="chat.message",n.ANNO_UPDATE="anno_update",n.AUDIO_SHOW="audio.message";var r=n;t.default=r;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(n,"MessageTypes","D:/work/McuClient/src/MessageTypes.js"),__REACT_HOT_LOADER__.register(r,"default","D:/work/McuClient/src/MessageTypes.js"))})()},function(e,t){"use strict";function n(e){for(var t in n)if(n[t]===e)return t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.NR_GUEST=0,n.NR_NORMAL=1,n.NR_ADMIN=2,n.NR_MASTER=4,n.NR_SLAVE=8,n.NR_ASSISTANT=16,n.NR_INVISIBLE=32,n.INVALIDATE_CHANNEL_ID=-1,n.INVALIDATE_NODE_ID=-1,n.DOCUMENT_LOAD=0,n.DOCUMENT_DEL=1,n.CGS_RELEASED=0,n.CGS_PENDING=1,n.CGS_OPENNED=2,n.CGS_GRABBING=3,n.CONFERENCE_SESSION_ID=11,n.CHAT_SESSION_ID=12,n.GIFT_SESSION_ID=13,n.AUDIO_SESSION_ID=14,n.VIDEO_SESSION_ID=15,n.WEBSHARING_SESSION_ID=16,n.DOCSHARING_SESSION_ID=17,n.WHITEBOARD_SESSION_ID=18,n.MEDIA_SESSION_ID=19,n.SCREENSHARING_SESSION_ID=20,n.POLL_SESSION_ID=21,n.BROADCAST_CHANNEL_ID=0,n.CONFERENCE_CHANNEL_ID=n.CONFERENCE_SESSION_ID,n.CHAT_CHANNEL_ID=n.CHAT_SESSION_ID,n.GIFT_CHANNEL_ID=n.GIFT_SESSION_ID,n.WEBSHARING_CHANNEL_ID=n.WEBSHARING_SESSION_ID,n.DOCSHARING_CHANNEL_ID=n.DOCSHARING_SESSION_ID,n.WHITEBOARD_CHANNEL_ID=n.WHITEBOARD_SESSION_ID,n.MEDIA_CHANNEL_ID=n.MEDIA_SESSION_ID,n.SCREENSHARING_CHANNEL_ID=n.SCREENSHARING_SESSION_ID,n.CONFERENCE_SESSION_NAME="conference app",n.CHAT_SESSION_NAME="chat app",n.GIFT_SESSION_NAME="gift app",n.AUDIO_SESSION_NAME="audio app",n.VIDEO_SESSION_NAME="video app",n.WEBSHARING_SESSION_NAME="web sharing app",n.DOCSHARING_SESSION_NAME="doc sharing app",n.WHITEBOARD_SESSION_NAME="whiteboard app",n.MEDIA_SESSION_NAME="media sharing app",n.SCREENSHARING_SESSION_NAME="screen sharing app",n.CONFERENCE_SESSION_TAG="con-tag",n.CHAT_SESSION_TAG="cha-tag",n.GIFT_SESSION_TAG="gif-tag",n.AUDIO_SESSION_TAG="aud-tag",n.VIDEO_SESSION_TAG="vid-tag",n.WEBSHARING_SESSION_TAG="web-tag",n.DOCSHARING_SESSION_TAG="doc-tag",n.WHITEBOARD_SESSION_TAG="wbd-tag",n.MEDIA_SESSION_TAG="med-tag",n.SCREENSHARING_SESSION_TAG="scr-tag",n.CONFERENCE_OBJ_ROSTER_ID=(n.CONFERENCE_SESSION_ID<<16)+1,n.CONFERENCE_OBJ_ROSTER_NAME="node list",n.CONFERENCE_OBJ_ROSTER_TAG="node list tag",n.CONFERENCE_OBJ_QUEUE_ID=(n.CONFERENCE_SESSION_ID<<16)+2,n.CONFERENCE_OBJ_QUEUE_NAME="mic list",n.CONFERENCE_OBJ_QUEUE_TAG="mic list tag",n.CONFERENCE_OBJ_TABLE_ID=(n.CONFERENCE_SESSION_ID<<16)+3,n.CONFERENCE_OBJ_TABLE_NAME="tabbar list",n.CONFERENCE_OBJ_TABLE_TAG="tabbar list tag",n.CONFERENCE_OBJ_COUNTER_ID=(n.CONFERENCE_SESSION_ID<<16)+4,n.CONFERENCE_OBJ_COUNTER_NAME="id list",n.CONFERENCE_OBJ_COUNTER_TAG="id list tag",n.WEBSHARING_OBJ_TABLE_ID=(n.WEBSHARING_SESSION_ID<<16)+1,n.WEBSHARING_OBJ_TABLE_NAME="web list",n.WEBSHARING_OBJ_TABLE_TAG="web list tag",n.DOCSHARING_OBJ_TABLE_ID=(n.DOCSHARING_SESSION_ID<<16)+1,n.DOCSHARING_OBJ_TABLE_NAME="doc list",n.DOCSHARING_OBJ_TABLE_TAG="doc list tag",n.DOCSHARING_OBJ_TABLE_ID_H5=(n.DOCSHARING_SESSION_ID<<16)+2,n.DOCSHARING_OBJ_TABLE_NAME_H5="doc list h5",n.DOCSHARING_OBJ_TABLE_TAG_H5="doc list tag h5",n.WHITEBOARD_OBJ_TABLE_ID=(n.WHITEBOARD_SESSION_ID<<16)+1,n.WHITEBOARD_OBJ_TABLE_NAME="wbd list",n.WHITEBOARD_OBJ_TABLE_TAG="wbd list tag",n.MEDIA_OBJ_TABLE_ID=(n.MEDIA_SESSION_ID<<16)+1,n.MEDIA_OBJ_TABLE_NAME="med list",n.MEDIA_OBJ_TABLE_TAG="med list tag",n.CHAT_OBJ_TABLE_ID=(n.CHAT_SESSION_ID<<16)+1,n.CHAT_OBJ_TABLE_NAME="chat list",n.CHAT_OBJ_TABLE_TAG="chat list tag",n.AUDIO_OBJ_TABLE_ID=(n.AUDIO_SESSION_ID<<16)+1,n.AUDIO_OBJ_TABLE_NAME="audio channel list",n.AUDIO_OBJ_TABLE_TAG="audio channel list tag",n.VIDEO_OBJ_TABLE_ID=(n.VIDEO_SESSION_ID<<16)+1,n.VIDEO_OBJ_TABLE_NAME="video channel list",n.VIDEO_OBJ_TABLE_TAG="video channel list tag",n.SCREENSHARING_OBJ_TABLE_ID=(n.SCREENSHARING_SESSION_ID<<16)+1,n.SCREEN_OBJ_TABLE_NAME="scr list",n.SCREEN_OBJ_TABLE_TAG="scr list tag",n.POLL_OBJ_TABLE_ID=(n.POLL_SESSION_ID<<16)+1,n.VOTE_OBJ_TABLE_ID=(n.POLL_SESSION_ID<<16)+2,n.RECORD_OBJ_TABLE_ID=(n.POLL_SESSION_ID<<16)+3,n.SHAMLIVE_OBJ_TABLE_ID=(n.POLL_SESSION_ID<<16)+4,n.POLL_OBJ_TABLE_NAME="poll list",n.POLL_OBJ_TABLE_TAG="poll list tag",n.REG_TABLE_INSERT_TAIL=16777215,n.REG_TABLE_DELETE_ALL=16777215,n.CJS_RELEASED=0,n.CJS_JOINNING=1,n.CJS_JOINNED=2,n.WBA_CLOSE=1,n.WBA_CHANGE=2,n.WBA_OPEN=3,n.WBA_DOC_ANNOTATION=4,n.WBA_LASER_PEN=5;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&__REACT_HOT_LOADER__.register(n,"ApeConsts","D:/work/McuClient/src/apes/ApeConsts.js")})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n,r,i,o,s,a,u,f,l){var h=new _.RCSendDataPdu;return h.set("type",e),h.set("subType",t),h.set("initiator",n),h.set("confId",r),h.set("sessionId",i),h.set("channelId",o),h.set("upward",s),h.set("reliability",a),h.set("priority",u),h.set("peer",f),h.set("seg",l),h}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=n(31),a=r(s),u=n(28),f=r(u),l=n(14),h=r(l),d=n(8),c=r(d),E=a.default.newBuilder({convertFieldsToCamelCase:!0});a.default.loadProto(f.default,E);var _=E.build();_.decode_pdu=function(e){return _.RCSendDataPdu.decode(e)},_.create_connect_provider_request_pdu=function(e,t,n,r,o,s,a,u,f){return i(h.default.RCPDU_CONNECT_PROVIDER_REQUEST,e,t,n,r,o,!0,s,a,u,f)},_.create_uniform_pdu=function(e,t,n,r,o,s,a,u,f){return i(h.default.RCPDU_UNIFORM_SEND_DATA_REQUEST,e,t,n,r,o,!0,s,a,u,f)},_.create_normal_pdu=function(e,t,n,r,o,s,a,u,f,l){return i(h.default.RCPDU_SEND_DATA_REQUEST,e,t,n,r,o,s,a,u,f,l)},_.id2type=function(e){for(var t in h.default)if(h.default[t]===e)return t},_=o({},_,h.default,c.default);var p=_;t.default=p;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(E,"builder","D:/work/McuClient/src/pdu/index.js"),__REACT_HOT_LOADER__.register(_,"pdu","D:/work/McuClient/src/pdu/index.js"),__REACT_HOT_LOADER__.register(i,"create_pdu","D:/work/McuClient/src/pdu/index.js"),__REACT_HOT_LOADER__.register(p,"default","D:/work/McuClient/src/pdu/index.js"))})()},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){n(this,e),this.MAPS={}}return r(e,[{key:"on",value:function(e,t){if(e&&t){var n=this.MAPS[e];if(!n)return this.MAPS[e]=[t];n.push(t)}}},{key:"off",value:function(e,t){if(e){var n=this.MAPS[e];if(n){if(t)return n.splice(n.indexOf(t),1);n.length=0}}}},{key:"_emit",value:function(e,t){if(e){var n=this.MAPS["*"];console.log("asteriskStub"),n&&n.length&&n.forEach(function(n){n(e,t)});var r=this.MAPS[e];r&&r.length&&r.forEach(function(e){e(t)})}}}]),e}(),o=i;t.default=o;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"Emiter","D:/work/McuClient/src/Emiter.js"),__REACT_HOT_LOADER__.register(o,"default","D:/work/McuClient/src/Emiter.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(4),f=r(u),l=n(5),h=r(l),d=n(13),c=r(d),E=n(1),_=r(E),p=n(2),g=r(p),R=n(3),y=r(R),T=n(12),C=r(T),S=n(8),b=r(S),v=_.default.getLoger("Ape"),I=function(e){function t(e,n,r){i(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return s._session_id=e,s._channel_id=e,s._session_name=n,s._session_tag=r,s._session_channels={},s._adapter_pdu=new f.default.RCAdapterPdu,s._confInfo=null,s._rCArrayBufferUtil=C.default,s._apeDelayed=!1,s._apeDelayedMsgs=[],s._apeDelayedTimer=0,s.on(f.default.RCPDU_SESSION_JOIN_RESPONSE,s._joinSessionHandler.bind(s)),s.on(f.default.RCPDU_CHANNEL_JOIN_RESPONSE,s._joinChannelHandler.bind(s)),s.on(f.default.RCPDU_REG_ADAPTER,s._pduMessageHandler.bind(s)),s.mcu=c.default,s.mcu.on(g.default.CONFERENCE_JOIN_SUCCESS,s._mcuConferenceJoinSuccessHandler.bind(s)),s.mcu.registerApe(s),s}return s(t,e),a(t,[{key:"regResponsePduHandler",value:function(){}},{key:"_pduMessageHandler",value:function(e){var t=this;return this._apeDelayed?void setTimeout(function(){t._pduRegAdapterHandler(e)},this._confInfo.mcuDelay||12e3):void this._pduRegAdapterHandler(e)}},{key:"_pduRegAdapterHandler",value:function(e){var t=f.default.RCAdapterPdu.decode(e),n=t.item,r=n.length;v.log(this._session_name+"数据同步消息.同步条数",r);for(var i=0;i<r;++i){var o=n[i],s=o.type,a=o.itemData;if(f.default.RCPDU_REG_UPDATE_OBJ===s){var u=f.default.RCRegistryUpdateObjPdu.decode(a),l=u.subType,h=u.objId,d=u.userData;switch(v.log("REG OBJECT EVENT ->",f.default.id2type(l)),l){case f.default.RCPDU_REG_ROSTER_INSERT_PDU:for(var c=f.default.RCRegstryRosterInsertItemPdu.decode(d),E=c.items,_=E.length,p=0;p<_;++p){var g=E[p],R=g.item_id,y=f.default.RCNodeInfoRecordPdu.decode(g.item_data);this.rosterInsertHandler(R,y)}break;case f.default.RCPDU_REG_ROSTER_DELETE_PDU:var T=f.default.RCRegistryRosterDeleteItemPdu.decode(d);this.rosterDelHandler(T.nodeId);break;case f.default.RCPDU_REG_ROSTER_UPDATE_PDU:for(var C=f.default.RCRegistryRosterUpdateItemPdu.decode(d),S=C.items,b=S.length,I=0;I<b;++I){var O=S[I],m=O.nodeId,N=f.default.RCNodeInfoRecordPdu.decode(O.nodeData);this.rosterUpdateHandler(m,N)}break;case f.default.RCPDU_REG_TABLE_INSERT_PDU:for(var A=f.default.RCRegistryTableInsertItemPdu.decode(d),w=A.items,P=w.length,D=0;D<P;++D){var U=w[D];this.tableInsertHandler(U.owner,U.itemIdx,U.itemData)}break;case f.default.RCPDU_REG_TABLE_DELETE_PDU:var L=f.default.RCRegistryTableDeleteItemPdu.decode(d);this.tableDeleteHandler(h,L);break;case f.default.RCPDU_REG_TABLE_UPDATE_PDU:for(var k=f.default.RCRegistryTableUpdateItemPdu.decode(d),B=k.items,M=B.length,G=0;G<M;++G){var H=B[G];this.tableUpdateHandler(H.owner,H.itemIdx,H.itemData)}break;case f.default.RCPDU_REG_QUEUE_UPDATE_PDU:case f.default.RCPDU_REG_QUEUE_DELETE_PDU:case f.default.RCPDU_REG_QUEUE_INSERT_PDU:v.warn("REG QUEUE ARE IGNORED")}}else if(f.default.RCPDU_REG_RESPONSE_OBJ==s){var F=f.default.RCRegistryResponseObjPdu.decode(a);this.regResponsePduHandler(F)}}}},{key:"rosterInsertHandler",value:function(e,t){v.warn(this._session_name+" rosterInsertHandler 应有子类具体覆盖处理.")}},{key:"rosterUpdateHandler",value:function(e,t){v.warn(this._session_name+" rosterUpdateHandler 应有子类具体覆盖处理.")}},{key:"rosterDelHandler",value:function(e){v.warn(this._session_name+" rosterDelHandler 应有子类具体覆盖处理.")}},{key:"tableInsertHandler",value:function(e,t){v.warn(this._session_name+" tableInsertHandler 应有子类具体覆盖处理.")}},{key:"tableUpdateHandler",value:function(e,t,n){v.warn(this._session_name+" tableUpdateHandler 应有子类具体覆盖处理.")}},{key:"tableDeleteHandler",value:function(e,t){v.warn(this._session_name+" tableDelHandler 应有子类具体覆盖处理.")}},{key:"_joinSessionHandler",value:function(e){v.log(this._session_name," -> 加入Session")}},{key:"_joinChannelHandler",value:function(e){var t=f.default.RCChannelJoinResponsePdu.decode(e);t.result===f.default.RET_SUCCESS?(v.log(this._session_name," -> 加入Channel成功. ChannelId",t.requestedChannelId),this._session_channels[t.requestedChannelId]=y.default.CJS_JOINNED):v.log(this._session_name," -> 加入Channel失败.",t)}},{key:"_mcuConferenceJoinSuccessHandler",value:function(e){v.log("创建Ape->","SessionId",this._session_id,"SessionName",this._session_name,"SessionTag",this._session_tag),this._confInfo=e;var t=new f.default.RCSessionJoinRequestPdu;t.id=this._session_id,t.name=this._session_name,t.tag=this._session_tag,t.sessionData=this._adapter_pdu.toArrayBuffer(),this.sendUniform(t,!0);var n=new f.default.RCChannelJoinRequestPdu;n.initiator=this.mcu.confInfo.nodeId,n.channelId=this._session_id,this.send(n)}},{key:"registerKey",value:function(e,t,n,r){var i=new f.default.RCAdapterItemPdu;i.type=f.default.RCPDU_REG_REGISTER_KEY;var o=new f.default.RCRegistryRegisterKeyPdu;o.id=e,o.name=t,o.tag=n,r.length&&(o.userData=r),i.itemData=o.toArrayBuffer(),this._adapter_pdu.item.push(i)}},{key:"registerObj",value:function(e,t,n,r,i,o){var s=new f.default.RCAdapterItemPdu;s.type=f.default.RCPDU_REG_REGISTER_OBJ;var a=new f.default.RCRegistryRegisterObjPdu;a.type=e,a.objId=t,a.name=n,a.tag=r,i&&(a.owner=i),o.length&&(a.userData=o),s.itemData=a.toArrayBuffer(),this._adapter_pdu.item.push(s)}},{key:"send",value:function(e){v.log("Ape发送数据NORMAL PDU",e);var t=f.default.create_normal_pdu(e.type,this._confInfo.nodeId,this._confInfo.confId,this._session_id,this._channel_id,!0,!0,b.default.DP_TOP,this._confInfo.topNodeID,b.default.SEG_ONCE);t.data=e.toArrayBuffer(),this.mcu.send(t)}},{key:"sendUniform",value:function(e,t){v.log("Ape发送数据UNIFORM PDU",e);var n=f.default.create_uniform_pdu(e.type,this._confInfo.nodeId,this._confInfo.confId,this._session_id,t?y.default.BROADCAST_CHANNEL_ID:this._channel_id,!0,b.default.DP_TOP,t?this._confInfo.topNodeID:e.peer||0,b.default.SEG_ONCE);n.data=e.toArrayBuffer(),this.mcu.send(n)}}]),t}(h.default),O=I;t.default=O;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(v,"loger","D:/work/McuClient/src/apes/Ape.js"),__REACT_HOT_LOADER__.register(I,"Ape","D:/work/McuClient/src/apes/Ape.js"),__REACT_HOT_LOADER__.register(O,"default","D:/work/McuClient/src/apes/Ape.js"))})()},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){"use strict";function n(){}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.NT_TERMINAL=0,n.NT_MULTIPORT_TERMINAL=1,n.NT_MCU=2,n.DP_TOP=0,n.DP_HIGH=1,n.DP_MEDIUM=2,n.DP_LOW=3,n.SEG_BEGIN=0,n.SEG_END=1,n.SEG_ONCE=2,n.RET_SUCCESS=0,n.RET_USER_REJECTED=1,n.RET_INVALID_CONFERENCE=2,n.RET_INVALID_PASSWORD=3,n.RET_INVALID_CONVENER_PASSWORD=4,n.RET_CHALLENGE_RESPONSE_REQUIRED=5,n.RET_INVALID_CHALLENGE_RESPONSE=6,n.RET_NO_CONNECTION=7,n.RET_FULL_CAPACITY=8;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&__REACT_HOT_LOADER__.register(n,"PduConsts","D:/work/McuClient/src/pdu/PduConsts.js")})()},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){n(this,e)}return r(e,null,[{key:"isEmptyObject",value:function(e){for(var t in e)return!1;return!0}}]),e}(),o=i;t.default=o;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"EngineUtils","D:/work/McuClient/src/EngineUtils.js"),__REACT_HOT_LOADER__.register(o,"default","D:/work/McuClient/src/EngineUtils.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(6),f=r(u),l=n(3),h=r(l),d=n(2),c=r(d),E=n(4),_=r(E),p=n(18),g=n(17),R=r(g),y=n(1),T=r(y),C=T.default.getLoger("ConferApe"),S=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.default.CONFERENCE_SESSION_ID,h.default.CONFERENCE_SESSION_NAME,h.default.CONFERENCE_SESSION_TAG));return e.hostNodeId=-1,e.hostUserId="",e.rosters={},e.activeDocId="",e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(_.default.RCPDU_REG_REGISTER_ROSTER,h.default.CONFERENCE_OBJ_ROSTER_ID,h.default.CONFERENCE_OBJ_ROSTER_NAME,h.default.CONFERENCE_OBJ_ROSTER_TAG,0,new ArrayBuffer),e.registerObj(_.default.RCPDU_REG_REGISTER_QUEUE,h.default.CONFERENCE_OBJ_QUEUE_ID,h.default.CONFERENCE_OBJ_QUEUE_NAME,h.default.CONFERENCE_OBJ_QUEUE_TAG,0,new ArrayBuffer),e.registerObj(_.default.RCPDU_REG_REGISTER_TABLE,h.default.CONFERENCE_OBJ_TABLE_ID,h.default.CONFERENCE_OBJ_TABLE_NAME,h.default.CONFERENCE_OBJ_TABLE_TAG,0,new ArrayBuffer),e.registerObj(_.default.RCPDU_REG_REGISTER_COUNTER,h.default.CONFERENCE_OBJ_COUNTER_ID,h.default.CONFERENCE_OBJ_COUNTER_NAME,h.default.CONFERENCE_OBJ_COUNTER_TAG,0,new ArrayBuffer),e.on(_.default.RCPDU_SESSION_JOIN_RESPONSE,e._joinSessionHandler.bind(e)),e}return s(t,e),a(t,[{key:"_joinSessionHandler",value:function(e){var t=this.mcu.mcuConfInfo.self,n=new _.default.RCNodeInfoUserDataPdu;n.qq="",n.skype="",n.mobile="",t.userData=n.toArrayBuffer(),t.deviceType=3;var r=new _.default.RCRegistryRosterItemPdu;r.nodeId=t.nodeId,r.nodeData=t.toArrayBuffer();var i=new _.default.RCRegistryRosterUpdateItemPdu;i.type=_.default.RCPDU_REG_ROSTER_UPDATE_PDU,i.items.push(r);var o=new _.default.RCRegistryUpdateObjPdu;o.objId=h.default.CONFERENCE_OBJ_ROSTER_ID,o.subType=i.type,o.userData=i.toArrayBuffer();var s=new _.default.RCAdapterItemPdu;s.type=_.default.RCPDU_REG_UPDATE_OBJ,s.itemData=o.toArrayBuffer();var a=new _.default.RCAdapterPdu;a.type=_.default.RCPDU_REG_ADAPTER,a.item.push(s),this.sendUniform(a,!0)}},{key:"tableUpdateHandler",value:function(e,t,n){try{var r=_.default.RCTabUpdateDataRequestPdu.decode(n),i=new p.Zlib.Inflate(r.action.compact().view).decompress(),o=R.default.getStringFromBytes(i),s=o.match(/<TabType>(.+)<\/TabType>/);s.length>1&&"show.docsharing"==s[1]&&"true"==o.match(/<visible>(.+)<\/visible>/)[1]&&(this.activeDocId=o.match(/<TabID>(.+)<\/TabID>/)[1],this._emit(c.default.DOC_SWITCH,this.activeDocId))}catch(e){C.warn("ConferApe table update got exception.")}}},{key:"rosterInsertHandler",value:function(e,t){this.rosterUpdateHandler(e,t)}},{key:"rosterUpdateHandler",value:function(e,t){t.role!==h.default.NR_MASTER&&t.role!==h.default.NR_SLAVE||(this.hostNodeId=t.nodeId,this.hostUserId=t.userId),t.role===h.default.NR_NORMAL&&this.hostNodeId===t.nodeId&&(this.hostNodeId=-1,this.hostUserId="");var n=this.rosters[e];this.rosters[e]=t,n||this.emitRosterChange()}},{key:"rosterDelHandler",value:function(e){delete this.rosters[e],this.emitRosterChange(),e==this._confInfo.nodeId&&this._emit(c.default.CONFERENCE_EXIT)}},{key:"emitRosterChange",value:function(){this._emit(c.default.CONFERENCE_SHOW_ROSTER_NUM,Object.keys(this.rosters).length)}}]),t}(f.default),b=S;t.default=b;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(C,"loger","D:/work/McuClient/src/apes/ConferApe.js"),__REACT_HOT_LOADER__.register(S,"ConferApe","D:/work/McuClient/src/apes/ConferApe.js"),__REACT_HOT_LOADER__.register(b,"default","D:/work/McuClient/src/apes/ConferApe.js"))})()},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){n(this,e)}return r(e,null,[{key:"ab2str",value:function(e){return String.fromCharCode.apply(null,new Uint16Array(e))}},{key:"str2ab",value:function(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint16Array(t),r=0,i=e.length;r<i;r++)n[r]=e.charCodeAt(r);return t}},{key:"strToUint8Array",value:function(e){var t=void 0,n=void 0,r=void 0,i=void 0;t="",r=e.length;var o=[];for(n=0;n<r;n++)i=e.charCodeAt(n),i>=1&&i<=127?o.push(i):i>2047?(o.push(224|i>>12&15),o.push(128|i>>6&63),o.push(128|i>>0&63)):(o.push(192|i>>6&31),o.push(128|i>>0&63));return new Uint8Array(o)}},{key:"uint8ArrayToStr",value:function(e,t){var n=void 0,r=void 0,i=void 0,o=void 0,s=void 0,a=void 0;for(n="",i=e.buffer.byteLength,r=e.offset+t;r<e.limit;)switch(o=e.view[r++],o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:n+=String.fromCharCode(e.view[r-1]);break;case 12:case 13:s=e.view[r++],n+=String.fromCharCode((31&o)<<6|63&s);break;case 14:s=e.view[r++],a=e.view[r++],n+=String.fromCharCode((15&o)<<12|(63&s)<<6|(63&a)<<0)}return n}}]),e}(),o=i;t.default=o;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"ArrayBufferUtil","D:/work/McuClient/src/libs/ArrayBufferUtil.js"),__REACT_HOT_LOADER__.register(o,"default","D:/work/McuClient/src/libs/ArrayBufferUtil.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(5),f=r(u),l=n(2),h=r(l),d=n(1),c=r(d),E=n(27),_=r(E),p=n(4),g=r(p),R=n(14),y=r(R),T=n(8),C=r(T),S=n(3),b=r(S),v=n(11),I=(r(v),n(12)),O=r(I),m=n(30),N=r(m),A=c.default.getLoger("MCU"),w=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._apes={},e._everSocket=_.default,e._everSocket.on(_.default.OPEN,e._everSocketOpenHandler.bind(e)),e._everSocket.on(_.default.MESSAGE,e._everSocketMsgReceivedHandler.bind(e)),e}return s(t,e),a(t,[{key:"registerApe",value:function(e){this._apes[e._session_id]=e}},{key:"_everSocketOpenHandler",value:function(){A.log("MCU-发送加入会议请求.");var e=this.confInfo;e.nodeId=parseInt(Date.now()/1e3);var t=new g.default.RCConferenceJoinRequestPdu;t.type=2,t.initiator=e.nodeId,t.nodeType=C.default.NT_TERMINAL;var n=new g.default.RCConferenceDescriptorPdu;n.id=e.confId,n.name=new ArrayBuffer,n.mode=0,n.capacity=1,t.confDesc=n;var r=g.default.create_connect_provider_request_pdu(t.type,e.nodeId,e.confId,0,b.default.BROADCAST_CHANNEL_ID,!0,C.default.DP_TOP,e.topNodeID,C.default.SEG_ONCE);r.set("site",e.siteId),r.set("userId",e.userId),r.set("userName",N.default.fromByteArray(O.default.strToUint8Array(e.userName))),r.set("userRole",e.userRole),r.set("deviceType",""),r.set("data",t.toArrayBuffer()),this._everSocket.send(r.toArrayBuffer())}},{key:"_everSocketMsgReceivedHandler",value:function(e){var t=g.default.decode_pdu(e),n=t.get("type"),r=t.get("data");switch(A.log("MCU-FirstLayer封装消息","type",g.default.id2type(t.type),t.type,"sessionId",(0,b.default)(t.sessionId),t.sessionId),n){case y.default.RCPDU_CONNECT_PROVIDER_RESPONSE:var i=g.default.RCConferenceJoinResponsePdu.decode(r),o=i.get("result");switch(o){case C.default.RET_SUCCESS:this._updateMCUConfInfoDesc(i.get("confDesc")),this._emit(h.default.CONFERENCE_JOIN_SUCCESS,this.confInfo);break;case C.default.RET_FULL_CAPACITY:this._emit(h.default.CONFERENCE_JOIN_FULL);break;default:A.warn("JoinConfPdu-未知类型-等待处理.",o)}break;case y.default.RCPDU_SEND_DATA_REQUEST:var s=this._apes[t.sessionId],a=(0,b.default)(t.sessionId);if(s){var u=g.default.id2type(t.subType);A.log("MCU-SecondLayer封装消息","sessionId",a,t.sessionId,"subtype",u,t.subType),s._emit(t.subType,t.data)}else A.warn(a+"尚未注册");break;default:A.warn("PDU-未知类型-等待处理.",n)}}},{key:"_updateMCUConfInfoDesc",value:function(e){var t=this.mcuConfInfo.info;t._conference_name=O.default.uint8ArrayToStr(e.name,0),t._capacity=e.capacity,t._mode=e.mode}},{key:"send",value:function(e){this.connected?(A.log("MCU-发送会议数据....",e),this._everSocket.send(e.toArrayBuffer())):A.log("MCU-发送会议数据失败,MCU底层通道不可用")}},{key:"leaveMCU",value:function(){this._everSocket.end()}},{key:"joinMCU",value:function(e){A.log("开始建立EverSocket通道.",e),e.confId=parseInt(e.confId),this.confInfo=e;var t=new g.default.RCNodeInfoRecordPdu;t.name=this.confInfo.userName,t.nodeId=this.confInfo.nodeId,t.userId=this.confInfo.userId,t.role=1,t.level=0;var n={};n._conference_id=this.confInfo.confId,n._top_node_id=this.confInfo.topNodeID,this.mcuConfInfo={},this.mcuConfInfo.self=t,this.mcuConfInfo.info=n,this.confInfo.mcuConfInfo=this.mcuConfInfo,this._everSocket.begin(this.confInfo.MCUServerIP,this.confInfo.MCUServerPort)}},{key:"connected",get:function(){return!(!this._everSocket||!this._everSocket.connected)}}]),t}(f.default),P=new w;t.default=P;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(A,"loger","D:/work/McuClient/src/mcu.js"),__REACT_HOT_LOADER__.register(w,"MCU","D:/work/McuClient/src/mcu.js"),__REACT_HOT_LOADER__.register(P,"default","D:/work/McuClient/src/mcu.js"))})()},function(e,t){"use strict";function n(e){}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.RCPDU_CONNECT_PROVIDER_REQUEST=0,n.RCPDU_CONNECT_PROVIDER_RESPONSE=1,n.RCPDU_CONFERENCE_JOIN_REQUEST=2,n.RCPDU_CONFERENCE_JOIN_RESPONSE=3,n.RCPDU_CONFERENCE_INVITE_REQUEST=10,n.RCPDU_CONFERENCE_INVITE_RESPONSE=11,n.RCPDU_CONFERENCE_LOCK_REQUEST=20,n.RCPDU_CONFERENCE_LOCK_RESPONSE=21,n.RCPDU_CONFERENCE_LOCK_INDICATION=22,n.RCPDU_CONFERENCE_UNLOCK_REQUEST=30,n.RCPDU_CONFERENCE_UNLOCK_RESPONSE=31,n.RCPDU_CONFERENCE_UNLOCK_INDICATION=32,n.RCPDU_CONFERENCE_LEAVE_REQUEST=39,n.RCPDU_CONFERENCE_TERMINATE_REQUEST=40,n.RCPDU_CONFERENCE_TERMINATE_RESPONSE=41,n.RCPDU_CONFERENCE_TERMINATE_INDICATION=42,n.RCPDU_CONFERENCE_EJECT_USER_REQUEST=50,n.RCPDU_CONFERENCE_EJECT_USER_RESPONSE=51,n.RCPDU_CONFERENCE_EJECT_USER_INDICATION=52,n.RCPDU_ROSTER_UPDATE_INDICATION=60,n.RCPDU_REGISTRY_UPDATE_REQUEST=70,n.RCPDU_REGISTRY_UPDATE_RESPONSE=71,n.RCPDU_REGISTRY_UPDATE_INDICATION=72,n.RCPDU_FUNCTION_NOT_SUPPORTED_RESPONSE=80,n.RCPDU_SESSION_JOIN_REQUEST=90,n.RCPDU_SESSION_JOIN_RESPONSE=91,n.RCPDU_CHANNEL_GRAB_REQUEST=100,n.RCPDU_CHANNEL_GRAB_RESPONSE=101,n.RCPDU_CHANNEL_GRAB_INDICATION=102,n.RCPDU_CHANNEL_JOIN_REQUEST=103,n.RCPDU_CHANNEL_JOIN_RESPONSE=104,n.RCPDU_CHANNEL_LEAVE_REQUEST=105,n.RCPDU_CHANNEL_RELEASE_REQUEST=106,n.RCPDU_CHANNEL_RELEASE_INDICATION=107,n.RCPDU_SEND_DATA_REQUEST=120,n.RCPDU_SEND_DATA_REQUEST=120,n.RCPDU_SEND_DATA_INDICATION=121,n.RCPDU_UNIFORM_SEND_DATA_REQUEST=125,n.RCPDU_UNIFORM_SEND_DATA_INDICATION=126,n.RCPDU_TOKEN_GRAB_REQUEST=130,n.RCPDU_TOKEN_GRAB_CONFIRM=131,n.RCPDU_TOKEN_INHIBIT_REQUEST=132,n.RCPDU_TOKEN_INHIBIT_CONFIRM=133,n.RCPDU_TOKEN_GIVE_REQUEST=134,n.RCPDU_TOKEN_GIVE_INDICATION=135,n.RCPDU_TOKEN_GIVE_RESPONSE=136,n.RCPDU_TOKEN_GIVE_CONFIRM=137,n.RCPDU_TOKEN_PLEASE_REQUEST=138,n.RCPDU_TOKEN_PLEASE_INDICATION=139,n.RCPDU_TOKEN_RELEASE_REQUEST=140,n.RCPDU_TOKEN_RELEASE_CONFIRM=141,n.RCPDU_TOKEN_TEST_REQUEST=142,n.RCPDU_TOKEN_TEST_CONFIRM=143,n.RCPDU_REG_REGISTER_KEY=200,n.RCPDU_REG_UNREGISTER_KEY=201,n.RCPDU_REG_REGISTER_ROSTER=202,n.RCPDU_REG_REGISTER_TOKEN=203,
+n.RCPDU_REG_REGISTER_PARAMETER=204,n.RCPDU_REG_REGISTER_COUNTER=205,n.RCPDU_REG_REGISTER_TABLE=206,n.RCPDU_REG_REGISTER_CACHE=207,n.RCPDU_REG_REGISTER_OBJ=208,n.RCPDU_REG_UNREGISTER_OBJ=209,n.RCPDU_REG_UPDATE_OBJ=210,n.RCPDU_REG_ADAPTER=211,n.RCPDU_REG_CLEANUP_NODE=212,n.RCPDU_REG_REGISTER_QUEUE=213,n.RCPDU_REG_TABLE_INSERT_PDU=230,n.RCPDU_REG_TABLE_DELETE_PDU=231,n.RCPDU_REG_TABLE_UPDATE_PDU=232,n.RCPDU_REG_ROSTER_INSERT_PDU=240,n.RCPDU_REG_ROSTER_DELETE_PDU=241,n.RCPDU_REG_ROSTER_UPDATE_PDU=242,n.RCPDU_REG_PARAMETER_UPDATE_PDU=250,n.RCPDU_REG_QUEUE_INSERT_PDU=255,n.RCPDU_REG_QUEUE_DELETE_PDU=256,n.RCPDU_REG_QUEUE_UPDATE_PDU=257,n.RCPDU_CONFERENCE_SEND_DATA_REQUEST=259,n.RCPDU_VIDEO_SEND_DATA_REQUEST=260,n.RCPDU_AUDIO_SEND_DATA_REQUEST=261,n.RCPDU_GIFT_SEND_DATA_REQUEST=262,n.RCPDU_CHAT_SEND_DATA_REQUEST=263,n.RCPDU_VOTING_POLL_RECORD=265,n.RCPDU_REG_REQUEST_OBJ=290,n.RCPDU_REG_RESPONSE_OBJ=291,n.RCPDU_REG_COUNTER_REQUEST_PDU=292,n.RCPDU_REG_COUNTER_RESPONSE_PDU=293,n.RCPDU_INDEX_ADAPTER=300,n.RCPDU_INDEX_SERVER_USERS=301,n.RCPDU_INDEX_CONFERENCE_USER_JOINED=302,n.RCPDU_INDEX_CONFERENCE_USER_EXITED=303,n.RCPDU_INDEX_CONFERENCE_USERS=304;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&__REACT_HOT_LOADER__.register(n,"RCPduPackage","D:/work/McuClient/src/pdu/PduType.js")})()},function(e,t,n){var r,i,o;(function(e){!function(s,a){n(9).amd?(i=[n(16)],r=a,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(e.exports=o))):"object"==typeof e&&e&&e.exports?e.exports=function(){var e;try{e=n(16)}catch(e){}return a(e)}():(s.dcodeIO=s.dcodeIO||{}).ByteBuffer=a(s.dcodeIO.Long)}(this,function(e){"use strict";function t(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function n(){var e=[],t=[];return function(){return 0===arguments.length?t.join("")+u.apply(String,e):(e.length+arguments.length>1024&&(t.push(u.apply(String,e)),e.length=0),void Array.prototype.push.apply(e,arguments))}}function r(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,f=u>>1,l=-7,h=n?i-1:0,d=n?-1:1,c=e[t+h];for(h+=d,o=c&(1<<-l)-1,c>>=-l,l+=a;l>0;o=256*o+e[t+h],h+=d,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+h],h+=d,l-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:(c?-1:1)*(1/0);s+=Math.pow(2,r),o-=f}return(c?-1:1)*s*Math.pow(2,o-r)}function i(e,t,n,r,i,o){var s,a,u,f=8*o-i-1,l=(1<<f)-1,h=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,c=r?0:o-1,E=r?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+h>=1?d/u:d*Math.pow(2,1-h),t*u>=2&&(s++,u/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(t*u-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[n+c]=255&a,c+=E,a/=256,i-=8);for(s=s<<i|a,f+=i;f>0;e[n+c]=255&s,c+=E,s/=256,f-=8);e[n+c-E]|=128*_}var o=function(e,t,n){if("undefined"==typeof e&&(e=o.DEFAULT_CAPACITY),"undefined"==typeof t&&(t=o.DEFAULT_ENDIAN),"undefined"==typeof n&&(n=o.DEFAULT_NOASSERT),!n){if(e|=0,e<0)throw RangeError("Illegal capacity");t=!!t,n=!!n}this.buffer=0===e?a:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=t,this.noAssert=n};o.VERSION="5.0.1",o.LITTLE_ENDIAN=!0,o.BIG_ENDIAN=!1,o.DEFAULT_CAPACITY=16,o.DEFAULT_ENDIAN=o.BIG_ENDIAN,o.DEFAULT_NOASSERT=!1,o.Long=e||null;var s=o.prototype;s.__isByteBuffer__,Object.defineProperty(s,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var a=new ArrayBuffer(0),u=String.fromCharCode;o.accessor=function(){return Uint8Array},o.allocate=function(e,t,n){return new o(e,t,n)},o.concat=function(e,t,n,r){"boolean"!=typeof t&&"string"==typeof t||(r=n,n=t,t=void 0);for(var i,s=0,a=0,u=e.length;a<u;++a)o.isByteBuffer(e[a])||(e[a]=o.wrap(e[a],t)),i=e[a].limit-e[a].offset,i>0&&(s+=i);if(0===s)return new o(0,n,r);var f,l=new o(s,n,r);for(a=0;a<u;)f=e[a++],i=f.limit-f.offset,i<=0||(l.view.set(f.view.subarray(f.offset,f.limit),l.offset),l.offset+=i);return l.limit=l.offset,l.offset=0,l},o.isByteBuffer=function(e){return(e&&e.__isByteBuffer__)===!0},o.type=function(){return ArrayBuffer},o.wrap=function(e,t,n,r){if("string"!=typeof t&&(r=n,n=t,t=void 0),"string"==typeof e)switch("undefined"==typeof t&&(t="utf8"),t){case"base64":return o.fromBase64(e,n);case"hex":return o.fromHex(e,n);case"binary":return o.fromBinary(e,n);case"utf8":return o.fromUTF8(e,n);case"debug":return o.fromDebug(e,n);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");var i;if(o.isByteBuffer(e))return i=s.clone.call(e),i.markedOffset=-1,i;if(e instanceof Uint8Array)i=new o(0,n,r),e.length>0&&(i.buffer=e.buffer,i.offset=e.byteOffset,i.limit=e.byteOffset+e.byteLength,i.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)i=new o(0,n,r),e.byteLength>0&&(i.buffer=e,i.offset=0,i.limit=e.byteLength,i.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");i=new o(e.length,n,r),i.limit=e.length;for(var a=0;a<e.length;++a)i.view[a]=e[a]}return i},s.writeBitSet=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,i=t,o=e.length,s=o>>3,a=0;for(t+=this.writeVarint32(o,t);s--;)r=1&!!e[a++]|(1&!!e[a++])<<1|(1&!!e[a++])<<2|(1&!!e[a++])<<3|(1&!!e[a++])<<4|(1&!!e[a++])<<5|(1&!!e[a++])<<6|(1&!!e[a++])<<7,this.writeByte(r,t++);if(a<o){var u=0;for(r=0;a<o;)r|=(1&!!e[a++])<<u++;this.writeByte(r,t++)}return n?(this.offset=t,this):t-i},s.readBitSet=function(e){var t="undefined"==typeof e;t&&(e=this.offset);var n,r=this.readVarint32(e),i=r.value,o=i>>3,s=0,a=[];for(e+=r.length;o--;)n=this.readByte(e++),a[s++]=!!(1&n),a[s++]=!!(2&n),a[s++]=!!(4&n),a[s++]=!!(8&n),a[s++]=!!(16&n),a[s++]=!!(32&n),a[s++]=!!(64&n),a[s++]=!!(128&n);if(s<i){var u=0;for(n=this.readByte(e++);s<i;)a[s++]=!!(n>>u++&1)}return t&&(this.offset=e),a},s.readBytes=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}var r=this.slice(t,t+e);return n&&(this.offset+=e),r},s.writeBytes=s.append,s.writeInt8=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},s.writeByte=s.writeInt8,s.readInt8=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=this.view[e];return 128===(128&n)&&(n=-(255-n+1)),t&&(this.offset+=1),n},s.readByte=s.readInt8,s.writeUint8=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},s.writeUInt8=s.writeUint8,s.readUint8=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=this.view[e];return t&&(this.offset+=1),n},s.readUInt8=s.readUint8,s.writeInt16=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},s.writeShort=s.writeInt16,s.readInt16=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e],n|=this.view[e+1]<<8):(n=this.view[e]<<8,n|=this.view[e+1]),32768===(32768&n)&&(n=-(65535-n+1)),t&&(this.offset+=2),n},s.readShort=s.readInt16,s.writeUint16=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},s.writeUInt16=s.writeUint16,s.readUint16=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e],n|=this.view[e+1]<<8):(n=this.view[e]<<8,n|=this.view[e+1]),t&&(this.offset+=2),n},s.readUInt16=s.readUint16,s.writeInt32=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),n&&(this.offset+=4),this},s.writeInt=s.writeInt32,s.readInt32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0),n|=0,t&&(this.offset+=4),n},s.readInt=s.readInt32,s.writeUint32=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),n&&(this.offset+=4),this},s.writeUInt32=s.writeUint32,s.readUint32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0),t&&(this.offset+=4),n},s.readUInt32=s.readUint32,e&&(s.writeInt64=function(t,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),n+=8;var i=this.buffer.byteLength;n>i&&this.resize((i*=2)>n?i:n),n-=8;var o=t.low,s=t.high;return this.littleEndian?(this.view[n+3]=o>>>24&255,this.view[n+2]=o>>>16&255,this.view[n+1]=o>>>8&255,this.view[n]=255&o,n+=4,this.view[n+3]=s>>>24&255,this.view[n+2]=s>>>16&255,this.view[n+1]=s>>>8&255,this.view[n]=255&s):(this.view[n]=s>>>24&255,this.view[n+1]=s>>>16&255,this.view[n+2]=s>>>8&255,this.view[n+3]=255&s,n+=4,this.view[n]=o>>>24&255,this.view[n+1]=o>>>16&255,this.view[n+2]=o>>>8&255,this.view[n+3]=255&o),r&&(this.offset+=8),this},s.writeLong=s.writeInt64,s.readInt64=function(t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=0,i=0;this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0,t+=4,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0,t+=4,r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0);var o=new e(r,i,!1);return n&&(this.offset+=8),o},s.readLong=s.readInt64,s.writeUint64=function(t,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),n+=8;var i=this.buffer.byteLength;n>i&&this.resize((i*=2)>n?i:n),n-=8;var o=t.low,s=t.high;return this.littleEndian?(this.view[n+3]=o>>>24&255,this.view[n+2]=o>>>16&255,this.view[n+1]=o>>>8&255,this.view[n]=255&o,n+=4,this.view[n+3]=s>>>24&255,this.view[n+2]=s>>>16&255,this.view[n+1]=s>>>8&255,this.view[n]=255&s):(this.view[n]=s>>>24&255,this.view[n+1]=s>>>16&255,this.view[n+2]=s>>>8&255,this.view[n+3]=255&s,n+=4,this.view[n]=o>>>24&255,this.view[n+1]=o>>>16&255,this.view[n+2]=o>>>8&255,this.view[n+3]=255&o),r&&(this.offset+=8),this},s.writeUInt64=s.writeUint64,s.readUint64=function(t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=0,i=0;this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0,t+=4,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0,t+=4,r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0);var o=new e(r,i,!0);return n&&(this.offset+=8),o},s.readUInt64=s.readUint64),s.writeFloat32=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,i(this.view,e,t,this.littleEndian,23,4),n&&(this.offset+=4),this},s.writeFloat=s.writeFloat32,s.readFloat32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=r(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),n},s.readFloat=s.readFloat32,s.writeFloat64=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=8;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=8,i(this.view,e,t,this.littleEndian,52,8),n&&(this.offset+=8),this},s.writeDouble=s.writeFloat64,s.readFloat64=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var n=r(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),n},s.readDouble=s.readFloat64,o.MAX_VARINT32_BYTES=5,o.calculateVarint32=function(e){return e>>>=0,e<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},o.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},o.zigZagDecode32=function(e){return e>>>1^-(1&e)|0},s.writeVarint32=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,i=o.calculateVarint32(e);t+=i;var s=this.buffer.byteLength;for(t>s&&this.resize((s*=2)>t?s:t),t-=i,e>>>=0;e>=128;)r=127&e|128,this.view[t++]=r,e>>>=7;return this.view[t++]=e,n?(this.offset=t,this):i},s.writeVarint32ZigZag=function(e,t){return this.writeVarint32(o.zigZagEncode32(e),t)},s.readVarint32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n,r=0,i=0;do{if(!this.noAssert&&e>this.limit){var o=Error("Truncated");throw o.truncated=!0,o}n=this.view[e++],r<5&&(i|=(127&n)<<7*r),++r}while(0!==(128&n));return i|=0,t?(this.offset=e,i):{value:i,length:r}},s.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"==typeof t?t.value=o.zigZagDecode32(t.value):t=o.zigZagDecode32(t),t},e&&(o.MAX_VARINT64_BYTES=10,o.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var n=t.toInt()>>>0,r=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==r?n<16384?n<128?1:2:n<1<<21?3:4:r<16384?r<128?5:6:r<1<<21?7:8:i<128?9:10},o.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):t.unsigned!==!1&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},o.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):t.unsigned!==!1&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},s.writeVarint64=function(t,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):t.unsigned!==!1&&(t=t.toSigned());var i=o.calculateVarint64(t),s=t.toInt()>>>0,a=t.shiftRightUnsigned(28).toInt()>>>0,u=t.shiftRightUnsigned(56).toInt()>>>0;n+=i;var f=this.buffer.byteLength;switch(n>f&&this.resize((f*=2)>n?f:n),n-=i,i){case 10:this.view[n+9]=u>>>7&1;case 9:this.view[n+8]=9!==i?128|u:127&u;case 8:this.view[n+7]=8!==i?a>>>21|128:a>>>21&127;case 7:this.view[n+6]=7!==i?a>>>14|128:a>>>14&127;case 6:this.view[n+5]=6!==i?a>>>7|128:a>>>7&127;case 5:this.view[n+4]=5!==i?128|a:127&a;case 4:this.view[n+3]=4!==i?s>>>21|128:s>>>21&127;case 3:this.view[n+2]=3!==i?s>>>14|128:s>>>14&127;case 2:this.view[n+1]=2!==i?s>>>7|128:s>>>7&127;case 1:this.view[n]=1!==i?128|s:127&s}return r?(this.offset+=i,this):i},s.writeVarint64ZigZag=function(e,t){return this.writeVarint64(o.zigZagEncode64(e),t)},s.readVarint64=function(t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r=t,i=0,o=0,s=0,a=0;if(a=this.view[t++],i=127&a,128&a&&(a=this.view[t++],i|=(127&a)<<7,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],i|=(127&a)<<14,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],i|=(127&a)<<21,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],o=127&a,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],o|=(127&a)<<7,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],o|=(127&a)<<14,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],o|=(127&a)<<21,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],s=127&a,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],s|=(127&a)<<7,128&a||this.noAssert&&"undefined"==typeof a))))))))))throw Error("Buffer overrun");var u=e.fromBits(i|o<<28,o>>>4|s<<24,!1);return n?(this.offset=t,u):{value:u,length:t-r}},s.readVarint64ZigZag=function(t){var n=this.readVarint64(t);return n&&n.value instanceof e?n.value=o.zigZagDecode64(n.value):n=o.zigZagDecode64(n),n}),s.writeCString=function(e,n){var r="undefined"==typeof n;r&&(n=this.offset);var i,o=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(i=0;i<o;++i)if(0===e.charCodeAt(i))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}o=l.calculateUTF16asUTF8(t(e))[1],n+=o+1;var s=this.buffer.byteLength;return n>s&&this.resize((s*=2)>n?s:n),n-=o+1,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),this.view[n++]=0,r?(this.offset=n,this):o},s.readCString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,i=e,o=-1;return l.decodeUTF8toUTF16(function(){if(0===o)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return o=this.view[e++],0===o?null:o}.bind(this),r=n(),!0),t?(this.offset=e,r()):{string:r(),length:e-i}},s.writeIString=function(e,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,o=n;i=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],n+=4+i;var s=this.buffer.byteLength;if(n>s&&this.resize((s*=2)>n?s:n),n-=4+i,this.littleEndian?(this.view[n+3]=i>>>24&255,this.view[n+2]=i>>>16&255,this.view[n+1]=i>>>8&255,this.view[n]=255&i):(this.view[n]=i>>>24&255,this.view[n+1]=i>>>16&255,this.view[n+2]=i>>>8&255,this.view[n+3]=255&i),n+=4,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==o+4+i)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+4+i));return r?(this.offset=n,this):n-o},s.readIString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=e,r=this.readUint32(e),i=this.readUTF8String(r,o.METRICS_BYTES,e+=4);return e+=i.length,t?(this.offset=e,i.string):{string:i.string,length:e-n}},o.METRICS_CHARS="c",o.METRICS_BYTES="b",s.writeUTF8String=function(e,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,o=n;i=l.calculateUTF16asUTF8(t(e))[1],n+=i;var s=this.buffer.byteLength;return n>s&&this.resize((s*=2)>n?s:n),n-=i,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),r?(this.offset=n,this):n-o},s.writeString=s.writeUTF8String,o.calculateUTF8Chars=function(e){return l.calculateUTF16asUTF8(t(e))[0]},o.calculateUTF8Bytes=function(e){return l.calculateUTF16asUTF8(t(e))[1]},o.calculateString=o.calculateUTF8Bytes,s.readUTF8String=function(e,t,r){"number"==typeof t&&(r=t,t=void 0);var i="undefined"==typeof r;if(i&&(r=this.offset),"undefined"==typeof t&&(t=o.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!==0)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,r<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var s,a=0,u=r;if(t===o.METRICS_CHARS){if(s=n(),l.decodeUTF8(function(){return a<e&&r<this.limit?this.view[r++]:null}.bind(this),function(e){++a,l.UTF8toUTF16(e,s)}),a!==e)throw RangeError("Illegal range: Truncated data, "+a+" == "+e);return i?(this.offset=r,s()):{string:s(),length:r-u}}if(t===o.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||r%1!==0)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,r<0||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}var f=r+e;if(l.decodeUTF8toUTF16(function(){return r<f?this.view[r++]:null}.bind(this),s=n(),this.noAssert),r!==f)throw RangeError("Illegal range: Truncated data, "+r+" == "+f);return i?(this.offset=r,s()):{string:s(),length:r-u}}throw TypeError("Unsupported metrics: "+t)},s.readString=s.readUTF8String,s.writeVString=function(e,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,s,a=n;i=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],s=o.calculateVarint32(i),n+=s+i;var u=this.buffer.byteLength;if(n>u&&this.resize((u*=2)>n?u:n),n-=s+i,n+=this.writeVarint32(i,n),l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==a+i+s)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+i+s));return r?(this.offset=n,this):n-a},s.readVString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=e,r=this.readVarint32(e),i=this.readUTF8String(r.value,o.METRICS_BYTES,e+=r.length);return e+=i.length,t?(this.offset=e,i.string):{string:i.string,length:e-n}},s.append=function(e,t,n){"number"!=typeof t&&"string"==typeof t||(n=t,t=void 0);var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof o||(e=o.wrap(e,t));var i=e.limit-e.offset;if(i<=0)return this;n+=i;var s=this.buffer.byteLength;return n>s&&this.resize((s*=2)>n?s:n),n-=i,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=i,r&&(this.offset+=i),this},s.appendTo=function(e,t){return e.append(this,t),this},s.assert=function(e){return this.noAssert=!e,this},s.capacity=function(){return this.buffer.byteLength},s.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},s.clone=function(e){var t=new o(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},s.compact=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(0===e&&t===this.buffer.byteLength)return this;var n=t-e;if(0===n)return this.buffer=a,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var r=new ArrayBuffer(n),i=new Uint8Array(r);return i.set(this.view.subarray(e,t)),this.buffer=r,this.view=i,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=n,this},s.copy=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");
+if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new o(0,this.littleEndian,this.noAssert);var n=t-e,r=new o(n,this.littleEndian,this.noAssert);return r.offset=0,r.limit=n,r.markedOffset>=0&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},s.copyTo=function(e,t,n,r){var i,s;if(!this.noAssert&&!o.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(s="undefined"==typeof t)?e.offset:0|t,n=(i="undefined"==typeof n)?this.offset:0|n,r="undefined"==typeof r?this.limit:0|r,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(n<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);var a=r-n;return 0===a?e:(e.ensureCapacity(t+a),e.view.set(this.view.subarray(n,r),t),i&&(this.offset+=a),s&&(e.offset+=a),this)},s.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},s.fill=function(e,t,n){var r="undefined"==typeof t;if(r&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),"undefined"==typeof t&&(t=this.offset),"undefined"==typeof n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!==0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(t>=n)return this;for(;t<n;)this.view[t++]=e;return r&&(this.offset=t),this},s.flip=function(){return this.limit=this.offset,this.offset=0,this},s.mark=function(e){if(e="undefined"==typeof e?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},s.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},s.LE=function(e){return this.littleEndian="undefined"==typeof e||!!e,this},s.BE=function(e){return this.littleEndian="undefined"!=typeof e&&!e,this},s.prepend=function(e,t,n){"number"!=typeof t&&"string"==typeof t||(n=t,t=void 0);var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof o||(e=o.wrap(e,t));var i=e.limit-e.offset;if(i<=0)return this;var s=i-n;if(s>0){var a=new ArrayBuffer(this.buffer.byteLength+s),u=new Uint8Array(a);u.set(this.view.subarray(n,this.buffer.byteLength),i),this.buffer=a,this.view=u,this.offset+=s,this.markedOffset>=0&&(this.markedOffset+=s),this.limit+=s,n+=s}else{new Uint8Array(this.buffer)}return this.view.set(e.view.subarray(e.offset,e.limit),n-i),e.offset=e.limit,r&&(this.offset-=i),this},s.prependTo=function(e,t){return e.prepend(this,t),this},s.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},s.remaining=function(){return this.limit-this.offset},s.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},s.resize=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if(e|=0,e<0)throw RangeError("Illegal capacity: 0 <= "+e)}if(this.buffer.byteLength<e){var t=new ArrayBuffer(e),n=new Uint8Array(t);n.set(this.view),this.buffer=t,this.view=n}return this},s.reverse=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t?this:(Array.prototype.reverse.call(this.view.subarray(e,t)),this)},s.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},s.slice=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var n=this.clone();return n.offset=e,n.limit=t,n},s.toBuffer=function(e){var t=this.offset,n=this.limit;if(!this.noAssert){if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!==0)throw TypeError("Illegal limit: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(!e&&0===t&&n===this.buffer.byteLength)return this.buffer;if(t===n)return a;var r=new ArrayBuffer(n-t);return new Uint8Array(r).set(new Uint8Array(this.buffer).subarray(t,n),0),r},s.toArrayBuffer=s.toBuffer,s.toString=function(e,t,n){if("undefined"==typeof e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(e="utf8",t=e,n=t),e){case"utf8":return this.toUTF8(t,n);case"base64":return this.toBase64(t,n);case"hex":return this.toHex(t,n);case"binary":return this.toBinary(t,n);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var f=function(){for(var e={},t=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],n=[],r=0,i=t.length;r<i;++r)n[t[r]]=r;return e.encode=function(e,n){for(var r,i;null!==(r=e());)n(t[r>>2&63]),i=(3&r)<<4,null!==(r=e())?(i|=r>>4&15,n(t[63&(i|r>>4&15)]),i=(15&r)<<2,null!==(r=e())?(n(t[63&(i|r>>6&3)]),n(t[63&r])):(n(t[63&i]),n(61))):(n(t[63&i]),n(61),n(61))},e.decode=function(e,t){function r(e){throw Error("Illegal character code: "+e)}for(var i,o,s;null!==(i=e());)if(o=n[i],"undefined"==typeof o&&r(i),null!==(i=e())&&(s=n[i],"undefined"==typeof s&&r(i),t(o<<2>>>0|(48&s)>>4),null!==(i=e()))){if(o=n[i],"undefined"==typeof o){if(61===i)break;r(i)}if(t((15&s)<<4>>>0|(60&o)>>2),null!==(i=e())){if(s=n[i],"undefined"==typeof s){if(61===i)break;r(i)}t((3&o)<<6>>>0|s)}}},e.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},e}();s.toBase64=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),e|=0,t|=0,e<0||t>this.capacity||e>t)throw RangeError("begin, end");var r;return f.encode(function(){return e<t?this.view[e++]:null}.bind(this),r=n()),r()},o.fromBase64=function(e,n){if("string"!=typeof e)throw TypeError("str");var r=new o(e.length/4*3,n),i=0;return f.decode(t(e),function(e){r.view[i++]=e}),r.limit=i,r},o.btoa=function(e){return o.fromBinary(e).toBase64()},o.atob=function(e){return o.fromBase64(e).toBinary()},s.toBinary=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),e|=0,t|=0,e<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var n=[],r=[];e<t;)n.push(this.view[e++]),n.length>=1024&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},o.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var n,r=0,i=e.length,s=new o(i,t);r<i;){if(n=e.charCodeAt(r),n>255)throw RangeError("illegal char code: "+n);s.view[r++]=n}return s.limit=i,s},s.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",o="",s="";n<r;){if(n!==-1&&(t=this.view[n],i+=t<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(o+=t>32&&t<127?String.fromCharCode(t):".")),++n,e&&n>0&&n%16===0&&n!==r){for(;i.length<51;)i+=" ";s+=i+o+"\n",i=o=""}i+=n===this.offset&&n===this.limit?n===this.markedOffset?"!":"|":n===this.offset?n===this.markedOffset?"[":"<":n===this.limit?n===this.markedOffset?"]":">":n===this.markedOffset?"'":e||0!==n&&n!==r?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";s+=i+o+"\n"}return e?s:i},o.fromDebug=function(e,t,n){for(var r,i,s=e.length,a=new o((s+1)/3|0,t,n),u=0,f=0,l=!1,h=!1,d=!1,c=!1,E=!1;u<s;){switch(r=e.charAt(u++)){case"!":if(!n){if(h||d||c){E=!0;break}h=d=c=!0}a.offset=a.markedOffset=a.limit=f,l=!1;break;case"|":if(!n){if(h||c){E=!0;break}h=c=!0}a.offset=a.limit=f,l=!1;break;case"[":if(!n){if(h||d){E=!0;break}h=d=!0}a.offset=a.markedOffset=f,l=!1;break;case"<":if(!n){if(h){E=!0;break}h=!0}a.offset=f,l=!1;break;case"]":if(!n){if(c||d){E=!0;break}c=d=!0}a.limit=a.markedOffset=f,l=!1;break;case">":if(!n){if(c){E=!0;break}c=!0}a.limit=f,l=!1;break;case"'":if(!n){if(d){E=!0;break}d=!0}a.markedOffset=f,l=!1;break;case" ":l=!1;break;default:if(!n&&l){E=!0;break}if(i=parseInt(r+e.charAt(u++),16),!n&&(isNaN(i)||i<0||i>255))throw TypeError("Illegal str: Not a debug encoded string");a.view[f++]=i,l=!0}if(E)throw TypeError("Illegal str: Invalid symbol at "+u)}if(!n){if(!h||!c)throw TypeError("Illegal str: Missing offset or limit");if(f<a.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+f+" < "+s)}return a},s.toHex=function(e,t){if(e="undefined"==typeof e?this.offset:e,t="undefined"==typeof t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var n,r=new Array(t-e);e<t;)n=this.view[e++],n<16?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},o.fromHex=function(e,t,n){if(!n){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!==0)throw TypeError("Illegal str: Length not a multiple of 2")}for(var r,i=e.length,s=new o(i/2|0,t),a=0,u=0;a<i;a+=2){if(r=parseInt(e.substring(a,a+2),16),!n&&(!isFinite(r)||r<0||r>255))throw TypeError("Illegal str: Contains non-hex characters");s.view[u++]=r}return s.limit=u,s};var l=function(){var e={};return e.MAX_CODEPOINT=1114111,e.encodeUTF8=function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):n<2048?(t(n>>6&31|192),t(63&n|128)):n<65536?(t(n>>12&15|224),t(n>>6&63|128),t(63&n|128)):(t(n>>18&7|240),t(n>>12&63|128),t(n>>6&63|128),t(63&n|128)),n=null},e.decodeUTF8=function(e,t){for(var n,r,i,o,s=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(n=e());)if(0===(128&n))t(n);else if(192===(224&n))null===(r=e())&&s([n,r]),t((31&n)<<6|63&r);else if(224===(240&n))(null===(r=e())||null===(i=e()))&&s([n,r,i]),t((15&n)<<12|(63&r)<<6|63&i);else{if(240!==(248&n))throw RangeError("Illegal starting byte: "+n);(null===(r=e())||null===(i=e())||null===(o=e()))&&s([n,r,i,o]),t((7&n)<<18|(63&r)<<12|(63&i)<<6|63&o)}},e.UTF16toUTF8=function(e,t){for(var n,r=null;;){if(null===(n=null!==r?r:e()))break;n>=55296&&n<=57343&&null!==(r=e())&&r>=56320&&r<=57343?(t(1024*(n-55296)+r-56320+65536),r=null):t(n)}null!==r&&t(r)},e.UTF8toUTF16=function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<=65535?t(n):(n-=65536,t((n>>10)+55296),t(n%1024+56320)),n=null},e.encodeUTF16toUTF8=function(t,n){e.UTF16toUTF8(t,function(t){e.encodeUTF8(t,n)})},e.decodeUTF8toUTF16=function(t,n){e.decodeUTF8(t,function(t){e.UTF8toUTF16(t,n)})},e.calculateCodePoint=function(e){return e<128?1:e<2048?2:e<65536?3:4},e.calculateUTF8=function(e){for(var t,n=0;null!==(t=e());)n+=t<128?1:t<2048?2:t<65536?3:4;return n},e.calculateUTF16asUTF8=function(t){var n=0,r=0;return e.UTF16toUTF8(t,function(e){++n,r+=e<128?1:e<2048?2:e<65536?3:4}),[n,r]},e}();return s.toUTF8=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;try{l.decodeUTF8toUTF16(function(){return e<t?this.view[e++]:null}.bind(this),r=n())}catch(n){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},o.fromUTF8=function(e,n,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new o(l.calculateUTF16asUTF8(t(e),!0)[1],n,r),s=0;return l.encodeUTF16toUTF8(t(e),function(e){i.view[s++]=e}),i.limit=s,i},o})}).call(t,n(7)(e))},function(e,t,n){var r,i,o;(function(e){!function(s,a){n(9).amd?(i=[],r=a,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(e.exports=o))):"object"==typeof e&&e&&e.exports?e.exports=a():(s.dcodeIO=s.dcodeIO||{}).Long=a()}(this,function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return(e&&e.__isLong__)===!0}function n(e,t){var n,r,o;return t?(e>>>=0,(o=0<=e&&e<256)&&(r=u[e])?r:(n=i(e,(0|e)<0?-1:0,!0),o&&(u[e]=n),n)):(e|=0,(o=-128<=e&&e<128)&&(r=a[e])?r:(n=i(e,e<0?-1:0,!1),o&&(a[e]=n),n))}function r(e,t){if(isNaN(e)||!isFinite(e))return t?p:_;if(t){if(e<0)return p;if(e>=d)return C}else{if(e<=-c)return S;if(e+1>=c)return T}return e<0?r(-e,t).neg():i(e%h|0,e/h|0,t)}function i(t,n,r){return new e(t,n,r)}function o(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return _;if("number"==typeof t?(n=t,t=!1):t=!!t,n=n||10,n<2||36<n)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return o(e.substring(1),t,n).neg();for(var s=r(f(n,8)),a=_,u=0;u<e.length;u+=8){var l=Math.min(8,e.length-u),h=parseInt(e.substring(u,u+l),n);if(l<8){var d=r(f(n,l));a=a.mul(d).add(r(h))}else a=a.mul(s),a=a.add(r(h))}return a.unsigned=t,a}function s(t){return t instanceof e?t:"number"==typeof t?r(t):"string"==typeof t?o(t):i(t.low,t.high,t.unsigned)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var a={},u={};e.fromInt=n,e.fromNumber=r,e.fromBits=i;var f=Math.pow;e.fromString=o,e.fromValue=s;var l=1<<24,h=4294967296,d=0x10000000000000000,c=d/2,E=n(l),_=n(0);e.ZERO=_;var p=n(0,!0);e.UZERO=p;var g=n(1);e.ONE=g;var R=n(1,!0);e.UONE=R;var y=n(-1);e.NEG_ONE=y;var T=i(-1,2147483647,!1);e.MAX_VALUE=T;var C=i(-1,-1,!0);e.MAX_UNSIGNED_VALUE=C;var S=i(0,-2147483648,!1);e.MIN_VALUE=S;var b=e.prototype;return b.toInt=function(){return this.unsigned?this.low>>>0:this.low},b.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},b.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(S)){var t=r(e),n=this.div(t),i=n.mul(t).sub(this);return n.toString(e)+i.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var o=r(f(e,6),this.unsigned),s=this,a="";;){var u=s.div(o),l=s.sub(u.mul(o)).toInt()>>>0,h=l.toString(e);if(s=u,s.isZero())return h+a;for(;h.length<6;)h="0"+h;a=""+h+a}},b.getHighBits=function(){return this.high},b.getHighBitsUnsigned=function(){return this.high>>>0},b.getLowBits=function(){return this.low},b.getLowBitsUnsigned=function(){return this.low>>>0},b.getNumBitsAbs=function(){if(this.isNegative())return this.eq(S)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},b.isZero=function(){return 0===this.high&&0===this.low},b.isNegative=function(){return!this.unsigned&&this.high<0},b.isPositive=function(){return this.unsigned||this.high>=0},b.isOdd=function(){return 1===(1&this.low)},b.isEven=function(){return 0===(1&this.low)},b.equals=function(e){return t(e)||(e=s(e)),(this.unsigned===e.unsigned||this.high>>>31!==1||e.high>>>31!==1)&&(this.high===e.high&&this.low===e.low)},b.eq=b.equals,b.notEquals=function(e){return!this.eq(e)},b.neq=b.notEquals,b.lessThan=function(e){return this.comp(e)<0},b.lt=b.lessThan,b.lessThanOrEqual=function(e){return this.comp(e)<=0},b.lte=b.lessThanOrEqual,b.greaterThan=function(e){return this.comp(e)>0},b.gt=b.greaterThan,b.greaterThanOrEqual=function(e){return this.comp(e)>=0},b.gte=b.greaterThanOrEqual,b.compare=function(e){if(t(e)||(e=s(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},b.comp=b.compare,b.negate=function(){return!this.unsigned&&this.eq(S)?S:this.not().add(g)},b.neg=b.negate,b.add=function(e){t(e)||(e=s(e));var n=this.high>>>16,r=65535&this.high,o=this.low>>>16,a=65535&this.low,u=e.high>>>16,f=65535&e.high,l=e.low>>>16,h=65535&e.low,d=0,c=0,E=0,_=0;return _+=a+h,E+=_>>>16,_&=65535,E+=o+l,c+=E>>>16,E&=65535,c+=r+f,d+=c>>>16,c&=65535,d+=n+u,d&=65535,i(E<<16|_,d<<16|c,this.unsigned)},b.subtract=function(e){return t(e)||(e=s(e)),this.add(e.neg())},b.sub=b.subtract,b.multiply=function(e){if(this.isZero())return _;if(t(e)||(e=s(e)),e.isZero())return _;if(this.eq(S))return e.isOdd()?S:_;if(e.eq(S))return this.isOdd()?S:_;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(E)&&e.lt(E))return r(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,o=65535&this.high,a=this.low>>>16,u=65535&this.low,f=e.high>>>16,l=65535&e.high,h=e.low>>>16,d=65535&e.low,c=0,p=0,g=0,R=0;return R+=u*d,g+=R>>>16,R&=65535,g+=a*d,p+=g>>>16,g&=65535,g+=u*h,p+=g>>>16,g&=65535,p+=o*d,c+=p>>>16,p&=65535,p+=a*h,c+=p>>>16,p&=65535,p+=u*l,c+=p>>>16,p&=65535,c+=n*d+o*h+a*l+u*f,c&=65535,i(g<<16|R,c<<16|p,this.unsigned)},b.mul=b.multiply,b.divide=function(e){if(t(e)||(e=s(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?p:_;var n,i,o;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return p;if(e.gt(this.shru(1)))return R;o=p}else{if(this.eq(S)){if(e.eq(g)||e.eq(y))return S;if(e.eq(S))return g;var a=this.shr(1);return n=a.div(e).shl(1),n.eq(_)?e.isNegative()?g:y:(i=this.sub(e.mul(n)),o=n.add(i.div(e)))}if(e.eq(S))return this.unsigned?p:_;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=_}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var u=Math.ceil(Math.log(n)/Math.LN2),l=u<=48?1:f(2,u-48),h=r(n),d=h.mul(e);d.isNegative()||d.gt(i);)n-=l,h=r(n,this.unsigned),d=h.mul(e);h.isZero()&&(h=g),o=o.add(h),i=i.sub(d)}return o},b.div=b.divide,b.modulo=function(e){return t(e)||(e=s(e)),this.sub(this.div(e).mul(e))},b.mod=b.modulo,b.not=function(){return i(~this.low,~this.high,this.unsigned)},b.and=function(e){return t(e)||(e=s(e)),i(this.low&e.low,this.high&e.high,this.unsigned)},b.or=function(e){return t(e)||(e=s(e)),i(this.low|e.low,this.high|e.high,this.unsigned)},b.xor=function(e){return t(e)||(e=s(e)),i(this.low^e.low,this.high^e.high,this.unsigned)},b.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0===(e&=63)?this:e<32?i(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):i(0,this.low<<e-32,this.unsigned)},b.shl=b.shiftLeft,b.shiftRight=function(e){return t(e)&&(e=e.toInt()),0===(e&=63)?this:e<32?i(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):i(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},b.shr=b.shiftRight,b.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),e&=63,0===e)return this;var n=this.high;if(e<32){var r=this.low;return i(r>>>e|n<<32-e,n>>>e,this.unsigned)}return 32===e?i(n,0,this.unsigned):i(n>>>e-32,0,this.unsigned)},b.shru=b.shiftRightUnsigned,b.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},b.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},b.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},b.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},b.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})}).call(t,n(7)(e))},function(e,t,n){(function(e){e.require&&(n(32),n(33));var t={isNotUTF8:function(e,n,r){try{t.getStringFromBytes(e,n,r,!0)}catch(e){return!0}return!1},getCharLength:function(e){return 240==(240&e)?4:224==(224&e)?3:192==(192&e)?2:e==(127&e)?1:0},getCharCode:function(e,n,r){var i=0,o="";if(n=n||0,r=r||t.getCharLength(e[n]),0==r)throw new Error(e[n].toString(2)+" is not a significative byte (offset:"+n+").");if(1===r)return e[n];if(o="00000000".slice(0,r)+1+"00000000".slice(r+1),e[n]&parseInt(o,2))throw Error("Index "+n+": A "+r+" bytes encoded char cannot encode the "+(r+1)+"th rank bit to 1.");for(o="0000".slice(0,r+1)+"11111111".slice(r+1),i+=(e[n]&parseInt(o,2))<<6*--r;r;){if(128!==(128&e[n+1])||64===(64&e[n+1]))throw Error("Index "+(n+1)+': Next bytes of encoded char must begin with a "10" bit sequence.');i+=(63&e[++n])<<6*--r}return i},getStringFromBytes:function(e,n,r,i){var o,s=[];for(n|=0,r="number"==typeof r?r:e.byteLength||e.length;n<r;n++){if(o=t.getCharLength(e[n]),n+o>r){if(i)throw Error("Index "+n+": Found a "+o+" bytes encoded char declaration but only "+(r-n)+" bytes are available.")}else s.push(String.fromCodePoint(t.getCharCode(e,n,o,i)));n+=o-1}return s.join("")},getBytesForCharCode:function(e){if(e<128)return 1;if(e<2048)return 2;if(e<65536)return 3;if(e<2097152)return 4;throw new Error("CharCode "+e+" cannot be encoded with UTF8.")},setBytesFromCharCode:function(e,n,r,i){if(e|=0,n=n||[],r|=0,i=i||t.getBytesForCharCode(e),1==i)n[r]=e;else for(n[r++]=(parseInt("1111".slice(0,i),2)<<8-i)+(e>>>6*--i);i>0;)n[r++]=e>>>6*--i&63|128;return n},setBytesFromString:function(e,n,r,i,o){e=e||"",n=n||[],r|=0,i="number"==typeof i?i:n.byteLength||1/0;for(var s=0,a=e.length;s<a;s++){var u=t.getBytesForCharCode(e[s].codePointAt(0));if(o&&r+u>i)throw new Error('Not enought bytes to encode the char "'+e[s]+'" at the offset "'+r+'".');t.setBytesFromCharCode(e[s].codePointAt(0),n,r,u,o),r+=u}return n}};e.exports=t}).call(t,n(7)(e))},function(e,t){(function(){"use strict";function e(e){throw e}function t(e,t){var n=e.split("."),r=S;!(n[0]in r)&&r.execScript&&r.execScript("var "+n[0]);for(var i;n.length&&(i=n.shift());)n.length||t===T?r=r[i]?r[i]:r[i]={}:r[i]=t}function n(t,n){this.index="number"==typeof n?n:0,this.i=0,this.buffer=t instanceof(b?Uint8Array:Array)?t:new(b?Uint8Array:Array)(32768),2*this.buffer.length<=this.index&&e(Error("invalid index")),this.buffer.length<=this.index&&this.f()}function r(e){this.buffer=new(b?Uint16Array:Array)(2*e),this.length=0}function i(e){var t,n,r,i,o,s,a,u,f,l,h=e.length,d=0,c=Number.POSITIVE_INFINITY;for(u=0;u<h;++u)e[u]>d&&(d=e[u]),e[u]<c&&(c=e[u]);for(t=1<<d,n=new(b?Uint32Array:Array)(t),r=1,i=0,o=2;r<=d;){for(u=0;u<h;++u)if(e[u]===r){for(s=0,a=i,f=0;f<r;++f)s=s<<1|1&a,a>>=1;for(l=r<<16|u,f=s;f<t;f+=o)n[f]=l;++i}++r,i<<=1,o<<=1}return[n,d,c]}function o(e,t){this.h=P,this.w=0,this.input=b&&e instanceof Array?new Uint8Array(e):e,this.b=0,t&&(t.lazy&&(this.w=t.lazy),"number"==typeof t.compressionType&&(this.h=t.compressionType),t.outputBuffer&&(this.a=b&&t.outputBuffer instanceof Array?new Uint8Array(t.outputBuffer):t.outputBuffer),"number"==typeof t.outputIndex&&(this.b=t.outputIndex)),this.a||(this.a=new(b?Uint8Array:Array)(32768))}function s(e,t){this.length=e,this.H=t}function a(t,n){function r(t,n){var r,i=t.H,o=[],s=0;r=k[t.length],o[s++]=65535&r,o[s++]=r>>16&255,o[s++]=r>>24;var a;switch(C){case 1===i:a=[0,i-1,0];break;case 2===i:a=[1,i-2,0];break;case 3===i:a=[2,i-3,0];break;case 4===i:a=[3,i-4,0];break;case 6>=i:a=[4,i-5,1];break;case 8>=i:a=[5,i-7,1];break;case 12>=i:a=[6,i-9,2];break;case 16>=i:a=[7,i-13,2];break;case 24>=i:a=[8,i-17,3];break;case 32>=i:a=[9,i-25,3];break;case 48>=i:a=[10,i-33,4];break;case 64>=i:a=[11,i-49,4];break;case 96>=i:a=[12,i-65,5];break;case 128>=i:a=[13,i-97,5];break;case 192>=i:a=[14,i-129,6];break;case 256>=i:a=[15,i-193,6];break;case 384>=i:a=[16,i-257,7];break;case 512>=i:a=[17,i-385,7];break;case 768>=i:a=[18,i-513,8];break;case 1024>=i:a=[19,i-769,8];break;case 1536>=i:a=[20,i-1025,9];break;case 2048>=i:a=[21,i-1537,9];break;case 3072>=i:a=[22,i-2049,10];break;case 4096>=i:a=[23,i-3073,10];break;case 6144>=i:a=[24,i-4097,11];break;case 8192>=i:a=[25,i-6145,11];break;case 12288>=i:a=[26,i-8193,12];break;case 16384>=i:a=[27,i-12289,12];break;case 24576>=i:a=[28,i-16385,13];break;case 32768>=i:a=[29,i-24577,13];break;default:e("invalid distance")}r=a,o[s++]=r[0],o[s++]=r[1],o[s++]=r[2];var u,f;for(u=0,f=o.length;u<f;++u)_[p++]=o[u];R[o[0]]++,y[o[3]]++,g=t.length+n-1,d=null}var i,o,s,a,f,l,h,d,c,E={},_=b?new Uint16Array(2*n.length):[],p=0,g=0,R=new(b?Uint32Array:Array)(286),y=new(b?Uint32Array:Array)(30),S=t.w;if(!b){for(s=0;285>=s;)R[s++]=0;for(s=0;29>=s;)y[s++]=0}for(R[256]=1,i=0,o=n.length;i<o;++i){for(s=f=0,a=3;s<a&&i+s!==o;++s)f=f<<8|n[i+s];if(E[f]===T&&(E[f]=[]),l=E[f],!(0<g--)){for(;0<l.length&&32768<i-l[0];)l.shift();if(i+3>=o){for(d&&r(d,-1),s=0,a=o-i;s<a;++s)c=n[i+s],_[p++]=c,++R[c];break}0<l.length?(h=u(n,i,l),d?d.length<h.length?(c=n[i-1],_[p++]=c,++R[c],r(h,0)):r(d,-1):h.length<S?d=h:r(h,0)):d?r(d,-1):(c=n[i],_[p++]=c,++R[c])}l.push(i)}return _[p++]=256,R[256]++,t.M=R,t.L=y,b?_.subarray(0,p):_}function u(e,t,n){var r,i,o,a,u,f,l=0,h=e.length;a=0,f=n.length;e:for(;a<f;a++){if(r=n[f-a-1],o=3,3<l){for(u=l;3<u;u--)if(e[r+u-1]!==e[t+u-1])continue e;o=l}for(;258>o&&t+o<h&&e[r+o]===e[t+o];)++o;if(o>l&&(i=r,l=o),258===o)break}return new s(l,t-i)}function f(e,t){var n,i,o,s,a,u=e.length,f=new r(572),h=new(b?Uint8Array:Array)(u);if(!b)for(s=0;s<u;s++)h[s]=0;for(s=0;s<u;++s)0<e[s]&&f.push(s,e[s]);if(n=Array(f.length/2),i=new(b?Uint32Array:Array)(f.length/2),1===n.length)return h[f.pop().index]=1,h;for(s=0,a=f.length/2;s<a;++s)n[s]=f.pop(),i[s]=n[s].value;for(o=l(i,i.length,t),s=0,a=n.length;s<a;++s)h[n[s].index]=o[s];return h}function l(e,t,n){function r(e){var n=c[e][E[e]];n===t?(r(e+1),r(e+1)):--h[n],++E[e]}var i,o,s,a,u,f=new(b?Uint16Array:Array)(n),l=new(b?Uint8Array:Array)(n),h=new(b?Uint8Array:Array)(t),d=Array(n),c=Array(n),E=Array(n),_=(1<<n)-t,p=1<<n-1;for(f[n-1]=t,o=0;o<n;++o)_<p?l[o]=0:(l[o]=1,_-=p),_<<=1,f[n-2-o]=(f[n-1-o]/2|0)+t;for(f[0]=l[0],d[0]=Array(f[0]),c[0]=Array(f[0]),o=1;o<n;++o)f[o]>2*f[o-1]+l[o]&&(f[o]=2*f[o-1]+l[o]),d[o]=Array(f[o]),c[o]=Array(f[o]);for(i=0;i<t;++i)h[i]=n;for(s=0;s<f[n-1];++s)d[n-1][s]=e[s],c[n-1][s]=s;for(i=0;i<n;++i)E[i]=0;for(1===l[n-1]&&(--h[0],++E[n-1]),o=n-2;0<=o;--o){for(a=i=0,u=E[o+1],s=0;s<f[o];s++)a=d[o+1][u]+d[o+1][u+1],a>e[i]?(d[o][s]=a,c[o][s]=t,u+=2):(d[o][s]=e[i],c[o][s]=i,++i);E[o]=0,1===l[o]&&r(o)}return h}function h(e){var t,n,r,i,o=new(b?Uint16Array:Array)(e.length),s=[],a=[],u=0;for(t=0,n=e.length;t<n;t++)s[e[t]]=(0|s[e[t]])+1;for(t=1,n=16;t<=n;t++)a[t]=u,u+=0|s[t],u<<=1;for(t=0,n=e.length;t<n;t++)for(u=a[e[t]],a[e[t]]+=1,r=o[t]=0,i=e[t];r<i;r++)o[t]=o[t]<<1|1&u,u>>>=1;return o}function d(t,n){switch(this.l=[],this.m=32768,this.e=this.g=this.c=this.q=0,this.input=b?new Uint8Array(t):t,this.s=!1,this.n=M,this.C=!1,!n&&(n={})||(n.index&&(this.c=n.index),n.bufferSize&&(this.m=n.bufferSize),n.bufferType&&(this.n=n.bufferType),n.resize&&(this.C=n.resize)),this.n){case B:this.b=32768,this.a=new(b?Uint8Array:Array)(32768+this.m+258);break;case M:this.b=0,this.a=new(b?Uint8Array:Array)(this.m),this.f=this.K,this.t=this.I,this.o=this.J;break;default:e(Error("invalid inflate mode"))}}function c(t,n){for(var r,i=t.g,o=t.e,s=t.input,a=t.c,u=s.length;o<n;)a>=u&&e(Error("input buffer is broken")),i|=s[a++]<<o,o+=8;return r=i&(1<<n)-1,t.g=i>>>n,t.e=o-n,t.c=a,r}function E(e,t){for(var n,r,i=e.g,o=e.e,s=e.input,a=e.c,u=s.length,f=t[0],l=t[1];o<l&&!(a>=u);)i|=s[a++]<<o,o+=8;return n=f[i&(1<<l)-1],r=n>>>16,e.g=i>>r,e.e=o-r,e.c=a,65535&n}function _(e){function t(e,t,n){var r,i,o,s=this.z;for(o=0;o<e;)switch(r=E(this,t)){case 16:for(i=3+c(this,2);i--;)n[o++]=s;break;case 17:for(i=3+c(this,3);i--;)n[o++]=0;s=0;break;case 18:for(i=11+c(this,7);i--;)n[o++]=0;s=0;break;default:s=n[o++]=r}return this.z=s,n}var n,r,o,s,a=c(e,5)+257,u=c(e,5)+1,f=c(e,4)+4,l=new(b?Uint8Array:Array)(q.length);for(s=0;s<f;++s)l[q[s]]=c(e,3);if(!b)for(s=f,f=l.length;s<f;++s)l[q[s]]=0;n=i(l),r=new(b?Uint8Array:Array)(a),o=new(b?Uint8Array:Array)(u),e.z=0,e.o(i(t.call(e,a,n,r)),i(t.call(e,u,n,o)))}function p(e){if("string"==typeof e){var t,n,r=e.split("");for(t=0,n=r.length;t<n;t++)r[t]=(255&r[t].charCodeAt(0))>>>0;e=r}for(var i,o=1,s=0,a=e.length,u=0;0<a;){i=1024<a?1024:a,a-=i;do o+=e[u++],s+=o;while(--i);o%=65521,s%=65521}return(s<<16|o)>>>0}function g(t,n){var r,i;switch(this.input=t,this.c=0,!n&&(n={})||(n.index&&(this.c=n.index),n.verify&&(this.N=n.verify)),r=t[this.c++],i=t[this.c++],15&r){case re:this.method=re;break;default:e(Error("unsupported compression method"))}0!==((r<<8)+i)%31&&e(Error("invalid fcheck flag:"+((r<<8)+i)%31)),32&i&&e(Error("fdict flag is not supported")),this.B=new d(t,{index:this.c,bufferSize:n.bufferSize,bufferType:n.bufferType,resize:n.resize})}function R(e,t){this.input=e,this.a=new(b?Uint8Array:Array)(32768),this.h=ie.k;var n,r={};!t&&(t={})||"number"!=typeof t.compressionType||(this.h=t.compressionType);for(n in t)r[n]=t[n];r.outputBuffer=this.a,this.A=new o(this.input,r)}function y(e,n){var r,i,o,s;if(Object.keys)r=Object.keys(n);else for(i in r=[],o=0,n)r[o++]=i;for(o=0,s=r.length;o<s;++o)i=r[o],t(e+"."+i,n[i])}var T=void 0,C=!0,S=this,b="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array&&"undefined"!=typeof DataView;n.prototype.f=function(){var e,t=this.buffer,n=t.length,r=new(b?Uint8Array:Array)(n<<1);if(b)r.set(t);else for(e=0;e<n;++e)r[e]=t[e];return this.buffer=r},n.prototype.d=function(e,t,n){var r,i=this.buffer,o=this.index,s=this.i,a=i[o];if(n&&1<t&&(e=8<t?(A[255&e]<<24|A[e>>>8&255]<<16|A[e>>>16&255]<<8|A[e>>>24&255])>>32-t:A[e]>>8-t),8>t+s)a=a<<t|e,s+=t;else for(r=0;r<t;++r)a=a<<1|e>>t-r-1&1,8===++s&&(s=0,i[o++]=A[a],a=0,o===i.length&&(i=this.f()));i[o]=a,this.buffer=i,this.i=s,this.index=o},n.prototype.finish=function(){var e,t=this.buffer,n=this.index;return 0<this.i&&(t[n]<<=8-this.i,t[n]=A[t[n]],n++),b?e=t.subarray(0,n):(t.length=n,e=t),e};var v,I=new(b?Uint8Array:Array)(256);for(v=0;256>v;++v){for(var O=v,m=O,N=7,O=O>>>1;O;O>>>=1)m<<=1,m|=1&O,--N;I[v]=(m<<N&255)>>>0}var A=I;r.prototype.getParent=function(e){return 2*((e-2)/4|0)},r.prototype.push=function(e,t){var n,r,i,o=this.buffer;for(n=this.length,o[this.length++]=t,o[this.length++]=e;0<n&&(r=this.getParent(n),o[n]>o[r]);)i=o[n],o[n]=o[r],o[r]=i,i=o[n+1],o[n+1]=o[r+1],o[r+1]=i,n=r;return this.length},r.prototype.pop=function(){var e,t,n,r,i,o=this.buffer;for(t=o[0],e=o[1],this.length-=2,o[0]=o[this.length],o[1]=o[this.length+1],
+i=0;(r=2*i+2,!(r>=this.length))&&(r+2<this.length&&o[r+2]>o[r]&&(r+=2),o[r]>o[i]);)n=o[i],o[i]=o[r],o[r]=n,n=o[i+1],o[i+1]=o[r+1],o[r+1]=n,i=r;return{index:e,value:t,length:this.length}};var w,P=2,D={NONE:0,r:1,k:P,O:3},U=[];for(w=0;288>w;w++)switch(C){case 143>=w:U.push([w+48,8]);break;case 255>=w:U.push([w-144+400,9]);break;case 279>=w:U.push([w-256+0,7]);break;case 287>=w:U.push([w-280+192,8]);break;default:e("invalid literal: "+w)}o.prototype.j=function(){var t,r,i,o,s=this.input;switch(this.h){case 0:for(i=0,o=s.length;i<o;){r=b?s.subarray(i,i+65535):s.slice(i,i+65535),i+=r.length;var u=r,l=i===o,d=T,c=T,E=T,_=T,p=T,g=this.a,R=this.b;if(b){for(g=new Uint8Array(this.a.buffer);g.length<=R+u.length+5;)g=new Uint8Array(g.length<<1);g.set(this.a)}if(d=l?1:0,g[R++]=0|d,c=u.length,E=~c+65536&65535,g[R++]=255&c,g[R++]=c>>>8&255,g[R++]=255&E,g[R++]=E>>>8&255,b)g.set(u,R),R+=u.length,g=g.subarray(0,R);else{for(_=0,p=u.length;_<p;++_)g[R++]=u[_];g.length=R}this.b=R,this.a=g}break;case 1:var y=new n(b?new Uint8Array(this.a.buffer):this.a,this.b);y.d(1,1,C),y.d(1,2,C);var S,v,I,O=a(this,s);for(S=0,v=O.length;S<v;S++)if(I=O[S],n.prototype.d.apply(y,U[I]),256<I)y.d(O[++S],O[++S],C),y.d(O[++S],5),y.d(O[++S],O[++S],C);else if(256===I)break;this.a=y.finish(),this.b=this.a.length;break;case P:var m,N,A,w,D,L,k,B,M,G,H,F,x,q,j,V=new n(b?new Uint8Array(this.a.buffer):this.a,this.b),Y=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],J=Array(19);for(m=P,V.d(1,1,C),V.d(m,2,C),N=a(this,s),L=f(this.M,15),k=h(L),B=f(this.L,7),M=h(B),A=286;257<A&&0===L[A-1];A--);for(w=30;1<w&&0===B[w-1];w--);var W,Q,z,K,Z,$,X=A,ee=w,te=new(b?Uint32Array:Array)(X+ee),ne=new(b?Uint32Array:Array)(316),re=new(b?Uint8Array:Array)(19);for(W=Q=0;W<X;W++)te[Q++]=L[W];for(W=0;W<ee;W++)te[Q++]=B[W];if(!b)for(W=0,K=re.length;W<K;++W)re[W]=0;for(W=Z=0,K=te.length;W<K;W+=Q){for(Q=1;W+Q<K&&te[W+Q]===te[W];++Q);if(z=Q,0===te[W])if(3>z)for(;0<z--;)ne[Z++]=0,re[0]++;else for(;0<z;)$=138>z?z:138,$>z-3&&$<z&&($=z-3),10>=$?(ne[Z++]=17,ne[Z++]=$-3,re[17]++):(ne[Z++]=18,ne[Z++]=$-11,re[18]++),z-=$;else if(ne[Z++]=te[W],re[te[W]]++,z--,3>z)for(;0<z--;)ne[Z++]=te[W],re[te[W]]++;else for(;0<z;)$=6>z?z:6,$>z-3&&$<z&&($=z-3),ne[Z++]=16,ne[Z++]=$-3,re[16]++,z-=$}for(t=b?ne.subarray(0,Z):ne.slice(0,Z),G=f(re,7),q=0;19>q;q++)J[q]=G[Y[q]];for(D=19;4<D&&0===J[D-1];D--);for(H=h(G),V.d(A-257,5,C),V.d(w-1,5,C),V.d(D-4,4,C),q=0;q<D;q++)V.d(J[q],3,C);for(q=0,j=t.length;q<j;q++)if(F=t[q],V.d(H[F],G[F],C),16<=F){switch(q++,F){case 16:x=2;break;case 17:x=3;break;case 18:x=7;break;default:e("invalid code: "+F)}V.d(t[q],x,C)}var ie,oe,se,ae,ue,fe,le,he,de=[k,L],ce=[M,B];for(ue=de[0],fe=de[1],le=ce[0],he=ce[1],ie=0,oe=N.length;ie<oe;++ie)if(se=N[ie],V.d(ue[se],fe[se],C),256<se)V.d(N[++ie],N[++ie],C),ae=N[++ie],V.d(le[ae],he[ae],C),V.d(N[++ie],N[++ie],C);else if(256===se)break;this.a=V.finish(),this.b=this.a.length;break;default:e("invalid compression type")}return this.a};var L=function(){function t(t){switch(C){case 3===t:return[257,t-3,0];case 4===t:return[258,t-4,0];case 5===t:return[259,t-5,0];case 6===t:return[260,t-6,0];case 7===t:return[261,t-7,0];case 8===t:return[262,t-8,0];case 9===t:return[263,t-9,0];case 10===t:return[264,t-10,0];case 12>=t:return[265,t-11,1];case 14>=t:return[266,t-13,1];case 16>=t:return[267,t-15,1];case 18>=t:return[268,t-17,1];case 22>=t:return[269,t-19,2];case 26>=t:return[270,t-23,2];case 30>=t:return[271,t-27,2];case 34>=t:return[272,t-31,2];case 42>=t:return[273,t-35,3];case 50>=t:return[274,t-43,3];case 58>=t:return[275,t-51,3];case 66>=t:return[276,t-59,3];case 82>=t:return[277,t-67,4];case 98>=t:return[278,t-83,4];case 114>=t:return[279,t-99,4];case 130>=t:return[280,t-115,4];case 162>=t:return[281,t-131,5];case 194>=t:return[282,t-163,5];case 226>=t:return[283,t-195,5];case 257>=t:return[284,t-227,5];case 258===t:return[285,t-258,0];default:e("invalid length: "+t)}}var n,r,i=[];for(n=3;258>=n;n++)r=t(n),i[n]=r[2]<<24|r[1]<<16|r[0];return i}(),k=b?new Uint32Array(L):L,B=0,M=1,G={F:B,D:M};d.prototype.p=function(){for(;!this.s;){var t=c(this,3);switch(1&t&&(this.s=C),t>>>=1){case 0:var n=this.input,r=this.c,i=this.a,o=this.b,s=n.length,a=T,u=T,f=i.length,l=T;switch(this.e=this.g=0,r+1>=s&&e(Error("invalid uncompressed block header: LEN")),a=n[r++]|n[r++]<<8,r+1>=s&&e(Error("invalid uncompressed block header: NLEN")),u=n[r++]|n[r++]<<8,a===~u&&e(Error("invalid uncompressed block header: length verify")),r+a>n.length&&e(Error("input buffer is broken")),this.n){case B:for(;o+a>i.length;){if(l=f-o,a-=l,b)i.set(n.subarray(r,r+l),o),o+=l,r+=l;else for(;l--;)i[o++]=n[r++];this.b=o,i=this.f(),o=this.b}break;case M:for(;o+a>i.length;)i=this.f({v:2});break;default:e(Error("invalid inflate mode"))}if(b)i.set(n.subarray(r,r+a),o),o+=a,r+=a;else for(;a--;)i[o++]=n[r++];this.c=r,this.b=o,this.a=i;break;case 1:this.o(ee,ne);break;case 2:_(this);break;default:e(Error("unknown BTYPE: "+t))}}return this.t()};var H,F,x=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],q=b?new Uint16Array(x):x,j=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],V=b?new Uint16Array(j):j,Y=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],J=b?new Uint8Array(Y):Y,W=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Q=b?new Uint16Array(W):W,z=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],K=b?new Uint8Array(z):z,Z=new(b?Uint8Array:Array)(288);for(H=0,F=Z.length;H<F;++H)Z[H]=143>=H?8:255>=H?9:279>=H?7:8;var $,X,ee=i(Z),te=new(b?Uint8Array:Array)(30);for($=0,X=te.length;$<X;++$)te[$]=5;var ne=i(te);d.prototype.o=function(e,t){var n=this.a,r=this.b;this.u=e;for(var i,o,s,a,u=n.length-258;256!==(i=E(this,e));)if(256>i)r>=u&&(this.b=r,n=this.f(),r=this.b),n[r++]=i;else for(o=i-257,a=V[o],0<J[o]&&(a+=c(this,J[o])),i=E(this,t),s=Q[i],0<K[i]&&(s+=c(this,K[i])),r>=u&&(this.b=r,n=this.f(),r=this.b);a--;)n[r]=n[r++-s];for(;8<=this.e;)this.e-=8,this.c--;this.b=r},d.prototype.J=function(e,t){var n=this.a,r=this.b;this.u=e;for(var i,o,s,a,u=n.length;256!==(i=E(this,e));)if(256>i)r>=u&&(n=this.f(),u=n.length),n[r++]=i;else for(o=i-257,a=V[o],0<J[o]&&(a+=c(this,J[o])),i=E(this,t),s=Q[i],0<K[i]&&(s+=c(this,K[i])),r+a>u&&(n=this.f(),u=n.length);a--;)n[r]=n[r++-s];for(;8<=this.e;)this.e-=8,this.c--;this.b=r},d.prototype.f=function(){var e,t,n=new(b?Uint8Array:Array)(this.b-32768),r=this.b-32768,i=this.a;if(b)n.set(i.subarray(32768,n.length));else for(e=0,t=n.length;e<t;++e)n[e]=i[e+32768];if(this.l.push(n),this.q+=n.length,b)i.set(i.subarray(r,r+32768));else for(e=0;32768>e;++e)i[e]=i[r+e];return this.b=32768,i},d.prototype.K=function(e){var t,n,r,i,o=this.input.length/this.c+1|0,s=this.input,a=this.a;return e&&("number"==typeof e.v&&(o=e.v),"number"==typeof e.G&&(o+=e.G)),2>o?(n=(s.length-this.c)/this.u[2],i=258*(n/2)|0,r=i<a.length?a.length+i:a.length<<1):r=a.length*o,b?(t=new Uint8Array(r),t.set(a)):t=a,this.a=t},d.prototype.t=function(){var e,t,n,r,i,o=0,s=this.a,a=this.l,u=new(b?Uint8Array:Array)(this.q+(this.b-32768));if(0===a.length)return b?this.a.subarray(32768,this.b):this.a.slice(32768,this.b);for(t=0,n=a.length;t<n;++t)for(e=a[t],r=0,i=e.length;r<i;++r)u[o++]=e[r];for(t=32768,n=this.b;t<n;++t)u[o++]=s[t];return this.l=[],this.buffer=u},d.prototype.I=function(){var e,t=this.b;return b?this.C?(e=new Uint8Array(t),e.set(this.a.subarray(0,t))):e=this.a.subarray(0,t):(this.a.length>t&&(this.a.length=t),e=this.a),this.buffer=e},g.prototype.p=function(){var t,n,r=this.input;return t=this.B.p(),this.c=this.B.c,this.N&&(n=(r[this.c++]<<24|r[this.c++]<<16|r[this.c++]<<8|r[this.c++])>>>0,n!==p(t)&&e(Error("invalid adler-32 checksum"))),t};var re=8,ie=D;R.prototype.j=function(){var t,n,r,i,o,s,a,u=0;switch(a=this.a,t=re){case re:n=Math.LOG2E*Math.log(32768)-8;break;default:e(Error("invalid compression method"))}switch(r=n<<4|t,a[u++]=r,t){case re:switch(this.h){case ie.NONE:o=0;break;case ie.r:o=1;break;case ie.k:o=2;break;default:e(Error("unsupported compression type"))}break;default:e(Error("invalid compression method"))}return i=o<<6|0,a[u++]=i|31-(256*r+i)%31,s=p(this.input),this.A.b=u,a=this.A.j(),u=a.length,b&&(a=new Uint8Array(a.buffer),a.length<=u+4&&(this.a=new Uint8Array(a.length+4),this.a.set(a),a=this.a),a=a.subarray(0,u+4)),a[u++]=s>>24&255,a[u++]=s>>16&255,a[u++]=s>>8&255,a[u++]=255&s,a},t("Zlib.Inflate",g),t("Zlib.Inflate.prototype.decompress",g.prototype.p),y("Zlib.Inflate.BufferType",{ADAPTIVE:G.D,BLOCK:G.F}),t("Zlib.Deflate",R),t("Zlib.Deflate.compress",function(e,t){return new R(e,t).j()}),t("Zlib.Deflate.prototype.compress",R.prototype.j),y("Zlib.Deflate.CompressionType",{NONE:ie.NONE,FIXED:ie.r,DYNAMIC:ie.k})}).call(this)},function(e,t){},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(5),f=r(u),l=n(22),h=r(l),d=n(13),c=r(d),E=n(2),_=r(E),p=n(1),g=r(p),R=n(11),y=r(R),T=n(23),C=r(T),S=n(25),b=r(S),v=n(24),I=r(v),O=n(26),m=r(O),N=n(10),A=r(N),w=g.default.getLoger("MessageEntrance"),P={version:"v1.0.0",author:"3mang"},D={},U=void 0,L=void 0,k=void 0,B=void 0,M=void 0,G=void 0,H=void 0,F=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.info=P,D={},U=h.default,U.on("*",function(t,n){return e._emit(t,n)}),U.on(U.SUCCESS,e._h5SassSuccessHandler.bind(e)),L=c.default,L.on("*",function(t,n){return e._emit(t,n)}),L.on(_.default.CONFERENCE_JOIN_SUCCESS,e._conferenceJoinSuccessHandler.bind(e)),k=new y.default,k.on("*",function(t,n){return e._emit(t,n)}),k.on(_.default.DOC_SWITCH,e.docSwitchHandler.bind(e)),B=new C.default,B.on("*",function(t,n){return e._emit(t,n)}),M=new b.default,M.on("*",function(t,n){return e._emit(t,n)}),G=new I.default,G.on("*",function(t,n){return e._emit(t,n)}),G.on(_.default.DOC_UPDATE,e.docUpdateHandler.bind(e)),G.on(_.default.DOC_DEL,e.docDeleteHandler.bind(e)),H=new m.default,H.on("*",function(t,n){return e._emit(t,n)}),H.on(_.default.ANNO_UPDATE,e.annoUpdateHandler.bind(e)),e.on(_.default.DOC_SHOW,e.docShowHandler.bind(e)),e.sendChatMsg=e._sendChatMsg,e.joinClass=e._joinClass,e}return s(t,e),a(t,[{key:"_joinClass",value:function(e){return D=e||{},null===D||A.default.isEmptyObject(D)?void w.log("不能进入会议,传递的参数不对.",e):void(U&&U.sassChecking(e))}},{key:"leaveClass",value:function(){L&&L.leaveMCU()}},{key:"_h5SassSuccessHandler",value:function(){w.log("加入底层MCU会议."+D.toString()),L&&L.joinMCU(D)}},{key:"_conferenceJoinSuccessHandler",value:function(){U&&U.getClassDetail()}},{key:"conferenceHandler",value:function(e){var t={type:e,data:null};this._emit(t.type,t)}},{key:"_sendChatMsg",value:function(e,t){B&&B.sendChatMsg(e,t)}},{key:"annoUpdateHandler",value:function(e){var t=k.activeDocId,n=G.docList[t];n&&e.id==n.wbid&&this._emit(_.default.DOC_ANNO,e)}},{key:"docShowHandler",value:function(e){w.log("Doc Show ->"+e.id+"|"+e.curPageNo);var t=H.annoInfos[e.wbid];t?this._emit(_.default.DOC_ANNO,t):this._emit(_.default.DOC_ANNO)}},{key:"docSwitchHandler",value:function(){var e=k.activeDocId;w.log("Switch Doc Active -> "+e);var t=G.docList[e];t&&this._emit(_.default.DOC_SHOW,t)}},{key:"docUpdateHandler",value:function(e){w.log("Doc UpdateId ->"+e.id+"| activeDocId ->"+k.activeDocId),e.id==k.activeDocId&&this._emit(_.default.DOC_SHOW,e)}},{key:"docDeleteHandler",value:function(e){e.id==k.activeDocId&&this._emit(_.default.DOC_DEL,e)}}]),t}(f.default),x=F;t.default=x;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(w,"loger","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(P,"info","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(D,"confInfo","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(U,"sass","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(L,"mcu","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(k,"confer_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(B,"chat_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(M,"video_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(G,"doc_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(H,"wb_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(F,"MessageEntrance","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(x,"default","D:/work/McuClient/src/EngineEntrance.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f}Object.defineProperty(t,"__esModule",{value:!0}),t.MessageTypes=void 0,t.createMcuClient=i;var o=n(20),s=r(o),a=n(2),u=r(a),f=new s.default;t.MessageTypes=u.default;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(f,"MCU_CLIENT","D:/work/McuClient/src/McuClientEngine.js"),__REACT_HOT_LOADER__.register(i,"createMcuClient","D:/work/McuClient/src/McuClientEngine.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(5),f=r(u),l=n(1),h=r(l),d=n(2),c=r(d),E=h.default.getLoger("Sass"),_={},p=function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this))}return s(t,e),a(t,[{key:"sassChecking",value:function(e){return E.log("发起Sass校验",e),_=e,"true"===_.nopassword?this.sendPWDChecking():void this.sendMD5Checking()}},{key:"sendPWDChecking",value:function(){var e=this,t="http://"+_.portal+"/3m/getCheckMeetinig.do?siteId="+_.siteId+"&classId="+_.confId+"&password="+_.password;E.log("会议密码校验",t),fetch(t,{timeout:5e3}).then(function(t){if(200===t.status)return t.text();throw E.error("会议密码校验-网络异常.状态码:"+t.status),e._emit(c.default.NET_ERROR),""}).then(function(t){return"false"===t?(E.error("会议密码校验-失败."),e._emit(c.default.CONFERENCE_SHOW_WRONG_PASSWORD)):"true"===t?(E.log("会议密码校验-成功."),void e.sendMD5Checking()):(E.error("会议密码校验-协议异常."),void e._emit(c.default.PRO_ERROR))}).catch(function(t){E.error("会议密码校验-异常.状态码:"+t),e._emit(c.default.NET_ERROR)})}},{key:"sendMD5Checking",value:function(){var e=this,n="http://"+_.portal+"/3m/meeting/md5CheckMeeting.do?siteId="+_.siteId+"&meetingNumber="+_.confId+"&userId="+_.userId+"&userName="+_.userName+"&userType="+_.userType+"&nopassword="+_.nopassword+"&md5="+_.md5;E.log("H5SassMD5校验",n),fetch(n,{timeout:5e3}).then(function(t){if(200===t.status)return t.json();throw E.error("H5SassMD5校验-网络异常.状态码:"+t.status),e._emit(c.default.NET_ERROR),""}).then(function(n){if("true"==n.flag){if(n.h5_mcu_list){var r=n.h5_mcu_list.split(";")[0];_.MCUServerIP=r.split(":")[0],_.MCUServerPort=r.split(":")[1]}console.log(n),_.maxVideoChannels=n.maxVideoChannels,_.maxAudioChannels=n.maxAudioChannels,_.maxMediaChannels=_.maxVideoChannels+_.maxAudioChannels,E.log("H5Sass校验完成"),e._emit(t.SUCCESS)}else E.log("H5SassMD5校验-失败."),e._emit(c.default.CONFERENCE_JOIN_FAILED)}).catch(function(t){E.error("H5SassMD5校验-异常.状态码:"+t),e._emit(c.default.NET_ERROR),console.log("aaaaaaaaaaaaaaaaaaa")})}},{key:"getClassDetail",value:function(){var e=this,t="http://"+_.portal+"/3m/meeting/getClassH5.do?classNumber="+_.confId;E.log("H5Sass获取Class详情.",t),fetch(t,{timeout:5e3}).then(function(t){if(t.ok)return t.json();throw E.error("H5Sass获取Class详情-网络异常.状态码:"+t.status),e._emit(c.default.NET_ERROR),""}).then(function(t){0===t.errorCode?(E.log("H5Sass获取Class详情完成"),e._emit(c.default.CONFERENCE_SHOW_DETAIL,t)):(E.warn("H5Sass获取Class详情失败."),e._emit(c.default.NET_ERROR))}).catch(function(t){E.error("H5Sass获取Class详情异常.状态码:"+t),e._emit(c.default.NET_ERROR)})}}]),t}(f.default);p.prototype.SUCCESS=p.SUCCESS="h5sass.success";var g=new p;t.default=g;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(E,"loger","D:/work/McuClient/src/Sass.js"),__REACT_HOT_LOADER__.register(_,"confInfo","D:/work/McuClient/src/Sass.js"),__REACT_HOT_LOADER__.register(p,"Sass","D:/work/McuClient/src/Sass.js"),__REACT_HOT_LOADER__.register(g,"default","D:/work/McuClient/src/Sass.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(6),f=r(u),l=n(3),h=r(l),d=n(4),c=r(d),E=n(1),_=r(E),p=n(2),g=r(p),R=n(10),y=r(R),T=_.default.getLoger("ChatApe"),C=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.default.CHAT_SESSION_ID,h.default.CHAT_SESSION_NAME,h.default.CHAT_SESSION_TAG));return e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(c.default.RCPDU_REG_REGISTER_TABLE,h.default.CHAT_OBJ_TABLE_ID,h.default.CHAT_OBJ_TABLE_NAME,h.default.CHAT_OBJ_TABLE_TAG,0,new ArrayBuffer),e.on(c.default.RCPDU_CHAT_SEND_DATA_REQUEST,e.chatMsgIncomingHandler.bind(e)),e}return s(t,e),a(t,[{key:"chatMsgIncomingHandler",value:function(e){}},{key:"sendChatMsg",value:function(e,t){if(null===this._confInfo||y.default.isEmptyObject(this._confInfo))return void T.log("发送聊天消息.",e,t,"Engine 还未初始化数据!");T.log("发送聊天消息.",e,t);var n=new c.default.RCChatSendDataRequestPdu;n.type=c.default.RCPDU_CHAT_SEND_DATA_REQUEST,n.initiator=this._confInfo.nodeId,n.peer=e,n.isPublic=!0,n.userData=this._rCArrayBufferUtil.strToUint8Array("h5"+t),n.fromName=this._rCArrayBufferUtil.strToUint8Array("h5"+this._confInfo.userName),n.fromRole=this._confInfo.classRole,n.isPublic||0===n.peer?this.sendUniform(n):this.send(n)}},{key:"chatMsgIncomingHandler",value:function(e){var t=c.default.RCChatSendDataRequestPdu.decode(e),n={};n.fromNodeID=t.initiator,n.toNodeID=t.peer,n.message=this._rCArrayBufferUtil.uint8ArrayToStr(t.userData,2),n.fromName=this._rCArrayBufferUtil.uint8ArrayToStr(t.fromName,2),n.fromRole=t.fromRole,T.log("接受聊天消息.",n),this._emit(g.default.CHAT_RECEIVE,n)}}]),t}(f.default),S=C;t.default=S;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(T,"loger","D:/work/McuClient/src/apes/ChatApe.js"),__REACT_HOT_LOADER__.register(C,"ChatApe","D:/work/McuClient/src/apes/ChatApe.js"),__REACT_HOT_LOADER__.register(S,"default","D:/work/McuClient/src/apes/ChatApe.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(6),f=r(u),l=n(3),h=r(l),d=n(4),c=r(d),E=n(1),_=r(E),p=n(2),g=r(p),R=_.default.getLoger("DocApe"),y=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.default.DOCSHARING_SESSION_ID,h.default.DOCSHARING_SESSION_NAME,h.default.DOCSHARING_SESSION_TAG));return e.docList={},e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(c.default.RCPDU_REG_REGISTER_TABLE,h.default.DOCSHARING_OBJ_TABLE_ID_H5,h.default.DOCSHARING_OBJ_TABLE_NAME_H5,h.default.DOCSHARING_OBJ_TABLE_TAG_H5,0,new ArrayBuffer),e._apeDelayed=!0,e}return s(t,e),a(t,[{key:"tableInsertHandler",value:function(e,t,n){this.tableUpdateHandler(e,t,n)}},{key:"tableDeleteHandler",value:function(e,t){var n={};n.type=h.default.DOCUMENT_DEL,this._emit(g.default.DOC_DEL,n)}},{key:"tableUpdateHandler",value:function(e,t,n){try{var r=c.default.RCDocSendDataRequestPdu.decode(n);r.type=h.default.DOCUMENT_LOAD,r.ext=r.name.substr(r.name.indexOf(".")+1),r.wbid=(r.id<<10)+r.curPageNo,r.isPicture=~["bmp","png","gif","jpg","jpeg"].indexOf(r.ext),r.isPicture?(r.namePath=r.uri.substring(0,r.uri.lastIndexOf(".")),r.loadURL=r.namePath+"."+r.ext):(r.namePath=r.uri.substring(0,r.uri.lastIndexOf("/")),r.loadURL=r.namePath+"/"+r.curPageNo+".jpg"),this.docList[t]=r,this._emit(g.default.DOC_UPDATE,r),R.log("Doc update ->"+t)}catch(e){R.warn("Doc Table Update Decode包异常")}}}]),t}(f.default),T=y;t.default=T;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(R,"loger","D:/work/McuClient/src/apes/DocApe.js"),__REACT_HOT_LOADER__.register(y,"DocApe","D:/work/McuClient/src/apes/DocApe.js"),__REACT_HOT_LOADER__.register(T,"default","D:/work/McuClient/src/apes/DocApe.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(6),f=r(u),l=n(3),h=r(l),d=n(4),c=r(d),E=n(1),_=r(E),p=n(2),g=r(p),R=_.default.getLoger("VideoChat"),y=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.default.VIDEO_SESSION_ID,h.default.VIDEO_SESSION_NAME,h.default.VIDEO_SESSION_TAG));return e.videoChannels={},e.activeChannelId=0,e.activeURL="",e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(c.default.RCPDU_REG_REGISTER_TABLE,h.default.VIDEO_OBJ_TABLE_ID,h.default.VIDEO_OBJ_TABLE_NAME,h.default.VIDEO_OBJ_TABLE_TAG,0,new ArrayBuffer),e.on(c.default.RCPDU_VIDEO_SEND_DATA_REQUEST,e.videoIncomingHandler.bind(e)),e}return s(t,e),a(t,[{key:"videoIncomingHandler",value:function(e){var t=c.default.VideoSendDataRequestPdu.decode(e),n={};n._initiator=t.initiator,n._is_key_frame=t.keyFrame,n._sequence_id=t.sequenceId,n._slice_id=t.sliceId,n._data=t.userData,R.log("接受视频消息.",n),this._emit(g.default.VIDEO_SHOW,n)}},{key:"tableUpdateHandler",value:function(e,t,n){var r=c.default.RCVideoChannelInfoRecordPdu.decode(n);switch(r.owner=e,r.channelId=t,r.status=0===e?h.default.CGS_RELEASED:r.status,this.videoChannels[t]=r,r.status){case h.default.CGS_RELEASED:case h.default.CGS_PENDING:case h.default.CGS_GRABBING:this.activeChannelId===r.channelId&&(this.activeChannelId=0,this.activeURL="",this.emitVideoChange());break;case h.default.CGS_OPENNED:this.activeChannelId=r.channelId,"1"===this._confInfo.msType?this.activeURL="http://dazhi.3mang.com/live/"+this._confInfo.confId+"/"+this._confInfo.confId+"_"+r.channelId+"_flash_cam_mic_aac/playlist.m3u8":this.activeURL="http://hls.3mang.com/live/"+this._confInfo.confId+"_"+r.channelId+"_flash_cam_mic_aac/playlist.m3u8",this.emitVideoChange()}}},{key:"emitVideoChange",value:function(){this._emit(g.default.VIDEO_SHOW,{activeChannelId:this.activeChannelId,HLSURL:this.activeURL})}}]),t}(f.default),T=y;t.default=T;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(R,"loger","D:/work/McuClient/src/apes/VideoApe.js"),__REACT_HOT_LOADER__.register(y,"VideoChat","D:/work/McuClient/src/apes/VideoApe.js"),__REACT_HOT_LOADER__.register(T,"default","D:/work/McuClient/src/apes/VideoApe.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(6),f=r(u),l=n(3),h=r(l),d=n(4),c=r(d),E=n(1),_=r(E),p=n(2),g=r(p),R=n(18),y=n(17),T=r(y),C=_.default.getLoger("WhiteBoardApe"),S=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.default.WHITEBOARD_SESSION_ID,h.default.WHITEBOARD_SESSION_NAME,h.default.WHITEBOARD_SESSION_TAG));return e.annoInfos={},e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(c.default.RCPDU_REG_REGISTER_TABLE,h.default.WHITEBOARD_OBJ_TABLE_ID,h.default.WHITEBOARD_OBJ_TABLE_NAME,h.default.WHITEBOARD_OBJ_TABLE_TAG,0,new ArrayBuffer),e.on(c.default.RCPDU_CONFERENCE_SEND_DATA_REQUEST,e.whiteboardMsgComingHandler.bind(e)),e._apeDelayed=!0,e}return s(t,e),a(t,[{key:"whiteboardMsgComingHandler",value:function(e){C.warn("whiteboardMsgComingHandler needs to be handled.")}},{key:"tableInsertHandler",value:function(e,t){this.emitDocChange(h.default.DOCUMENT_DEL)}},{key:"tableUpdateHandler",value:function(e,t,n){var r=c.default.RCWhiteboardDataRequestPdu.decode(n);if(r.type==h.default.WBA_DOC_ANNOTATION){var i=new R.Zlib.Inflate(r.action.compact().view).decompress(),o={id:t,svg:T.default.getStringFromBytes(i)};this.annoInfos[t]=o,this._emit(g.default.ANNO_UPDATE,o)}else C.log("白板动作忽略,类型:",(0,h.default)(r.type))}}]),t}(f.default),b=S;t.default=b;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(C,"loger","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(S,"WhiteBoardApe","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(b,"default","D:/work/McuClient/src/apes/WhiteBoardApe.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=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),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(5),f=r(u),l=n(1),h=r(l),d=h.default.getLoger("EverSocket"),c=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._connected=!1,e._lastActiveTime=0,e._enableEverSocket=!1,e}return s(t,e),a(t,[{key:"begin",value:function(e,t){d.log("开始WebSocket应用."),this._enableEverSocket=!0,this.wsURL="ws://"+e+":"+t,this._newConnection()}},{key:"end",value:function(){d.log("停止WebSocket应用."),this._clear()}},{key:"send",value:function(e){this._connected?(d.log("SEND MESSAGE---->"),this.websocket.send(e)):d.warn("WebSocket未建立连接.消息忽略")}},{key:"_setConnected",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._connected=e,this._connected?this._emit(t.OPEN):this._emit(t.CLOSED)}},{key:"_newConnection",value:function(){this.websocket=new WebSocket(this.wsURL),this.websocket.binaryType="arraybuffer",this.websocket.onopen=this._onOpen.bind(this),this.websocket.onclose=this._onClose.bind(this),this.websocket.onerror=this._onError.bind(this),this.websocket.onmessage=this._onMessage.bind(this)}},{key:"_reConnection",value:function(){var e=this;this._clear(),this.reConnectionTimeout=window.setTimeout(function(){d.log("WebSocket重新建立."),window.clearTimeout(e.reConnectionTimeout),e._newConnection()},t.RECONN_INTERVAL)}},{key:"_clear",value:function(){d.log("WebSocket,Timers销毁"),window.clearInterval(this.pingTimer),window.clearInterval(this.pongTimer),this.websocket.onopen=void 0,this.websocket.onclose=void 0,this.websocket.onerror=void 0,this.websocket.onmessage=void 0;try{this.websocket.close()}catch(e){d.log("ignore errors")}this.websocket=void 0,this._enableEverSocket=!1,this._setConnected(!1)}},{key:"_onOpen",value:function(){d.log("WebSocket建立成功",this.wsURL),this._setConnected()}},{key:"_onClose",value:function(e){d.log("WebSocket连接断开 CODE:"+e.code+" REASON:"+e.reason+" CLEAN: "+e.wasClean,this.wsURL),
+this._reConnection()}},{key:"_onError",value:function(){d.log("WebSocket错误出现"),this._connected=!1,this._reConnection()}},{key:"_onMessage",value:function(e){d.log("<----RECEIVE MESSAGE"),this._lastActiveTime=Date.now();var n=e.data;n.byteLength>0&&this._emit(t.MESSAGE,n)}},{key:"_sendPingHandler",value:function(){this._connected?this.websocket.send(new ArrayBuffer):this._reConnection()}},{key:"_checkPongHandler",value:function(){var e=Date.now();this._lastActiveTime&&this._lastActiveTime>=e-t.PONG_INTERVAL&&this._lastActiveTime<=e||(d.warn("---服务器PINGPONG超时-----"),this._reConnection())}},{key:"connected",get:function(){return this._connected}}]),t}(f.default);c.prototype.PONG_INTERVAL=c.PONG_INTERVAL=5e3,c.prototype.PING_INTERVAL=c.PING_INTERVAL=3e3,c.prototype.RECONN_INTERVAL=c.RECONN_INTERVAL=2e3,c.prototype.CONNECTING=c.CONNECTING=0,c.prototype.OPEN=c.OPEN=1,c.prototype.CLOSING=c.CLOSING=2,c.prototype.CLOSED=c.CLOSED=3,c.prototype.MESSAGE=c.MESSAGE=4;var E=new c;t.default=E;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(d,"loger","D:/work/McuClient/src/everSocket.js"),__REACT_HOT_LOADER__.register(c,"EverSocket","D:/work/McuClient/src/everSocket.js"),__REACT_HOT_LOADER__.register(E,"default","D:/work/McuClient/src/everSocket.js"))})()},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n='\n//start\n// pdu_def.proto\n\n// syntax = "proto3";\n\noption optimize_for = LITE_RUNTIME;\nenum RCPduPriority_E {\n    DP_TOP = 0;\n    DP_HIGH = 1;\n    DP_MEDIUM = 2;\n    DP_LOW = 3;\n}\n\nenum RCPduSegment_E {\n    SEG_BEGIN = 0;\n    SEG_END = 1;\n    SEG_ONCE = 2;\n}\n\nenum RCPduTokenStatus_E {\n    TS_NOT_IN_USE = 0;\n    TS_SELF_GRABBED = 1;\n    TS_OTHER_GRABBED = 2;\n    TS_SELF_INHIBITED = 3;\n    TS_OTHER_INHIBITED = 4;\n    TS_SELF_RECIPIENT = 5;\n    TS_SELF_GIVING = 6;\n    TS_OTHER_GIVING = 7;\n}\n\nenum RCPduType_E {\n// GCC PDU\n    RCPDU_CONNECT_PROVIDER_REQUEST = 0;\n    RCPDU_CONNECT_PROVIDER_RESPONSE = 1;\n    RCPDU_CONFERENCE_JOIN_REQUEST = 2;\n    RCPDU_CONFERENCE_JOIN_RESPONSE = 3;\n    RCPDU_CONFERENCE_INVITE_REQUEST = 10;\n    RCPDU_CONFERENCE_INVITE_RESPONSE = 11;\n    RCPDU_CONFERENCE_LOCK_REQUEST = 20;\n    RCPDU_CONFERENCE_LOCK_RESPONSE = 21;\n    RCPDU_CONFERENCE_LOCK_INDICATION = 22;\n    RCPDU_CONFERENCE_UNLOCK_REQUEST = 30;\n    RCPDU_CONFERENCE_UNLOCK_RESPONSE = 31;\n    RCPDU_CONFERENCE_UNLOCK_INDICATION = 32;\n    RCPDU_CONFERENCE_LEAVE_REQUEST = 39;\n    RCPDU_CONFERENCE_TERMINATE_REQUEST = 40;\n    RCPDU_CONFERENCE_TERMINATE_RESPONSE = 41;\n    RCPDU_CONFERENCE_TERMINATE_INDICATION = 42;\n    RCPDU_CONFERENCE_EJECT_USER_REQUEST = 50;\n    RCPDU_CONFERENCE_EJECT_USER_RESPONSE = 51;\n    RCPDU_CONFERENCE_EJECT_USER_INDICATION = 52;\n    RCPDU_ROSTER_UPDATE_INDICATION = 60;\n    RCPDU_REGISTRY_UPDATE_REQUEST = 70; // INCLUDE ALL OBJS OPERATION\n    RCPDU_REGISTRY_UPDATE_RESPONSE = 71;\n    RCPDU_REGISTRY_UPDATE_INDICATION = 72;\n    RCPDU_FUNCTION_NOT_SUPPORTED_RESPONSE = 80;\n\n    // MCS PDU\n    RCPDU_SESSION_JOIN_REQUEST = 90;\n    RCPDU_SESSION_JOIN_RESPONSE = 91;\n    RCPDU_CHANNEL_GRAB_REQUEST = 100;\n    RCPDU_CHANNEL_GRAB_RESPONSE = 101;\n    RCPDU_CHANNEL_GRAB_INDICATION = 102;\n    RCPDU_CHANNEL_JOIN_REQUEST = 103;\n    RCPDU_CHANNEL_JOIN_RESPONSE = 104;\n    RCPDU_CHANNEL_LEAVE_REQUEST = 105;\n    RCPDU_CHANNEL_RELEASE_REQUEST = 106;\n    RCPDU_CHANNEL_RELEASE_INDICATION = 107;\n    RCPDU_SEND_DATA_REQUEST = 120;\n    RCPDU_SEND_DATA_INDICATION = 121;\n    RCPDU_UNIFORM_SEND_DATA_REQUEST = 125;\n    RCPDU_UNIFORM_SEND_DATA_INDICATION = 126;\n    RCPDU_TOKEN_GRAB_REQUEST = 130;\n    RCPDU_TOKEN_GRAB_CONFIRM = 131;\n    RCPDU_TOKEN_INHIBIT_REQUEST = 132;\n    RCPDU_TOKEN_INHIBIT_CONFIRM = 133;\n    RCPDU_TOKEN_GIVE_REQUEST = 134;\n    RCPDU_TOKEN_GIVE_INDICATION = 135;\n    RCPDU_TOKEN_GIVE_RESPONSE = 136;\n    RCPDU_TOKEN_GIVE_CONFIRM = 137;\n    RCPDU_TOKEN_PLEASE_REQUEST = 138;\n    RCPDU_TOKEN_PLEASE_INDICATION = 139;\n    RCPDU_TOKEN_RELEASE_REQUEST = 140;\n    RCPDU_TOKEN_RELEASE_CONFIRM = 141;\n    RCPDU_TOKEN_TEST_REQUEST = 142;\n    RCPDU_TOKEN_TEST_CONFIRM = 143;\n\n    // Registry PDU\n    RCPDU_REG_REGISTER_KEY = 200;\n    RCPDU_REG_UNREGISTER_KEY = 201;\n    RCPDU_REG_REGISTER_ROSTER = 202;\n    RCPDU_REG_REGISTER_TOKEN = 203;\n    RCPDU_REG_REGISTER_PARAMETER = 204;\n    RCPDU_REG_REGISTER_COUNTER = 205;\n    RCPDU_REG_REGISTER_TABLE = 206;\n    RCPDU_REG_REGISTER_CACHE = 207;\n    RCPDU_REG_REGISTER_OBJ = 208;\n    RCPDU_REG_UNREGISTER_OBJ = 209;\n    RCPDU_REG_UPDATE_OBJ = 210;\n    RCPDU_REG_ADAPTER = 211;\n    RCPDU_REG_CLEANUP_NODE = 212;\n    RCPDU_REG_REGISTER_QUEUE = 213;\n\n    // Registry Obj update PDU\n    RCPDU_REG_TABLE_INSERT_PDU = 230;\n    RCPDU_REG_TABLE_DELETE_PDU = 231;\n    RCPDU_REG_TABLE_UPDATE_PDU = 232;\n    RCPDU_REG_ROSTER_INSERT_PDU = 240;\n    RCPDU_REG_ROSTER_DELETE_PDU = 241;\n    RCPDU_REG_ROSTER_UPDATE_PDU = 242;\n    RCPDU_REG_PARAMETER_UPDATE_PDU = 250;\n    RCPDU_REG_QUEUE_INSERT_PDU = 255;\n    RCPDU_REG_QUEUE_DELETE_PDU = 256;\n    RCPDU_REG_QUEUE_UPDATE_PDU = 257;\n\n    // data\n    RCPDU_CONFERENCE_SEND_DATA_REQUEST = 259;\n    RCPDU_VIDEO_SEND_DATA_REQUEST = 260;\n    RCPDU_AUDIO_SEND_DATA_REQUEST = 261;\n    RCPDU_GIFT_SEND_DATA_REQUEST = 262;\n    RCPDU_CHAT_SEND_DATA_REQUEST = 263;\n    RCPDU_VOTING_POLL_RECORD = 265;\n\n    // Registry resource request or response PDU\n    RCPDU_REG_REQUEST_OBJ = 290;\n    RCPDU_REG_RESPONSE_OBJ = 291;\n    RCPDU_REG_COUNTER_REQUEST_PDU = 292;\n    RCPDU_REG_COUNTER_RESPONSE_PDU = 293;\n\n    // Index exchange\n    RCPDU_INDEX_ADAPTER = 300;\n    RCPDU_INDEX_SERVER_USERS = 301;\n    RCPDU_INDEX_CONFERENCE_USER_JOINED = 302;\n    RCPDU_INDEX_CONFERENCE_USER_EXITED = 303;\n    RCPDU_INDEX_CONFERENCE_USERS = 304;\n}\n\nenum RCPduNodeType_E {\n    NT_TERMINAL = 0;\n    NT_MULTIPORT_TERMINAL = 1;\n    NT_MCU = 2;\n}\n\nenum RCPduReason_E {\n    RSN_USERINITIATED = 0;\n    RSN_DISCONNECTED = 1;\n    RSN_SUPER_LEFT = 2;\n}\n\nenum RCPduResult_E {\n    RET_SUCCESS = 0;\n    RET_USER_REJECTED = 1;\n    RET_INVALID_CONFERENCE = 2;\n    RET_INVALID_PASSWORD = 3;\n    RET_INVALID_CONVENER_PASSWORD = 4;\n    RET_CHALLENGE_RESPONSE_REQUIRED = 5;\n    RET_INVALID_CHALLENGE_RESPONSE = 6;\n    RET_NO_CONNECTION = 7;\n    RET_FULL_CAPACITY = 8;\n}\n\nenum RCPduNodeCategory_E {\n    NC_CONVENTIONAL = 0;\n    NC_COUNTED = 1;\n    NC_ANONYMOUS = 2;\n}\n\nmessage RCConferenceDescriptorPdu {\n    required uint32 id = 1;\n    required bytes name = 2;\n    optional bytes description = 3;\n    //optional string net_address       = 4;\n    optional uint32 mode = 4;\n    optional string password = 5;\n    optional uint32 capacity = 6;\n    optional bytes user_data = 7;\n}\n\nmessage RCNodeRecordPdu {\n    required uint32 id = 1;\n    optional uint32 superior_node = 2;\n    required RCPduNodeType_E type = 3;\n    required string name = 4;\n    required uint32 capability = 5;\n    optional string net_address = 6;\n    optional RCPduNodeCategory_E category = 7;\n}\n\nmessage RCApplicationRecordPdu {\n    required uint32 id = 1; // session id\n    required string name = 2;\n    required string tag = 3;\n    repeated uint32 channel_ids = 4 [packed = true];\n    optional uint32 capability = 5;\n}\n\n//reg.proto\n\noption optimize_for = LITE_RUNTIME;\nmessage RCRegistryRegisterKeyPdu {\n    required RCPduType_E type = 1 [default = RCPDU_REG_REGISTER_KEY];\n    required uint32 id = 2;\n    required string name = 3;\n    required string tag = 4;\n    optional bytes user_data = 5;\n}\n\nmessage RCRegistryUnregisterKeyPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_UNREGISTER_KEY];\n    required uint32 key_id = 2;\n}\n\nmessage RCRegistryRegisterObjPdu {\n    optional RCPduType_E type = 1;\n    required uint32 obj_id = 2;\n    required string name = 3;\n    required string tag = 4;\n    optional uint32 owner = 5;\n    optional bytes user_data = 6;\n}\n\nmessage RCRegistryUnregisterObjPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_UNREGISTER_OBJ];\n    required uint32 obj_id = 2;\n}\n\nmessage RCRegistryUpdateObjPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_UPDATE_OBJ];\n    required RCPduType_E sub_type = 2;\n    required uint32 obj_id = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCAdapterItemPdu {\n    required RCPduType_E type = 1;\n    required bytes item_data = 2;\n}\n\n// adapter pdu that used to package a list of pdu.\nmessage RCAdapterPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_ADAPTER];\n    repeated RCAdapterItemPdu item = 2;\n}\n\n// table operation pdu\nmessage RCRegistryTableItemPdu {\n    required uint32 item_idx = 1;\n    required uint32 owner = 2;\n    required bytes item_data = 3;\n}\n\nmessage RCRegistryTableInsertItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_TABLE_INSERT_PDU];\n    repeated RCRegistryTableItemPdu items = 2;\n}\n\nmessage RCRegistryTableDeleteItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_TABLE_DELETE_PDU];\n    repeated uint32 item_idx = 2;\n}\n\nmessage RCRegistryTableUpdateItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_TABLE_UPDATE_PDU];\n    repeated RCRegistryTableItemPdu items = 2;\n}\n\n// roster operation pdu\nmessage RCRegistryRosterItemPdu {\n    required uint32 node_id = 1;\n    required bytes node_data = 2;\n}\n\nmessage RCRegistryRosterInsertItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_ROSTER_INSERT_PDU];\n    repeated RCRegistryRosterItemPdu items = 2;\n}\n\nmessage RCRegistryRosterDeleteItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_ROSTER_DELETE_PDU];\n    required uint32 node_id = 2;\n}\n\nmessage RCRegistryRosterUpdateItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_ROSTER_UPDATE_PDU];\n    repeated RCRegistryRosterItemPdu items = 2;\n}\n\n//message RCCleanupNodePdu\n//{\n//  optional RCPduType_E    type                = 1 [default = RCPDU_REG_CLEANUP_NODE];\n//  required uint32         node_id             = 2;\n//}\n\n// parameter operation pdu\nmessage RCRegistryParameterUpdatePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_PARAMETER_UPDATE_PDU];\n    required uint32 value = 2 [default = 0];\n    optional uint32 begin_bit = 3 [default = 31];\n    optional uint32 end_bit = 4;\n}\n\n// queue operation pdu\nmessage RCRegistryQueueItemPdu {\n    required uint32 owner = 1;\n    required uint32 item_id = 2;\n    optional bytes item_data = 3;\n    optional uint32 item_idx = 4;\n}\n\nmessage RCRegstryQueueInsertItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_QUEUE_INSERT_PDU];\n    repeated RCRegistryQueueItemPdu items = 2;\n}\n\nmessage RCRegistryQueueDeleteItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_QUEUE_DELETE_PDU];\n    required uint32 item_id = 2;\n}\n\nmessage RCRegistryQueueUpdateItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_QUEUE_UPDATE_PDU];\n    repeated RCRegistryQueueItemPdu items = 2;\n}\n\nmessage RCRegistryRequestObjPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_REQUEST_OBJ];\n    required RCPduType_E sub_type = 2;\n    required uint32 obj_id = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCRegistryResponseObjPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_RESPONSE_OBJ];\n    required RCPduType_E sub_type = 2;\n    required uint32 obj_id = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCRegistryCounterRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_COUNTER_REQUEST_PDU];\n    required uint32 count = 2;\n}\n\nmessage RCRegistryCounterResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_COUNTER_RESPONSE_PDU];\n    required uint32 start = 2;\n    required uint32 end = 3;\n}\n\n// mcs\noption optimize_for = LITE_RUNTIME;\n\n// Session management\nmessage RCSessionJoinRequestPdu {\n    required RCPduType_E type = 1 [default = RCPDU_SESSION_JOIN_REQUEST];\n    required uint32 id = 2;\n    required string name = 3;\n    required string tag = 4;\n    optional bytes session_data = 5; //聚合在一起的registry信息\n}\n\nmessage RCSessionJoinResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_SESSION_JOIN_RESPONSE];\n    required uint32 id = 2;\n    optional bytes response_data = 3;\n}\n\n// Channel management\nmessage RCChannelGrabRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_GRAB_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 channel_id = 3;\n}\n\nmessage RCChannelGrabResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_GRAB_RESPONSE];\n    required uint32 initiator = 2;\n    required uint32 requested_channel_id = 3;\n    required RCPduResult_E result = 4;\n    optional uint32 channel_id = 5;\n}\n\nmessage RCChannelGrabIndicationPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_GRAB_INDICATION];\n    required uint32 initiator = 2;\n    optional uint32 channel_id = 3;\n}\n\nmessage RCChannelJoinRequestPdu {\n    required RCPduType_E type = 1 [default = RCPDU_CHANNEL_JOIN_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 channel_id = 3;\n}\n\nmessage RCChannelJoinResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_JOIN_RESPONSE];\n    required uint32 initiator = 2;\n    required uint32 requested_channel_id = 3;\n    required RCPduResult_E result = 4;\n}\n\nmessage RCChannelLeaveRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_LEAVE_REQUEST];\n    required uint32 initiator = 2;\n    repeated uint32 channel_ids = 3 [packed = true];\n}\n\nmessage RCChannelReleaseRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_RELEASE_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 channel_id = 3;\n}\n\nmessage RCChannelReleaseIndicationPdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CHANNEL_RELEASE_INDICATION];\n    required uint32 initiator = 2;\n    required uint32 channel_id = 3;\n}\n\n// Data transfer\nmessage RCSendDataPdu {\n    required RCPduType_E type = 1 [default = RCPDU_SEND_DATA_REQUEST];\n    required RCPduType_E sub_type = 2;\n    required uint32 initiator = 3;\n    required uint32 conf_id = 4;\n    required uint32 session_id = 5;\n    required uint32 channel_id = 6;\n    required bool upward = 7;\n    required bool reliability = 8;\n    required RCPduPriority_E priority = 9;\n    required bytes data = 10;\n    optional uint32 peer = 11;\n    optional RCPduSegment_E seg = 12;\n    optional uint32 total_size = 13;\n    optional uint32 site_id = 14;\n    optional string user_id = 15;\n    optional string user_name = 16;\n    optional string user_role = 17;\n    optional string device_type = 18;\n    optional string site = 19;\n}\n\n//  Token management\nmessage RCTokenGrabRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GRAB_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenGrabConfirmPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GRAB_CONFIRM];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required RCPduResult_E result = 4;\n    required RCPduTokenStatus_E status = 5;\n}\n\nmessage RCTokenInhibitRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_INHIBIT_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenInhibitConfirmPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_INHIBIT_CONFIRM];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required RCPduResult_E result = 4;\n    required RCPduTokenStatus_E status = 5;\n}\n\nmessage RCTokenGiveRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GIVE_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required uint64 recipient = 4;\n}\n\nmessage RCTokenGiveIndicationPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GIVE_INDICATION];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required uint64 recipient = 4;\n}\n\nmessage RCTokenGiveResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GIVE_RESPONSE];\n    required uint32 token_id = 2;\n    required uint64 recipient = 3;\n    required RCPduResult_E result = 4;\n}\n\nmessage RCTokenGiveConfirmPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GIVE_CONFIRM];\n    required uint32 token_id = 2;\n    required uint64 recipient = 3;\n    required RCPduResult_E result = 4;\n    required RCPduTokenStatus_E status = 5;\n}\n\nmessage RCTokenPleaseRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_PLEASE_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenPleaseIndicationPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_PLEASE_INDICATION];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenReleaseRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_RELEASE_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenReleaseConfirmPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_TEST_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required RCPduResult_E result = 4;\n    required RCPduTokenStatus_E status = 5;\n}\n\nmessage RCTokenTestRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_TEST_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenTestConfirmPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_TEST_CONFIRM];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required RCPduTokenStatus_E status = 4;\n}\n\n//gcc.proto\n\noption optimize_for = LITE_RUNTIME;\nmessage RCConferenceJoinRequestPdu {\n    required RCPduType_E type = 1 [default = RCPDU_CONFERENCE_JOIN_REQUEST];\n    required uint32 initiator = 2;\n    required RCPduNodeType_E node_type = 3;\n    required RCConferenceDescriptorPdu conf_desc = 4;\n}\n\nmessage RCConferenceJoinResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_JOIN_RESPONSE];\n    required uint32 conf_id = 2;\n    required RCPduResult_E result = 3;\n    optional RCConferenceDescriptorPdu conf_desc = 4;\n}\n\nmessage RCConferenceInviteRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_INVITE_REQUEST];\n    required uint32 initiator = 2;\n    required RCConferenceDescriptorPdu conf_desc = 3;\n}\n\nmessage RCConferenceInviteResponsePdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_INVITE_RESPONSE];\n    required RCPduResult_E result = 2;\n    optional bytes user_data = 3;\n}\n\nmessage RCConferenceLockRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_LOCK_REQUEST];\n}\n\nmessage RCConferenceLockResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_LOCK_RESPONSE];\n    required RCPduResult_E result = 2;\n}\n\nmessage RCConferenceLockIndicationPdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_LOCK_INDICATION];\n}\n\nmessage RCConferenceUnlockRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_UNLOCK_REQUEST];\n}\n\nmessage RCConferenceUnlockResponsePdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_UNLOCK_RESPONSE];\n    required RCPduResult_E result = 2;\n}\n\nmessage RCConferenceUnlockIndicationPdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_UNLOCK_INDICATION];\n}\n\nmessage RCConferenceLeaveRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_LEAVE_REQUEST];\n    required RCPduReason_E reason = 2;\n}\n\nmessage RCConferenceTerminateRequestPdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_TERMINATE_REQUEST];\n    required RCPduReason_E reason = 2;\n}\n\nmessage RCConferenceTerminateResponsePdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_TERMINATE_RESPONSE];\n    required RCPduResult_E result = 2;\n}\n\nmessage RCConferenceTerminateIndicationPdu { // MCS_Uniform_Send_Data on GCC_Broadcast_Channel\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_TERMINATE_INDICATION];\n    required RCPduReason_E reason = 2;\n}\n\nmessage RCConferenceEjectUserRequestPdu { // MCS_Send_Data on Node ID Channel of Top GCC\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_EJECT_USER_REQUEST];\n    required uint32 ejected_node_id = 2;\n    required RCPduReason_E reason = 3;\n}\n\nmessage RCConferenceEjectUserResponsePdu { // MCS_Send_Data on Node ID Channel of requester\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_EJECT_USER_RESPONSE];\n    required uint32 ejected_node_id = 2;\n    required RCPduResult_E result = 3;\n}\n\nmessage RCConferenceEjectUserIndicationPdu { // MCS_Uniform_Send_Data on GCC_Broadcast_Channel\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_EJECT_USER_INDICATION];\n    required uint32 ejected_node_id = 2;\n    required RCPduReason_E reason = 3;\n}\n\nmessage RCRosterUpdateIndicationPdu { // MCS_Send_Data on Node ID Channel or\n// MCS_Uniform_Send_Data on GCC_Broadcast_Channel\n    optional RCPduType_E type = 1 [default = RCPDU_ROSTER_UPDATE_INDICATION];\n    required bool full_refresh = 2; // Conference Roster and all\n    repeated RCNodeRecordPdu node_record = 3;\n    repeated RCApplicationRecordPdu app_record = 4;\n}\n\nmessage RCRegistryUpdateRequestPdu { // MCS_Send_Data on Node ID Channel of Top GCC\n    optional RCPduType_E type = 1 [default = RCPDU_REGISTRY_UPDATE_REQUEST];\n    required uint32 key_id = 2;\n    required uint32 obj_id = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCRegistryUpdateIndicationPdu { // MCS_Send_Data on Node ID Channel of Top GCC\n    optional RCPduType_E type = 1 [default = RCPDU_REGISTRY_UPDATE_RESPONSE];\n    required uint32 key_id = 2;\n    required uint32 obj_id = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCRegistryUpdateResponsePdu { // MCS_Send_Data on Node ID Channel of requester\n    optional RCPduType_E type = 1 [default = RCPDU_REGISTRY_UPDATE_INDICATION];\n    required uint32 key_id = 2;\n    required uint32 obj_id = 3;\n    required RCPduResult_E result = 4;\n}\n\nmessage RCFunctionNotSupportedResponsePdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_FUNCTION_NOT_SUPPORTED_RESPONSE];\n    required uint32 request_pdu_id = 2;\n}\n\n//ape.proto\n\noption optimize_for = LITE_RUNTIME;\nmessage RCConferenceSendDataRequestPdu {\n    optional uint32 initiator = 1;\n    optional uint32 peer = 2;\n    required bool is_public = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCChatSendDataRequestPdu {\n    optional uint32 initiator = 1;\n    optional uint32 peer = 2;\n    required bool is_public = 3;\n    required bytes user_data = 4;\n    required uint32 from_role = 5;\n    required bytes from_name = 6;\n}\n\nmessage RCChatSendH5DataRequestPdu {\n    optional uint32 initiator = 1;\n    optional uint32 peer = 2;\n    required bool is_public = 3;\n    required string user_data = 4;\n    required string from_role = 5;\n    required string from_name = 6;\n}\n\nmessage RCDocSendDataRequestPdu {\n    required int32 id = 1;\n    required string doc_type = 2;\n    required string uri  = 3;\n    optional int32 owner = 4;\n    optional int32 from = 5;\n    optional string name = 6;\n    optional int32 cur_page_no = 7;\n    optional int32 cur_H = 8;\n    optional int32 cur_V = 9;\n    optional int32 scale = 10;\n    optional int32 page_num = 11;\n}\n\nmessage RCGiftSendDataRequestPdu {\n    optional uint32 initiator = 1;\n    required uint32 peer = 2;\n    required uint32 index = 3;\n    required uint32 num = 4;\n    optional bytes user_data = 5;\n}\n\nmessage RCAudioSendDataRequestPdu {\n    optional uint32 initiator = 1;\n    required bytes user_data = 2;\n}\n\nmessage RCVideoSendDataRequestPdu {\n    optional uint32 initiator = 1;\n    required bool key_frame = 2;\n    required uint32 sequence_id = 3;\n    required uint32 slice_id = 4;\n    required bytes user_data = 5;\n}\n\nmessage RCAudioChannelInfoRecordPdu {\n    required uint32 status = 1;\n    required uint32 device_id = 2;\n    required uint32 framerate = 3;\n    required uint32 bitrate = 4;\n    required uint32 codec = 5;\n}\n\nmessage RCVideoChannelInfoRecordPdu {\n    optional uint32 status = 1;\n    optional uint32 device_id = 2;\n    optional uint32 width = 3;\n    optional uint32 height = 4;\n    optional uint32 framerate = 5;\n    optional uint32 bitrate = 6;\n    optional uint32 codec = 7;\n    optional string peer_id = 8;\n    optional string url = 9;\n    optional uint32 type = 10;\n    optional string shamlive = 11;\n    optional uint32 livetype = 12;\n    optional uint32 releaseGrab = 13;\n    optional string curTime = 14;\n}\n\nmessage RCAudioDeviceInfoRecordPdu {\n    required uint32 device_id = 1;\n    required string device_name = 2;\n}\n\nmessage RCVideoDeviceInfoRecordPdu {\n    required uint32 device_id = 1;\n    required string device_name = 2;\n}\n\nmessage RCNodeInfoRecordPdu {\n    required uint32 node_id = 1;\n    required string name = 2;\n    required uint32 role = 3;\n    required uint32 level = 4;\n    repeated RCAudioDeviceInfoRecordPdu audio_records = 5;\n    repeated RCVideoDeviceInfoRecordPdu video_records = 6;\n    optional uint32 status = 7;\n    optional bytes user_data = 8;\n    optional string user_id = 9;\n    optional uint32 handUpTime = 10;\n    optional uint32 deviceType = 11;\n    optional uint32 mobileDirection = 12;\n}\n\nmessage RCVotingPollSettingsPdu {\n    required bool timer = 1;\n    optional uint32 time_limit = 2;\n    optional uint32 total_score = 3;\n}\n\nmessage RCVotingPollResultPdu {\n    required string title = 1;\n    required string content = 2;\n    optional uint32 score = 3;\n}\n\nmessage RCVotingPollQuestionPdu {\n    required uint32 index = 1;\n    required uint32 type = 2;\n    required string title = 3;\n    repeated string options = 4;\n    optional uint32 score = 5;\n    optional uint32 time_limit = 6;\n    optional string restrict_input = 7;\n    optional uint32 char_limit = 8;\n    optional string answer = 9;\n    repeated uint32 selections = 10;\n    repeated string responses = 11;\n}\n\nmessage RCVotingPollRecordPdu {\n    required RCVotingPollSettingsPdu settings = 1;\n    required string title = 2;\n    repeated RCVotingPollResultPdu results = 3;\n    repeated RCVotingPollQuestionPdu questions = 4;\n}\n\nmessage RCNodeInfoUserDataPdu {\n    optional string qq = 1;\n    optional string skype = 2;\n    optional string mobile = 3;\n}\n\nmessage RCWhiteboardDataRequestPdu {\n    required uint32 id = 1;\n    required uint32 type = 2;\n    required uint32 initiator = 3;\n    optional bytes action = 4;\n    optional uint32 uncomprLen = 5;\n}\n\nmessage RCTabUpdateDataRequestPdu {\n    optional uint32 id = 1;\n    optional bytes action = 2;\n    optional uint32 uncomprLen =3;\n}\n\n\n\n//end\n';t.default=n;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&__REACT_HOT_LOADER__.register(n,"default","D:/work/McuClient/src/pdu/pro.js")})()},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function o(e){if(h===clearTimeout)return clearTimeout(e);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(e);try{return h(e)}catch(t){try{return h.call(null,e)}catch(t){return h.call(this,e)}}}function s(){_&&c&&(_=!1,c.length?E=c.concat(E):p=-1,E.length&&a())}function a(){if(!_){var e=i(s);_=!0;for(var t=E.length;t;){for(c=E,E=[];++p<t;)c&&c[p].run();p=-1,t=E.length}c=null,_=!1,o(e)}}function u(e,t){this.fun=e,this.array=t}function f(){}var l,h,d=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{h="function"==typeof clearTimeout?clearTimeout:r}catch(e){h=r}}();var c,E=[],_=!1,p=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];E.push(new u(e,t)),1!==E.length||_||i(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=f,d.addListener=f,d.once=f,d.off=f,d.removeListener=f,d.removeAllListeners=f,d.emit=f,d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t){"use strict";function n(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function r(e){return 3*e.length/4-n(e)}function i(e){var t,r,i,o,s,a,u=e.length;s=n(e),a=new l(3*u/4-s),i=s>0?u-4:u;var h=0;for(t=0,r=0;t<i;t+=4,r+=3)o=f[e.charCodeAt(t)]<<18|f[e.charCodeAt(t+1)]<<12|f[e.charCodeAt(t+2)]<<6|f[e.charCodeAt(t+3)],a[h++]=o>>16&255,a[h++]=o>>8&255,a[h++]=255&o;return 2===s?(o=f[e.charCodeAt(t)]<<2|f[e.charCodeAt(t+1)]>>4,a[h++]=255&o):1===s&&(o=f[e.charCodeAt(t)]<<10|f[e.charCodeAt(t+1)]<<4|f[e.charCodeAt(t+2)]>>2,a[h++]=o>>8&255,a[h++]=255&o),a}function o(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function s(e,t,n){for(var r,i=[],s=t;s<n;s+=3)r=(e[s]<<16)+(e[s+1]<<8)+e[s+2],i.push(o(r));return i.join("")}function a(e){for(var t,n=e.length,r=n%3,i="",o=[],a=16383,f=0,l=n-r;f<l;f+=a)o.push(s(e,f,f+a>l?l:f+a));return 1===r?(t=e[n-1],i+=u[t>>2],i+=u[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=u[t>>10],i+=u[t>>4&63],i+=u[t<<2&63],i+="="),o.push(i),o.join("")}t.byteLength=r,t.toByteArray=i,t.fromByteArray=a;for(var u=[],f=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,c=h.length;d<c;++d)u[d]=h[d],f[h.charCodeAt(d)]=d;f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63},function(e,t,n){var r,i,o;(function(e,s){!function(e,a){n(9).amd?(i=[n(15)],r=a,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(s.exports=o))):"object"==typeof s&&s&&s.exports?s.exports=a(n(15),!0):(e.dcodeIO=e.dcodeIO||{}).ProtoBuf=a(e.dcodeIO.ByteBuffer)}(this,function(t,r){"use strict";var i={};return i.ByteBuffer=t,i.Long=t.Long||null,i.VERSION="5.0.1",i.WIRE_TYPES={},i.WIRE_TYPES.VARINT=0,i.WIRE_TYPES.BITS64=1,i.WIRE_TYPES.LDELIM=2,i.WIRE_TYPES.STARTGROUP=3,i.WIRE_TYPES.ENDGROUP=4,i.WIRE_TYPES.BITS32=5,i.PACKABLE_WIRE_TYPES=[i.WIRE_TYPES.VARINT,i.WIRE_TYPES.BITS64,i.WIRE_TYPES.BITS32],i.TYPES={int32:{name:"int32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.ZERO:void 0},uint64:{name:"uint64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.UZERO:void 0},sint64:{name:"sint64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.ZERO:void 0},bool:{name:"bool",wireType:i.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:i.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:i.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:i.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:i.WIRE_TYPES.BITS64,defaultValue:i.Long?i.Long.UZERO:void 0
+},sfixed64:{name:"sfixed64",wireType:i.WIRE_TYPES.BITS64,defaultValue:i.Long?i.Long.ZERO:void 0},float:{name:"float",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:i.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:i.WIRE_TYPES.STARTGROUP,defaultValue:null}},i.MAP_KEY_TYPES=[i.TYPES.int32,i.TYPES.sint32,i.TYPES.sfixed32,i.TYPES.uint32,i.TYPES.fixed32,i.TYPES.int64,i.TYPES.sint64,i.TYPES.sfixed64,i.TYPES.uint64,i.TYPES.fixed64,i.TYPES.bool,i.TYPES.string,i.TYPES.bytes],i.ID_MIN=1,i.ID_MAX=536870911,i.convertFieldsToCamelCase=!1,i.populateAccessors=!0,i.populateDefaults=!0,i.Util=function(){var t={};return t.IS_NODE=!("object"!=typeof e||e+""!="[object process]"||e.browser),t.XHR=function(){for(var e=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],t=null,n=0;n<e.length;n++){try{t=e[n]()}catch(e){continue}break}if(!t)throw Error("XMLHttpRequest is not supported");return t},t.fetch=function(e,r){if(r&&"function"!=typeof r&&(r=null),t.IS_NODE){var i=n(34);if(r)i.readFile(e,function(e,t){r(e?null:""+t)});else try{return i.readFileSync(e)}catch(e){return null}}else{var o=t.XHR();if(o.open("GET",e,!!r),o.setRequestHeader("Accept","text/plain"),"function"==typeof o.overrideMimeType&&o.overrideMimeType("text/plain"),!r)return o.send(null),200==o.status||0==o.status&&"string"==typeof o.responseText?o.responseText:null;if(o.onreadystatechange=function(){4==o.readyState&&r(200==o.status||0==o.status&&"string"==typeof o.responseText?o.responseText:null)},4==o.readyState)return;o.send(null)}},t.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,function(e,t){return t.toUpperCase()})},t}(),i.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},i.DotProto=function(e,t){function n(e,n){var r=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))r=parseInt(e);else if(t.NUMBER_HEX.test(e))r=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);r=parseInt(e.substring(1),8)}if(r=i*r|0,!n&&r<0)throw Error("illegal id value: "+(i<0?"-":"")+e);return r}function r(e){var n=1;if("-"==e.charAt(0)&&(n=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return n*parseInt(e,10);if(t.NUMBER_HEX.test(e))return n*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return n*parseInt(e.substring(1),8);if("inf"===e)return n*(1/0);if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return n*parseFloat(e);throw Error("illegal number value: "+(n<0?"-":"")+e)}function i(e,t,n){"undefined"==typeof e[t]?e[t]=n:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(n))}var o={},s=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},a=s.prototype;a._readString=function(){var e='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;e.lastIndex=this.index-1;var n=e.exec(this.source);if(!n)throw Error("unterminated string");return this.index=e.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,n[1]},a.next=function(){if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();var e,n,r;do{for(e=!1;t.WHITESPACE.test(r=this.source.charAt(this.index));)if("\n"===r&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(r=this.source.charAt(this.index)))return"/";do{if("\n"===r&&++this.line,++this.index===this.source.length)return null;n=r,r=this.source.charAt(this.index)}while("*"!==n||"/"!==r);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;var i=this.index;t.DELIM.lastIndex=0;var o=t.DELIM.test(this.source.charAt(i++));if(!o)for(;i<this.source.length&&!t.DELIM.test(this.source.charAt(i));)++i;var s=this.source.substring(this.index,this.index=i);return'"'!==s&&"'"!==s||(this._stringOpen=s),s},a.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},a.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},a.omit=function(e){return this.peek()===e&&(this.next(),!0)},a.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},o.Tokenizer=s;var u=function(e){this.tn=new s(e),this.proto3=!1},f=u.prototype;return f.parse=function(){var e,n,r={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},i=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!i||null!==r.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),r.package=e;break;case"import":if(!i)throw Error("unexpected 'import'");e=this.tn.peek(),("public"===e||(n="weak"===e))&&this.tn.next(),e=this._readString(),this.tn.skip(";"),n||r.imports.push(e);break;case"syntax":if(!i)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(r.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(r,null),i=!1;break;case"enum":this._parseEnum(r),i=!1;break;case"option":this._parseOption(r);break;case"service":this._parseService(r);break;case"extend":this._parseExtend(r);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete r.name,r},u.parse=function(e){return new u(e).parse()},f._readString=function(){var e,t,n="";do{if(t=this.tn.next(),"'"!==t&&'"'!==t)throw Error("illegal string delimiter: "+t);n+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return n},f._readValue=function(e){var n=this.tn.peek();if('"'===n||"'"===n)return this._readString();if(this.tn.next(),t.NUMBER.test(n))return r(n);if(t.BOOL.test(n))return"true"===n.toLowerCase();if(e&&t.TYPEREF.test(n))return n;throw Error("illegal value: "+n)},f._parseOption=function(e,n){var r=this.tn.next(),i=!1;if("("===r&&(i=!0,r=this.tn.next()),!t.TYPEREF.test(r))throw Error("illegal option name: "+r);var o=r;i&&(this.tn.skip(")"),o="("+o+")",r=this.tn.peek(),t.FQTYPEREF.test(r)&&(o+=r,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,o),n||this.tn.skip(";")},f._parseOptionValue=function(e,n){var r=this.tn.peek();if("{"!==r)i(e.options,n,this._readValue(!0));else for(this.tn.skip("{");"}"!==(r=this.tn.next());){if(!t.NAME.test(r))throw Error("illegal option name: "+n+"."+r);this.tn.omit(":")?i(e.options,n+"."+r,this._readValue(!0)):this._parseOptionValue(e,n+"."+r)}},f._parseService=function(e){var n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal service name at line "+this.tn.line+": "+n);var r=n,i={name:r,rpc:{},options:{}};for(this.tn.skip("{");"}"!==(n=this.tn.next());)if("option"===n)this._parseOption(i);else{if("rpc"!==n)throw Error("illegal service token: "+n);this._parseServiceRPC(i)}this.tn.omit(";"),e.services.push(i)},f._parseServiceRPC=function(e){var n="rpc",r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal rpc service method name: "+r);var i=r,o={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};if(this.tn.skip("("),r=this.tn.next(),"stream"===r.toLowerCase()&&(o.request_stream=!0,r=this.tn.next()),!t.TYPEREF.test(r))throw Error("illegal rpc service request type: "+r);if(o.request=r,this.tn.skip(")"),r=this.tn.next(),"returns"!==r.toLowerCase())throw Error("illegal rpc service request type delimiter: "+r);if(this.tn.skip("("),r=this.tn.next(),"stream"===r.toLowerCase()&&(o.response_stream=!0,r=this.tn.next()),o.response=r,this.tn.skip(")"),r=this.tn.peek(),"{"===r){for(this.tn.next();"}"!==(r=this.tn.next());){if("option"!==r)throw Error("illegal rpc service token: "+r);this._parseOption(o)}this.tn.omit(";")}else this.tn.skip(";");"undefined"==typeof e[n]&&(e[n]={}),e[n][i]=o},f._parseMessage=function(e,r){var i=!!r,o=this.tn.next(),s={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(o))throw Error("illegal "+(i?"group":"message")+" name: "+o);for(s.name=o,i&&(this.tn.skip("="),r.id=n(this.tn.next()),s.isGroup=!0),o=this.tn.peek(),"["===o&&r&&this._parseFieldOptions(r),this.tn.skip("{");"}"!==(o=this.tn.next());)if(t.RULE.test(o))this._parseMessageField(s,o);else if("oneof"===o)this._parseMessageOneOf(s);else if("enum"===o)this._parseEnum(s);else if("message"===o)this._parseMessage(s);else if("option"===o)this._parseOption(s);else if("service"===o)this._parseService(s);else if("extensions"===o)s.extensions=this._parseExtensionRanges();else if("reserved"===o)this._parseIgnored();else if("extend"===o)this._parseExtend(s);else{if(!t.TYPEREF.test(o))throw Error("illegal message token: "+o);if(!this.proto3)throw Error("illegal field rule: "+o);this._parseMessageField(s,"optional",o)}return this.tn.omit(";"),e.messages.push(s),s},f._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},f._parseMessageField=function(e,r,i){if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);var o,s={rule:r,type:"",name:"",options:{},id:0};if("map"===r){if(i)throw Error("illegal type: "+i);if(this.tn.skip("<"),o=this.tn.next(),!t.TYPE.test(o)&&!t.TYPEREF.test(o))throw Error("illegal message field type: "+o);if(s.keytype=o,this.tn.skip(","),o=this.tn.next(),!t.TYPE.test(o)&&!t.TYPEREF.test(o))throw Error("illegal message field: "+o);if(s.type=o,this.tn.skip(">"),o=this.tn.next(),!t.NAME.test(o))throw Error("illegal message field name: "+o);s.name=o,this.tn.skip("="),s.id=n(this.tn.next()),o=this.tn.peek(),"["===o&&this._parseFieldOptions(s),this.tn.skip(";")}else if(i="undefined"!=typeof i?i:this.tn.next(),"group"===i){var a=this._parseMessage(e,s);if(!/^[A-Z]/.test(a.name))throw Error("illegal group name: "+a.name);s.type=a.name,s.name=a.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(s.type=i,o=this.tn.next(),!t.NAME.test(o))throw Error("illegal message field name: "+o);s.name=o,this.tn.skip("="),s.id=n(this.tn.next()),o=this.tn.peek(),"["===o&&this._parseFieldOptions(s),this.tn.skip(";")}return e.fields.push(s),s},f._parseMessageOneOf=function(e){var n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal oneof name: "+n);var r,i=n,o=[];for(this.tn.skip("{");"}"!==(n=this.tn.next());)r=this._parseMessageField(e,"optional",n),r.oneof=i,o.push(r.id);this.tn.omit(";"),e.oneofs[i]=o},f._parseFieldOptions=function(e){this.tn.skip("[");for(var t,n=!0;"]"!==(t=this.tn.peek());)n||this.tn.skip(","),this._parseOption(e,!0),n=!1;this.tn.next()},f._parseEnum=function(e){var r={name:"",values:[],options:{}},i=this.tn.next();if(!t.NAME.test(i))throw Error("illegal name: "+i);for(r.name=i,this.tn.skip("{");"}"!==(i=this.tn.next());)if("option"===i)this._parseOption(r);else{if(!t.NAME.test(i))throw Error("illegal name: "+i);this.tn.skip("=");var o={name:i,id:n(this.tn.next(),!0)};i=this.tn.peek(),"["===i&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),r.values.push(o)}this.tn.omit(";"),e.enums.push(r)},f._parseExtensionRanges=function(){var t,n,i,o=[];do{for(n=[];;){switch(t=this.tn.next()){case"min":i=e.ID_MIN;break;case"max":i=e.ID_MAX;break;default:i=r(t)}if(n.push(i),2===n.length)break;if("to"!==this.tn.peek()){n.push(i);break}this.tn.next()}o.push(n)}while(this.tn.omit(","));return this.tn.skip(";"),o},f._parseExtend=function(e){var n=this.tn.next();if(!t.TYPEREF.test(n))throw Error("illegal extend reference: "+n);var r={ref:n,fields:[]};for(this.tn.skip("{");"}"!==(n=this.tn.next());)if(t.RULE.test(n))this._parseMessageField(r,n);else{if(!t.TYPEREF.test(n))throw Error("illegal extend token: "+n);if(!this.proto3)throw Error("illegal field rule: "+n);this._parseMessageField(r,"optional",n)}return this.tn.omit(";"),e.messages.push(r),r},f.toString=function(){return"Parser at line "+this.tn.line},o.Parser=u,o}(i,i.Lang),i.Reflect=function(e){function n(n){if("string"==typeof n&&(n=e.TYPES[n]),"undefined"==typeof n.defaultValue)throw Error("default value for type "+n.name+" is not supported");return n==e.TYPES.bytes?new t(0):n.defaultValue}function r(t,n){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low===t.low&&t.high===t.high)return new e.Long(t.low,t.high,"undefined"==typeof n?t.unsigned:n);if("string"==typeof t)return e.Long.fromString(t,n||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,n||!1);throw Error("not convertible to Long")}function i(t,n){var r=n.readVarint32(),o=7&r,s=r>>>3;switch(o){case e.WIRE_TYPES.VARINT:do r=n.readUint8();while(128===(128&r));break;case e.WIRE_TYPES.BITS64:n.offset+=8;break;case e.WIRE_TYPES.LDELIM:r=n.readVarint32(),n.offset+=r;break;case e.WIRE_TYPES.STARTGROUP:i(s,n);break;case e.WIRE_TYPES.ENDGROUP:if(s===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+s+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:n.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+o)}return!0}var o={},s=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},a=s.prototype;a.fqn=function(){for(var e=this.name,t=this;;){if(t=t.parent,null==t)break;e=t.name+"."+e}return e},a.toString=function(e){return(e?this.className+" ":"")+this.fqn()},a.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},o.T=s;var u=function(e,t,n,r,i){s.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=i||"proto2"},f=u.prototype=Object.create(s.prototype);f.getChildren=function(e){if(e=e||null,null==e)return this.children.slice();for(var t=[],n=0,r=this.children.length;n<r;++n)this.children[n]instanceof e&&t.push(this.children[n]);return t},f.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof d.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof d.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},f.getChild=function(e){for(var t="number"==typeof e?"id":"name",n=0,r=this.children.length;n<r;++n)if(this.children[n][t]===e)return this.children[n];return null},f.resolve=function(e,t){var n="string"==typeof e?e.split("."):e,r=this,i=0;if(""===n[i]){for(;null!==r.parent;)r=r.parent;i++}var s;do{do{if(!(r instanceof o.Namespace)){r=null;break}if(s=r.getChild(n[i]),!s||!(s instanceof o.T)||t&&!(s instanceof o.Namespace)){r=null;break}r=s,i++}while(i<n.length);if(null!=r)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=r);return r},f.qn=function(e){var t=[],n=e;do t.unshift(n.name),n=n.parent;while(null!==n);for(var r=1;r<=t.length;r++){var i=t.slice(t.length-r);if(e===this.resolve(i,e instanceof o.Namespace))return i.join(".")}return e.fqn()},f.build=function(){for(var e,t={},n=this.children,r=0,i=n.length;r<i;++r)e=n[r],e instanceof u&&(t[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(t,"$options",{value:this.buildOpt()}),t},f.buildOpt=function(){for(var e={},t=Object.keys(this.options),n=0,r=t.length;n<r;++n){var i=t[n],o=this.options[t[n]];e[i]=o}return e},f.getOption=function(e){return"undefined"==typeof e?this.options:"undefined"!=typeof this.options[e]?this.options[e]:null},o.Namespace=u;var l=function(t,n,r,i){if(this.type=t,this.resolvedType=n,this.isMapKey=r,this.syntax=i,r&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},h=l.prototype;l.defaultFieldValue=n,h.verifyValue=function(n){function i(e,t){throw Error("Illegal value for "+o.toString(!0)+" of type "+o.type.name+": "+e+" ("+t+")")}var o=this;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof n||n===n&&n%1!==0)&&i(typeof n,"not an integer"),n>4294967295?0|n:n;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof n||n===n&&n%1!==0)&&i(typeof n,"not an integer"),n<0?n>>>0:n;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return r(n,!1)}catch(e){i(typeof n,e.message)}else i(typeof n,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return r(n,!0)}catch(e){i(typeof n,e.message)}else i(typeof n,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof n&&i(typeof n,"not a boolean"),n;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof n&&i(typeof n,"not a number"),n;case e.TYPES.string:return"string"==typeof n||n&&n instanceof String||i(typeof n,"not a string"),""+n;case e.TYPES.bytes:return t.isByteBuffer(n)?n:t.wrap(n,"base64");case e.TYPES.enum:var s=this.resolvedType.getChildren(e.Reflect.Enum.Value);for(u=0;u<s.length;u++){if(s[u].name==n)return s[u].id;if(s[u].id==n)return s[u].id}if("proto3"===this.syntax)return("number"!=typeof n||n===n&&n%1!==0)&&i(typeof n,"not an integer"),(n>4294967295||n<0)&&i(typeof n,"not in range for uint32"),n;i(n,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(n&&"object"==typeof n||i(typeof n,"object expected"),n instanceof this.resolvedType.clazz)return n;if(n instanceof e.Builder.Message){var a={};for(var u in n)n.hasOwnProperty(u)&&(a[u]=n[u]);n=a}return new this.resolvedType.clazz(n)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+n+" (undefined type "+this.type+")")},h.calculateLength=function(n,r){if(null===r)return 0;var i;switch(this.type){case e.TYPES.int32:return r<0?t.calculateVarint64(r):t.calculateVarint32(r);case e.TYPES.uint32:return t.calculateVarint32(r);case e.TYPES.sint32:return t.calculateVarint32(t.zigZagEncode32(r));case e.TYPES.fixed32:case e.TYPES.sfixed32:case e.TYPES.float:return 4;case e.TYPES.int64:case e.TYPES.uint64:return t.calculateVarint64(r);case e.TYPES.sint64:return t.calculateVarint64(t.zigZagEncode64(r));case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES.enum:return t.calculateVarint32(r);case e.TYPES.double:return 8;case e.TYPES.string:return i=t.calculateUTF8Bytes(r),t.calculateVarint32(i)+i;case e.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");return t.calculateVarint32(r.remaining())+r.remaining();case e.TYPES.message:return i=this.resolvedType.calculate(r),t.calculateVarint32(i)+i;case e.TYPES.group:return i=this.resolvedType.calculate(r),i+t.calculateVarint32(n<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")},h.encodeValue=function(n,r,i){if(null===r)return i;switch(this.type){case e.TYPES.int32:r<0?i.writeVarint64(r):i.writeVarint32(r);break;case e.TYPES.uint32:i.writeVarint32(r);break;case e.TYPES.sint32:i.writeVarint32ZigZag(r);break;case e.TYPES.fixed32:i.writeUint32(r);break;case e.TYPES.sfixed32:i.writeInt32(r);break;case e.TYPES.int64:case e.TYPES.uint64:i.writeVarint64(r);break;case e.TYPES.sint64:i.writeVarint64ZigZag(r);break;case e.TYPES.fixed64:i.writeUint64(r);break;case e.TYPES.sfixed64:i.writeInt64(r);break;case e.TYPES.bool:"string"==typeof r?i.writeVarint32("false"===r.toLowerCase()?0:!!r):i.writeVarint32(r?1:0);break;case e.TYPES.enum:i.writeVarint32(r);break;case e.TYPES.float:i.writeFloat32(r);break;case e.TYPES.double:i.writeFloat64(r);break;case e.TYPES.string:i.writeVString(r);break;case e.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");var o=r.offset;i.writeVarint32(r.remaining()),i.append(r),r.offset=o;break;case e.TYPES.message:var s=(new t).LE();this.resolvedType.encode(r,s),i.writeVarint32(s.offset),i.append(s.flip());break;case e.TYPES.group:this.resolvedType.encode(r,i),i.writeVarint32(n<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")}return i},h.decode=function(t,n,r){if(n!=this.type.wireType)throw Error("Unexpected wire type for element");var i,o;switch(this.type){case e.TYPES.int32:return 0|t.readVarint32();case e.TYPES.uint32:return t.readVarint32()>>>0;case e.TYPES.sint32:return 0|t.readVarint32ZigZag();case e.TYPES.fixed32:return t.readUint32()>>>0;case e.TYPES.sfixed32:return 0|t.readInt32();case e.TYPES.int64:return t.readVarint64();case e.TYPES.uint64:return t.readVarint64().toUnsigned();case e.TYPES.sint64:return t.readVarint64ZigZag();case e.TYPES.fixed64:return t.readUint64();case e.TYPES.sfixed64:return t.readInt64();case e.TYPES.bool:return!!t.readVarint32();case e.TYPES.enum:return t.readVarint32();case e.TYPES.float:return t.readFloat();case e.TYPES.double:return t.readDouble();case e.TYPES.string:return t.readVString();case e.TYPES.bytes:if(o=t.readVarint32(),t.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+t.remaining());return i=t.clone(),i.limit=i.offset+o,t.offset+=o,i;case e.TYPES.message:return o=t.readVarint32(),this.resolvedType.decode(t,o);case e.TYPES.group:return this.resolvedType.decode(t,-1,r)}throw Error("[INTERNAL] Illegal decode type")},h.valueFromString=function(n){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(n));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(n);case e.TYPES.bool:return"true"===n;case e.TYPES.string:return this.verifyValue(n);case e.TYPES.bytes:return t.fromBinary(n)}},h.valueToString=function(t){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===e.TYPES.bytes?t.toString("binary"):t.toString()},o.Element=l;var d=function(e,t,n,r,i,o){u.call(this,e,t,n,r,o),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},c=d.prototype=Object.create(u.prototype);c.build=function(n){if(this.clazz&&!n)return this.clazz;var r=function(e,n){function r(n,i,o,s){if(null===n||"object"!=typeof n){if(s&&s instanceof e.Reflect.Enum){var a=e.Reflect.Enum.getName(s.object,n);if(null!==a)return a}return n}if(t.isByteBuffer(n))return i?n.toBase64():n.toBuffer();if(e.Long.isLong(n))return o?n.toString():e.Long.fromValue(n);var u;if(Array.isArray(n))return u=[],n.forEach(function(e,t){u[t]=r(e,i,o,s)}),u;if(u={},n instanceof e.Map){for(var f=n.entries(),l=f.next();!l.done;l=f.next())u[n.keyElem.valueToString(l.value[0])]=r(l.value[1],i,o,n.valueElem.resolvedType);return u}var h=n.$type,d=void 0;for(var c in n)n.hasOwnProperty(c)&&(h&&(d=h.getChild(c))?u[c]=r(n[c],i,o,d.resolvedType):u[c]=r(n[c],i,o));return u}var i=n.getChildren(e.Reflect.Message.Field),o=n.getChildren(e.Reflect.Message.OneOf),s=function(r,a){e.Builder.Message.call(this);for(var u=0,f=o.length;u<f;++u)this[o[u].name]=null;for(u=0,f=i.length;u<f;++u){var l=i[u];this[l.name]=l.repeated?[]:l.map?new e.Map(l):null,!l.required&&"proto3"!==n.syntax||null===l.defaultValue||(this[l.name]=l.defaultValue)}if(arguments.length>0){var h;if(1!==arguments.length||null===r||"object"!=typeof r||!("function"!=typeof r.encode||r instanceof s)||Array.isArray(r)||r instanceof e.Map||t.isByteBuffer(r)||r instanceof ArrayBuffer||e.Long&&r instanceof e.Long)for(u=0,f=arguments.length;u<f;++u)"undefined"!=typeof(h=arguments[u])&&this.$set(i[u].name,h);else this.$set(r)}},a=s.prototype=Object.create(e.Builder.Message.prototype);a.add=function(t,r,i){var o=n._fieldsByName[t];if(!i){if(!o)throw Error(this+"#"+t+" is undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+o.toString(!0));if(!o.repeated)throw Error(this+"#"+t+" is not a repeated field");r=o.verifyValue(r,!0)}return null===this[t]&&(this[t]=[]),this[t].push(r),this},a.$add=a.add,a.set=function(t,r,i){if(t&&"object"==typeof t){i=r;for(var o in t)t.hasOwnProperty(o)&&"undefined"!=typeof(r=t[o])&&this.$set(o,r,i);return this}var s=n._fieldsByName[t];if(i)this[t]=r;else{if(!s)throw Error(this+"#"+t+" is not a field: undefined");if(!(s instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+s.toString(!0));this[s.name]=r=s.verifyValue(r)}if(s&&s.oneof){var a=this[s.oneof.name];null!==r?(null!==a&&a!==s.name&&(this[a]=null),this[s.oneof.name]=s.name):a===t&&(this[s.oneof.name]=null)}return this},a.$set=a.set,a.get=function(t,r){if(r)return this[t];var i=n._fieldsByName[t];if(!(i&&i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: undefined");if(!(i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+i.toString(!0));return this[i.name]},a.$get=a.get;for(var u=0;u<i.length;u++){var f=i[u];f instanceof e.Reflect.Message.ExtensionField||n.builder.options.populateAccessors&&function(e){var t=e.originalName.replace(/(_[a-zA-Z])/g,function(e){return e.toUpperCase().replace("_","")});t=t.substring(0,1).toUpperCase()+t.substring(1);var r=e.originalName.replace(/([A-Z])/g,function(e){return"_"+e}),i=function(t,n){return this[e.name]=n?t:e.verifyValue(t),this},o=function(){return this[e.name]};null===n.getChild("set"+t)&&(a["set"+t]=i),null===n.getChild("set_"+r)&&(a["set_"+r]=i),null===n.getChild("get"+t)&&(a["get"+t]=o),null===n.getChild("get_"+r)&&(a["get_"+r]=o)}(f)}a.encode=function(e,r){"boolean"==typeof e&&(r=e,e=void 0);var i=!1;e||(e=new t,i=!0);var o=e.littleEndian;try{return n.encode(this,e.LE(),r),(i?e.flip():e).LE(o)}catch(t){throw e.LE(o),t}},s.encode=function(e,t,n){return new s(e).encode(t,n)},a.calculate=function(){return n.calculate(this)},a.encodeDelimited=function(e,r){var i=!1;e||(e=new t,i=!0);var o=(new t).LE();return n.encode(this,o,r).flip(),e.writeVarint32(o.remaining()),e.append(o),i?e.flip():e},a.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},a.toArrayBuffer=a.encodeAB,a.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},a.toBuffer=a.encodeNB,a.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},a.toBase64=a.encode64,a.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},a.toHex=a.encodeHex,a.toRaw=function(e,t){return r(this,!!e,!!t,this.$type)},a.encodeJSON=function(){return JSON.stringify(r(this,!0,!0,this.$type))},s.decode=function(e,r,i){"string"==typeof r&&(i=r,r=-1),"string"==typeof e&&(e=t.wrap(e,i?i:"base64")),e=t.isByteBuffer(e)?e:t.wrap(e);var o=e.littleEndian;try{var s=n.decode(e.LE());return e.LE(o),s}catch(t){throw e.LE(o),t}},s.decodeDelimited=function(e,r){if("string"==typeof e&&(e=t.wrap(e,r?r:"base64")),e=t.isByteBuffer(e)?e:t.wrap(e),e.remaining()<1)return null;var i=e.offset,o=e.readVarint32();if(e.remaining()<o)return e.offset=i,null;try{var s=n.decode(e.slice(e.offset,e.offset+o).LE());return e.offset+=o,s}catch(t){throw e.offset+=o,t}},s.decode64=function(e){return s.decode(e,"base64")},s.decodeHex=function(e){return s.decode(e,"hex")},s.decodeJSON=function(e){return new s(JSON.parse(e))},a.toString=function(){return n.toString()};return Object.defineProperty&&(Object.defineProperty(s,"$options",{value:n.buildOpt()}),Object.defineProperty(a,"$options",{value:s.$options}),Object.defineProperty(s,"$type",{value:n}),Object.defineProperty(a,"$type",{value:n})),s}(e,this);this._fields=[],this._fieldsById={},this._fieldsByName={};for(var i,o=0,s=this.children.length;o<s;o++)if(i=this.children[o],i instanceof R||i instanceof d||i instanceof S){if(r.hasOwnProperty(i.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+i.toString(!0)+" cannot override static property '"+i.name+"'");r[i.name]=i.build()}else if(i instanceof d.Field)i.build(),this._fields.push(i),this._fieldsById[i.id]=i,this._fieldsByName[i.name]=i;else if(!(i instanceof d.OneOf||i instanceof C))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[o].toString(!0));return this.clazz=r},c.encode=function(e,t,n){for(var r,i,o=null,s=0,a=this._fields.length;s<a;++s)r=this._fields[s],i=e[r.name],r.required&&null===i?null===o&&(o=r):r.encode(n?i:r.verifyValue(i),t,e);if(null!==o){var u=Error("Missing at least one required field for "+this.toString(!0)+": "+o);throw u.encoded=t,u}return t},c.calculate=function(e){for(var t,n,r=0,i=0,o=this._fields.length;i<o;++i){if(t=this._fields[i],n=e[t.name],t.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);r+=t.calculate(n,e)}return r},c.decode=function(t,n,r){n="number"==typeof n?n:-1;for(var o,s,a,u,f=t.offset,l=new this.clazz;t.offset<f+n||n===-1&&t.remaining()>0;){if(o=t.readVarint32(),s=7&o,a=o>>>3,s===e.WIRE_TYPES.ENDGROUP){if(a!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(r?r+" expected":"not a group")+")");break}if(u=this._fieldsById[a]){if(u.repeated&&!u.options.packed)l[u.name].push(u.decode(s,t));else if(u.map){var h=u.decode(s,t);l[u.name].set(h[0],h[1])}else if(l[u.name]=u.decode(s,t),u.oneof){var d=l[u.oneof.name];null!==d&&d!==u.name&&(l[d]=null),l[u.oneof.name]=u.name}}else switch(s){case e.WIRE_TYPES.VARINT:t.readVarint32();break;case e.WIRE_TYPES.BITS32:t.offset+=4;break;case e.WIRE_TYPES.BITS64:t.offset+=8;break;case e.WIRE_TYPES.LDELIM:var c=t.readVarint32();t.offset+=c;break;case e.WIRE_TYPES.STARTGROUP:for(;i(a,t););break;default:throw Error("Illegal wire type for unknown field "+a+" in "+this.toString(!0)+"#decode: "+s)}}for(var E=0,_=this._fields.length;E<_;++E)if(u=this._fields[E],null===l[u.name])if("proto3"===this.syntax)l[u.name]=u.defaultValue;else{if(u.required){var p=Error("Missing at least one required field for "+this.toString(!0)+": "+u.name);throw p.decoded=l,p}e.populateDefaults&&null!==u.defaultValue&&(l[u.name]=u.defaultValue)}return l},o.Message=d;var E=function(t,n,r,i,o,a,u,f,l,h){s.call(this,t,n,a),this.className="Message.Field",this.required="required"===r,this.repeated="repeated"===r,this.map="map"===r,this.keyType=i||null,this.type=o,this.resolvedType=null,this.id=u,this.options=f||{},this.defaultValue=null,this.oneof=l||null,this.syntax=h||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof d.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},_=E.prototype=Object.create(s.prototype);_.build=function(){this.element=new l(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new l(this.keyType,void 0,!0,this.syntax)),"proto3"!==this.syntax||this.repeated||this.map?"undefined"!=typeof this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=l.defaultFieldValue(this.type);
+},_.verifyValue=function(t,n){function r(e,t){throw Error("Illegal value for "+i.toString(!0)+" of type "+i.type.name+": "+e+" ("+t+")")}n=n||!1;var i=this;if(null===t)return this.required&&r(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&r(typeof t,"proto3 field without field presence cannot be null"),null;var o;if(this.repeated&&!n){Array.isArray(t)||(t=[t]);var s=[];for(o=0;o<t.length;o++)s.push(this.element.verifyValue(t[o]));return s}return this.map&&!n?t instanceof e.Map?t:(t instanceof Object||r(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&r(typeof t,"no array expected"),this.element.verifyValue(t))},_.hasWirePresence=function(t,n){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&n[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},_.encode=function(n,r,i){if(null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===n||this.repeated&&0==n.length)return r;try{if(this.repeated){var o;if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){r.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r.ensureCapacity(r.offset+=1);var s=r.offset;for(o=0;o<n.length;o++)this.element.encodeValue(this.id,n[o],r);var a=r.offset-s,u=t.calculateVarint32(a);if(u>1){var f=r.slice(s,r.offset);s+=u-1,r.offset=s,r.append(f)}r.writeVarint32(a,s-u)}else for(o=0;o<n.length;o++)r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,n[o],r)}else this.map?n.forEach(function(n,i,o){var s=t.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,i)+t.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,n);r.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r.writeVarint32(s),r.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,i,r),r.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,n,r)},this):this.hasWirePresence(n,i)&&(r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,n,r))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+n+" ("+e+")")}return r},_.calculate=function(n,r){if(n=this.verifyValue(n),null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===n||this.repeated&&0==n.length)return 0;var i=0;try{if(this.repeated){var o,s;if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(i+=t.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),s=0,o=0;o<n.length;o++)s+=this.element.calculateLength(this.id,n[o]);i+=t.calculateVarint32(s),i+=s}else for(o=0;o<n.length;o++)i+=t.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,n[o])}else this.map?n.forEach(function(n,r,o){var s=t.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,r)+t.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,n);i+=t.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i+=t.calculateVarint32(s),i+=s},this):this.hasWirePresence(n,r)&&(i+=t.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,n))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+n+" ("+e+")")}return i},_.decode=function(t,n,r){var i,o,s=!this.map&&t==this.type.wireType||!r&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM;if(!s)throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!r){o=n.readVarint32(),o=n.offset+o;for(var a=[];n.offset<o;)a.push(this.decode(this.type.wireType,n,!0));return a}if(this.map){var u=l.defaultFieldValue(this.keyType);if(i=l.defaultFieldValue(this.type),o=n.readVarint32(),n.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+n.remaining());var f=n.clone();for(f.limit=f.offset+o,n.offset+=o;f.remaining()>0;){var h=f.readVarint32();t=7&h;var d=h>>>3;if(1===d)u=this.keyElement.decode(f,t,d);else{if(2!==d)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(f,t,d)}}return[u,i]}return this.element.decode(n,t,this.id)},o.Message.Field=E;var p=function(e,t,n,r,i,o,s){E.call(this,e,t,n,null,r,i,o,s),this.extension};p.prototype=Object.create(E.prototype),o.Message.ExtensionField=p;var g=function(e,t,n){s.call(this,e,t,n),this.fields=[]};o.Message.OneOf=g;var R=function(e,t,n,r,i){u.call(this,e,t,n,r,i),this.className="Enum",this.object=null};R.getName=function(e,t){for(var n,r=Object.keys(e),i=0;i<r.length;++i)if(e[n=r[i]]===t)return n;return null};var y=R.prototype=Object.create(u.prototype);y.build=function(t){if(this.object&&!t)return this.object;for(var n=new e.Builder.Enum,r=this.getChildren(R.Value),i=0,o=r.length;i<o;++i)n[r[i].name]=r[i].id;return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=n},o.Enum=R;var T=function(e,t,n,r){s.call(this,e,t,n),this.className="Enum.Value",this.id=r};T.prototype=Object.create(s.prototype),o.Enum.Value=T;var C=function(e,t,n,r){s.call(this,e,t,n),this.field=r};C.prototype=Object.create(s.prototype),o.Extension=C;var S=function(e,t,n,r){u.call(this,e,t,n,r),this.className="Service",this.clazz=null},b=S.prototype=Object.create(u.prototype);b.build=function(n){return this.clazz&&!n?this.clazz:this.clazz=function(e,n){for(var r=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,n){setTimeout(n.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},i=r.prototype=Object.create(e.Builder.Service.prototype),o=n.getChildren(e.Reflect.Service.RPCMethod),s=0;s<o.length;s++)!function(e){i[e.name]=function(r,i){try{try{r=e.resolvedRequestType.clazz.decode(t.wrap(r))}catch(e){if(!(e instanceof TypeError))throw e}if(null===r||"object"!=typeof r)throw Error("Illegal arguments");r instanceof e.resolvedRequestType.clazz||(r=new e.resolvedRequestType.clazz(r)),this.rpcImpl(e.fqn(),r,function(t,r){if(t)return void i(t);null===r&&(r="");try{r=e.resolvedResponseType.clazz.decode(r)}catch(e){}return r&&r instanceof e.resolvedResponseType.clazz?void i(null,r):void i(Error("Illegal response type received in service method "+n.name+"#"+e.name))})}catch(e){setTimeout(i.bind(this,e),0)}},r[e.name]=function(t,n,i){new r(t)[e.name](n,i)},Object.defineProperty&&(Object.defineProperty(r[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(i[e.name],"$options",{value:r[e.name].$options}))}(o[s]);return Object.defineProperty&&(Object.defineProperty(r,"$options",{value:n.buildOpt()}),Object.defineProperty(i,"$options",{value:r.$options}),Object.defineProperty(r,"$type",{value:n}),Object.defineProperty(i,"$type",{value:n})),r}(e,this)},o.Service=S;var v=function(e,t,n,r){s.call(this,e,t,n),this.className="Service.Method",this.options=r||{}},I=v.prototype=Object.create(s.prototype);I.buildOpt=f.buildOpt,o.Service.Method=v;var O=function(e,t,n,r,i,o,s,a){v.call(this,e,t,n,a),this.className="Service.RPCMethod",this.requestName=r,this.responseName=i,this.requestStream=o,this.responseStream=s,this.resolvedRequestType=null,this.resolvedResponseType=null};return O.prototype=Object.create(v.prototype),o.Service.RPCMethod=O,o}(i),i.Builder=function(e,t,r){function i(e){e.messages&&e.messages.forEach(function(t){t.syntax=e.syntax,i(t)}),e.enums&&e.enums.forEach(function(t){t.syntax=e.syntax})}var o=function(e){this.ns=new r.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},s=o.prototype;return o.isMessage=function(e){return"string"==typeof e.name&&("undefined"==typeof e.values&&"undefined"==typeof e.rpc)},o.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&"undefined"!=typeof e.id},o.isEnum=function(e){return"string"==typeof e.name&&!("undefined"==typeof e.values||!Array.isArray(e.values)||0===e.values.length)},o.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},o.isExtend=function(e){return"string"==typeof e.ref},s.reset=function(){return this.ptr=this.ns,this},s.define=function(e){if("string"!=typeof e||!t.TYPEREF.test(e))throw Error("illegal namespace: "+e);return e.split(".").forEach(function(e){var t=this.ptr.getChild(e);null===t&&this.ptr.addChild(t=new r.Namespace(this,this.ptr,e)),this.ptr=t},this),this},s.create=function(t){if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(var n=[t];n.length>0;){if(t=n.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){var i=t.shift();if(o.isMessage(i)){var s=new r.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax),a={};i.oneofs&&Object.keys(i.oneofs).forEach(function(e){s.addChild(a[e]=new r.Message.OneOf(this,s,e))},this),i.fields&&i.fields.forEach(function(e){if(null!==s.getChild(0|e.id))throw Error("duplicate or invalid field id in "+s.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+s.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=a[e.oneof]))throw Error("illegal oneof in "+s.name+"#"+e.name+": "+e.oneof);e=new r.Message.Field(this,s,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),t&&t.fields.push(e),s.addChild(e)},this);var u=[];if(i.enums&&i.enums.forEach(function(e){u.push(e)}),i.messages&&i.messages.forEach(function(e){u.push(e)}),i.services&&i.services.forEach(function(e){u.push(e)}),i.extensions&&("number"==typeof i.extensions[0]?s.extensions=[i.extensions]:s.extensions=i.extensions),this.ptr.addChild(s),u.length>0){n.push(t),t=u,u=null,this.ptr=s,s=null;continue}u=null}else if(o.isEnum(i))s=new r.Enum(this,this.ptr,i.name,i.options,i.syntax),i.values.forEach(function(e){s.addChild(new r.Enum.Value(this,s,e.name,e.id))},this),this.ptr.addChild(s);else if(o.isService(i))s=new r.Service(this,this.ptr,i.name,i.options),Object.keys(i.rpc).forEach(function(e){var t=i.rpc[e];s.addChild(new r.Service.RPCMethod(this,s,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))},this),this.ptr.addChild(s);else{if(!o.isExtend(i))throw Error("not a valid definition: "+JSON.stringify(i));if(s=this.ptr.resolve(i.ref,!0))i.fields.forEach(function(t){if(null!==s.getChild(0|t.id))throw Error("duplicate extended field id in "+s.name+": "+t.id);if(s.extensions){var n=!1;if(s.extensions.forEach(function(e){t.id>=e[0]&&t.id<=e[1]&&(n=!0)}),!n)throw Error("illegal extended field id in "+s.name+": "+t.id+" (not within valid ranges)")}var i=t.name;this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i));var o=new r.Message.ExtensionField(this,s,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),a=new r.Extension(this,this.ptr,t.name,o);o.extension=a,this.ptr.addChild(a),s.addChild(o)},this);else if(!/\.?google\.protobuf\./.test(i.ref))throw Error("extended message "+i.ref+" is not defined")}i=null,s=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},s.import=function(t,r){var o="/";if("string"==typeof r){if(e.Util.IS_NODE&&(r=n(19).resolve(r)),this.files[r]===!0)return this.reset();this.files[r]=!0}else if("object"==typeof r){var s=r.root;e.Util.IS_NODE&&(s=n(19).resolve(s)),(s.indexOf("\\")>=0||r.file.indexOf("\\")>=0)&&(o="\\");var a=s+o+r.file;if(this.files[a]===!0)return this.reset();this.files[a]=!0}if(t.imports&&t.imports.length>0){var u,f=!1;"object"==typeof r?(this.importRoot=r.root,f=!0,u=this.importRoot,r=r.file,(u.indexOf("\\")>=0||r.indexOf("\\")>=0)&&(o="\\")):"string"==typeof r?this.importRoot?u=this.importRoot:r.indexOf("/")>=0?(u=r.replace(/\/[^\/]*$/,""),""===u&&(u="/")):r.indexOf("\\")>=0?(u=r.replace(/\\[^\\]*$/,""),o="\\"):u=".":u=null;for(var l=0;l<t.imports.length;l++)if("string"==typeof t.imports[l]){if(!u)throw Error("cannot determine import root");var h=t.imports[l];if("google/protobuf/descriptor.proto"===h)continue;if(h=u+o+h,this.files[h]===!0)continue;/\.proto$/i.test(h)&&!e.DotProto&&(h=h.replace(/\.proto$/,".json"));var d=e.Util.fetch(h);if(null===d)throw Error("failed to import '"+h+"' in '"+r+"': file not found");/\.json$/i.test(h)?this.import(JSON.parse(d+""),h):this.import(e.DotProto.Parser.parse(d),h)}else r?/\.(\w+)$/.test(r)?this.import(t.imports[l],r.replace(/^(.+)\.(\w+)$/,function(e,t,n){return t+"_import"+l+"."+n})):this.import(t.imports[l],r+"_import"+l):this.import(t.imports[l]);f&&(this.importRoot=null)}t.package&&this.define(t.package),t.syntax&&i(t);var c=this.ptr;return t.options&&Object.keys(t.options).forEach(function(e){c.options[e]=t.options[e]}),t.messages&&(this.create(t.messages),this.ptr=c),t.enums&&(this.create(t.enums),this.ptr=c),t.services&&(this.create(t.services),this.ptr=c),t.extends&&this.create(t.extends),this.reset()},s.resolveAll=function(){var n;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof r.Namespace)this.ptr.children.forEach(function(e){this.ptr=e,this.resolveAll()},this);else if(this.ptr instanceof r.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(n=(this.ptr instanceof r.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0),!n)throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=n,n instanceof r.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==n.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(n instanceof r.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=n.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(n=this.ptr.parent.resolve(this.ptr.requestName,!0),!(n&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=n,n=this.ptr.parent.resolve(this.ptr.responseName,!0),!(n&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=n}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},s.build=function(e){if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(var t="string"==typeof e?e.split("."):e,n=this.result,r=0;r<t.length;r++){if(!n[t[r]]){n=null;break}n=n[t[r]]}return n},s.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},s.toString=function(){return"Builder"},o.Message=function(){},o.Enum=function(){},o.Service=function(){},o}(i,i.Lang,i.Reflect),i.Map=function(e,t){function n(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}var r=function(e,n){if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new t.Element(e.keyType,null,!0,e.syntax),this.valueElem=new t.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),n)for(var r=Object.keys(n),i=0;i<r.length;i++){var o=this.keyElem.valueFromString(r[i]),s=this.valueElem.verifyValue(n[r[i]]);this.map[this.keyElem.valueToString(o)]={key:o,value:s}}},i=r.prototype;return i.clear=function(){this.map={}},i.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),n=t in this.map;return delete this.map[t],n},i.entries=function(){for(var e,t=[],r=Object.keys(this.map),i=0;i<r.length;i++)t.push([(e=this.map[r[i]]).key,e.value]);return n(t)},i.keys=function(){for(var e=[],t=Object.keys(this.map),r=0;r<t.length;r++)e.push(this.map[t[r]].key);return n(e)},i.values=function(){for(var e=[],t=Object.keys(this.map),r=0;r<t.length;r++)e.push(this.map[t[r]].value);return n(e)},i.forEach=function(e,t){for(var n,r=Object.keys(this.map),i=0;i<r.length;i++)e.call(t,(n=this.map[r[i]]).value,n.key,this)},i.set=function(e,t){var n=this.keyElem.verifyValue(e),r=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(n)]={key:n,value:r},this},i.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));if(t in this.map)return this.map[t].value},i.has=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));return t in this.map},r}(i,i.Reflect),i.loadProto=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=void 0),i.loadJson(i.DotProto.Parser.parse(e),t,n)},i.protoFromString=i.loadProto,i.loadProtoFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return i.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,function(r){if(null===r)return void t(Error("Failed to fetch file"));try{t(null,i.loadProto(r,n,e))}catch(e){t(e)}});var r=i.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:i.loadProto(r,n,e)},i.protoFromFile=i.loadProtoFile,i.newBuilder=function(e){return e=e||{},"undefined"==typeof e.convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=i.convertFieldsToCamelCase),"undefined"==typeof e.populateAccessors&&(e.populateAccessors=i.populateAccessors),new i.Builder(e)},i.loadJson=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=null),t&&"object"==typeof t||(t=i.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,n),t.resolveAll(),t},i.loadJsonFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return i.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,function(r){if(null===r)return void t(Error("Failed to fetch file"));try{t(null,i.loadJson(JSON.parse(r),n,e))}catch(e){t(e)}});var r=i.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:i.loadJson(JSON.parse(r),n,e)},i})}).call(t,n(29),n(7)(e))},function(e,t){String.fromCodePoint||!function(){var e=function(){try{var e={},t=Object.defineProperty,n=t(e,e,e)&&t}catch(e){}return n}(),t=String.fromCharCode,n=Math.floor,r=function(e){var r,i,o=16384,s=[],a=-1,u=arguments.length;if(!u)return"";for(var f="";++a<u;){var l=Number(arguments[a]);if(!isFinite(l)||l<0||l>1114111||n(l)!=l)throw RangeError("Invalid code point: "+l);l<=65535?s.push(l):(l-=65536,r=(l>>10)+55296,i=l%1024+56320,s.push(r,i)),(a+1==u||s.length>o)&&(f+=t.apply(null,s),s.length=0)}return f};e?e(String,"fromCodePoint",{value:r,configurable:!0,writable:!0}):String.fromCodePoint=r}()},function(e,t){String.prototype.codePointAt||!function(){"use strict";var e=function(){try{var e={},t=Object.defineProperty,n=t(e,e,e)&&t}catch(e){}return n}(),t=function(e){if(null==this)throw TypeError();var t=String(this),n=t.length,r=e?Number(e):0;if(r!=r&&(r=0),!(r<0||r>=n)){var i,o=t.charCodeAt(r);return o>=55296&&o<=56319&&n>r+1&&(i=t.charCodeAt(r+1),i>=56320&&i<=57343)?1024*(o-55296)+i-56320+65536:o}};e?e(String.prototype,"codePointAt",{value:t,configurable:!0,writable:!0}):String.prototype.codePointAt=t}()},19]))});
\ No newline at end of file
diff --git a/package.json b/package.json
index 152ab09..b20e13d 100644
--- a/package.json
+++ b/package.json
@@ -31,7 +31,7 @@
   "wbp": {
     "project": "umd",
     "entries": {
-      "main": "./MessageEngine.js"
+      "main": "./McuClientEngine.js"
     },
     "source": "src/",
     "build": "dist/"
diff --git a/src/Emiter.js b/src/Emiter.js
index 7db0d0d..7fd54b8 100644
--- a/src/Emiter.js
+++ b/src/Emiter.js
@@ -1,3 +1,4 @@
+
 export default class Emiter {
   constructor() {
     this.MAPS = {};
@@ -13,7 +14,7 @@ export default class Emiter {
   }
   off(eid, elistener) {
     if (eid) {
-      let stub = this.MAPS[eid];
+      let stub =this.MAPS[eid];
       if (stub) {
         if (elistener) {
           return stub.splice(stub.indexOf(elistener), 1);
@@ -22,10 +23,11 @@ export default class Emiter {
       }
     }
   }
-  emit(eid, data) {
+  _emit(eid, data) {
     if (eid) {
       //eid=* broadcast
-      let asteriskStub = this.MAPS['*'];
+      let asteriskStub =this.MAPS['*'];
+      console.log("asteriskStub");
       if (asteriskStub && asteriskStub.length) {
         asteriskStub.forEach(function (elistener) {
           elistener(eid, data);
diff --git a/src/EngineEntrance.js b/src/EngineEntrance.js
new file mode 100644
index 0000000..53c4dab
--- /dev/null
+++ b/src/EngineEntrance.js
@@ -0,0 +1,165 @@
+import Emiter from './Emiter';
+import Sass from 'Sass';
+import Mcu from 'mcu';
+import MessageTypes from 'MessageTypes';
+import Loger from 'Loger';
+import ConferApe from 'apes/ConferApe';
+import ChatApe from 'apes/ChatApe';
+import VideoChat from 'apes/VideoApe';
+import DocApe from 'apes/DocApe';
+import WhiteBoardApe from 'apes/WhiteBoardApe';
+import EngineUtils from "EngineUtils";
+
+let loger = Loger.getLoger('MessageEntrance');
+
+let info={"version":"v1.0.0","author":"3mang"};
+
+let confInfo={};
+let sass;
+let mcu ;
+let confer_ape;
+let chat_ape;
+let video_ape;
+let doc_ape;
+let wb_ape;
+
+export default class MessageEntrance extends Emiter {
+  constructor() {
+    super();
+
+    this.info=info;
+
+    // 应用层会议信息
+    confInfo = {};
+
+    // Sass平台层
+    sass = Sass;
+    sass.on('*', (type, data) => this._emit(type, data));
+    sass.on(sass.SUCCESS, this._h5SassSuccessHandler.bind(this));
+
+    // 底层MCU消息层
+    mcu = Mcu;
+    mcu.on('*', (type, data) => this._emit(type, data));
+    mcu.on(MessageTypes.CONFERENCE_JOIN_SUCCESS, this._conferenceJoinSuccessHandler.bind(this));
+
+    // 注册所有应用Ape
+    confer_ape = new ConferApe();
+    confer_ape.on('*', (type, data) => this._emit(type, data));
+    confer_ape.on(MessageTypes.DOC_SWITCH, this.docSwitchHandler.bind(this));
+
+    chat_ape = new ChatApe();
+    chat_ape.on('*', (type, data) => this._emit(type, data));
+
+    video_ape = new VideoChat();
+    video_ape.on('*', (type, data) => this._emit(type, data));
+
+    doc_ape = new DocApe();
+    doc_ape.on('*', (type, data) => this._emit(type, data));
+    doc_ape.on(MessageTypes.DOC_UPDATE, this.docUpdateHandler.bind(this));
+
+    doc_ape.on(MessageTypes.DOC_DEL, this.docDeleteHandler.bind(this));
+
+    wb_ape = new WhiteBoardApe();
+    wb_ape.on('*', (type, data) => this._emit(type, data));
+    wb_ape.on(MessageTypes.ANNO_UPDATE, this.annoUpdateHandler.bind(this));
+    this.on(MessageTypes.DOC_SHOW, this.docShowHandler.bind(this));
+
+    this.sendChatMsg=this._sendChatMsg;
+    this.joinClass=this._joinClass;
+  }
+
+  // 进入会议
+  _joinClass(_confInfo) {
+    confInfo = _confInfo||{};
+    if(confInfo===null||EngineUtils.isEmptyObject(confInfo)){
+      loger.log('不能进入会议,传递的参数不对.',_confInfo);
+      return ;
+    }
+    if(sass){
+      sass.sassChecking(_confInfo);
+    }
+  }
+
+  // 离开会议
+  leaveClass() {
+    if(mcu){
+      mcu.leaveMCU();
+    }
+  }
+  // 通过SASS平台验证
+  _h5SassSuccessHandler() {
+    loger.log('加入底层MCU会议.'+confInfo.toString());
+    if(mcu){
+      mcu.joinMCU(confInfo);
+    }
+  }
+
+  // MCU 会议成功
+  _conferenceJoinSuccessHandler() {
+    if(sass){
+      sass.getClassDetail();
+    }
+  }
+  // 参会处理
+  conferenceHandler(msg_type) {
+    var msg = {
+      type: msg_type,
+      data: null
+    };
+    this._emit(msg.type, msg);
+  }
+  // 发送聊天消息
+  _sendChatMsg(to, msg) {
+    if (chat_ape) {
+      chat_ape.sendChatMsg(to, msg);
+    }
+  }
+  // 白板笔记更新
+  annoUpdateHandler(annoInfo) {
+    const activeDocId = confer_ape.activeDocId;
+    const docItem = doc_ape.docList[activeDocId];
+    if (docItem && annoInfo.id == docItem.wbid) {
+      this._emit(MessageTypes.DOC_ANNO, annoInfo);
+    }
+  }
+
+  // 文档变更-笔记处理
+  docShowHandler(docItem) {
+    loger.log('Doc Show ->' + docItem.id + '|' + docItem.curPageNo);
+
+    const annoInfo = wb_ape.annoInfos[docItem.wbid];
+    if (annoInfo) {
+      this._emit(MessageTypes.DOC_ANNO, annoInfo);
+    } else {
+      this._emit(MessageTypes.DOC_ANNO);
+
+    }
+
+  }
+
+  // 文档切换
+  docSwitchHandler() {
+    const activeDocId = confer_ape.activeDocId;
+    loger.log('Switch Doc Active -> ' + activeDocId);
+    const docItem = doc_ape.docList[activeDocId];
+    if (docItem) {
+      this._emit(MessageTypes.DOC_SHOW, docItem);
+    }
+  }
+
+  // 文档变更
+  docUpdateHandler(docItem) {
+    loger.log('Doc UpdateId ->' + docItem.id + '| activeDocId ->' + confer_ape.activeDocId);
+    if (docItem.id == confer_ape.activeDocId) {
+      this._emit(MessageTypes.DOC_SHOW, docItem);
+    }
+  }
+
+  //文档删除
+    docDeleteHandler(docItem){
+        if (docItem.id == confer_ape.activeDocId) {
+            this._emit(MessageTypes.DOC_DEL, docItem);
+        }
+    }
+}
+//MessageEntrance.MessageTypes = MessageTypes;
diff --git a/src/EngineUtils.js b/src/EngineUtils.js
new file mode 100644
index 0000000..de8103c
--- /dev/null
+++ b/src/EngineUtils.js
@@ -0,0 +1,13 @@
+/**
+ * Created by hoopoe8 on 2017/1/8.
+ */
+
+class EngineUtils{
+    static isEmptyObject(O){
+        for (var x in O){
+            return false;
+        }
+        return true;
+    }
+}
+export  default EngineUtils;
\ No newline at end of file
diff --git a/src/EverSocket.js b/src/EverSocket.js
index ee5c7c0..fb84f17 100644
--- a/src/EverSocket.js
+++ b/src/EverSocket.js
@@ -52,9 +52,9 @@ class EverSocket extends Emiter {
   _setConnected(isConn = true) {
     this._connected = isConn;
     if (this._connected) {
-      this.emit(EverSocket.OPEN);
+      this._emit(EverSocket.OPEN);
     } else {
-      this.emit(EverSocket.CLOSED);
+      this._emit(EverSocket.CLOSED);
     }
   }
 
@@ -117,7 +117,7 @@ class EverSocket extends Emiter {
     this._lastActiveTime = Date.now();
     const bufferData = messageEvent.data;
     if (bufferData.byteLength > 0) {
-      this.emit(EverSocket.MESSAGE, bufferData);
+      this._emit(EverSocket.MESSAGE, bufferData);
     }
   }
 
diff --git a/src/McuClientEngine.js b/src/McuClientEngine.js
new file mode 100644
index 0000000..b89995a
--- /dev/null
+++ b/src/McuClientEngine.js
@@ -0,0 +1,9 @@
+import EngineEntrance from 'EngineEntrance';
+import MessageTypes from 'MessageTypes';
+
+const MCU_CLIENT=new EngineEntrance();
+export function createMcuClient() {
+  return MCU_CLIENT;
+}
+
+export {MessageTypes};
diff --git a/src/MessageEngine.js b/src/MessageEngine.js
deleted file mode 100644
index 980ec3d..0000000
--- a/src/MessageEngine.js
+++ /dev/null
@@ -1,153 +0,0 @@
-import Emiter from './Emiter';
-import h5Sass from 'Sass';
-import mcu from 'mcu';
-import MessageTypes from 'MessageTypes';
-import Loger from 'Loger';
-import ConferApe from 'apes/ConferApe';
-import ChatApe from 'apes/ChatApe';
-import VideoChat from 'apes/VideoApe';
-import DocApe from 'apes/DocApe';
-import WhiteBoardApe from 'apes/WhiteBoardApe';
-let loger = Loger.getLoger('MessageEngine');
-
-export default class MessageEngine extends Emiter {
-  constructor() {
-    super();
-
-    // 应用层会议信息
-    this.confInfo = null;
-
-    // Sass平台层
-    this.h5Sass = h5Sass;
-    this.h5Sass.on('*', (type, data) => this.emit(type, data));
-    this.h5Sass.on(h5Sass.SUCCESS, this._h5SassSuccessHandler.bind(this));
-
-    // 底层MCU消息层
-    this.mcu = mcu;
-    this.mcu.on('*', (type, data) => this.emit(type, data));
-    this.mcu.on(MessageTypes.CONFERENCE_JOIN_SUCCESS, this._conferenceJoinSuccessHandler.bind(this));
-
-    // 注册所有应用Ape
-    this.conferApe = new ConferApe();
-    this.conferApe.on('*', (type, data) => this.emit(type, data));
-    this.conferApe.on(MessageTypes.DOC_SWITCH, this.docSwitchHandler.bind(this));
-
-    this.chat_ape = new ChatApe();
-    this.chat_ape.on('*', (type, data) => this.emit(type, data));
-
-    this.video_ape = new VideoChat();
-    this.video_ape.on('*', (type, data) => this.emit(type, data));
-
-    this.doc_ape = new DocApe();
-    this.doc_ape.on('*', (type, data) => this.emit(type, data));
-    this.doc_ape.on(MessageTypes.DOC_UPDATE, this.docUpdateHandler.bind(this));
-
-    this.doc_ape.on(MessageTypes.DOC_DEL, this.docDeleteHandler.bind(this));
-
-    this.wb_ape = new WhiteBoardApe();
-    this.wb_ape.on('*', (type, data) => this.emit(type, data));
-    this.wb_ape.on(MessageTypes.ANNO_UPDATE, this.annoUpdateHandler.bind(this));
-
-    this.on(MessageTypes.DOC_SHOW, this.docShowHandler.bind(this));
-    //this.say = this.say.bind(this)
-    //this.hello = this.hello.bind(this)
-    this.init=this._init;
-  }
-  _init (id) {
-    console.log("Engine init "+id);
-  }
-  // 白板笔记更新
-  annoUpdateHandler(annoInfo) {
-    const activeDocId = this.conferApe.activeDocId;
-    const docItem = this.doc_ape.docList[activeDocId];
-    if (docItem && annoInfo.id == docItem.wbid) {
-      this.emit(MessageTypes.DOC_ANNO, annoInfo);
-    }
-  }
-
-  // 文档变更-笔记处理
-  docShowHandler(docItem) {
-    loger.log('Doc Show ->' + docItem.id + '|' + docItem.curPageNo);
-
-    const annoInfo = this.wb_ape.annoInfos[docItem.wbid];
-    if (annoInfo) {
-      this.emit(MessageTypes.DOC_ANNO, annoInfo);
-    } else {
-      this.emit(MessageTypes.DOC_ANNO);
-
-    }
-
-  }
-
-  // 文档切换
-  docSwitchHandler() {
-    const activeDocId = this.conferApe.activeDocId;
-    loger.log('Switch Doc Active -> ' + activeDocId);
-    const docItem = this.doc_ape.docList[activeDocId];
-    if (docItem) {
-      this.emit(MessageTypes.DOC_SHOW, docItem);
-    }
-  }
-
-  // 文档变更
-  docUpdateHandler(docItem) {
-    loger.log('Doc UpdateId ->' + docItem.id + '| activeDocId ->' + this.conferApe.activeDocId);
-    if (docItem.id == this.conferApe.activeDocId) {
-      this.emit(MessageTypes.DOC_SHOW, docItem);
-    }
-  }
-
-  //文档删除
-    docDeleteHandler(docItem){
-        if (docItem.id == this.conferApe.activeDocId) {
-            this.emit(MessageTypes.DOC_DEL, docItem);
-        }
-    }
-
-
-  // MCU 会议成功
-  _conferenceJoinSuccessHandler() {
-    this.h5Sass.getClassDetail();
-  }
-
-  // 通过SASS平台验证
-  _h5SassSuccessHandler() {
-    loger.log('加入底层MCU会议.');
-    this.mcu.joinMCU(this.confInfo);
-  }
-
-  // 进入会议
-  joinClass(_confInfo) {
-    this.confInfo = _confInfo;
-    this.h5Sass.sassChecking(_confInfo);
-  }
-
-  // 离开会议
-  leaveClass() {
-    this.mcu.leaveMCU();
-  }
-
-  // 参会处理
-  conferenceHandler(msg_type) {
-    var msg = {
-      type: msg_type,
-      data: null
-    };
-    this.emit(msg.type, msg);
-  }
-
-  // 发送聊天消息
-  sendChatMsg(to, msg) {
-    if (this.chat_ape) {
-      this.chat_ape.sendChatMsg(to, msg);
-    }
-  }
-}
-
-MessageEngine.MessageTypes = MessageTypes;
-MessageEngine.data={
-  aa:"aa",
-  bb:11,
-  cc:"cccc"
-};
-
diff --git a/src/MessageTypes.js b/src/MessageTypes.js
index 3b5bd9e..7fe46bb 100644
--- a/src/MessageTypes.js
+++ b/src/MessageTypes.js
@@ -35,16 +35,14 @@ MessageTypes.VIDEO_SHOW = 'video.message';
 MessageTypes.DOC_SHOW = 'document.message';
 MessageTypes.DOC_SWITCH = 'document.switch';
 MessageTypes.DOC_UPDATE = 'document.update';
+MessageTypes.DOC_DEL='document.delete';
+MessageTypes.DOC_ANNO = 'document.anno';
 
 MessageTypes.CHAT_RECEIVE = 'chat.message';
 
-MessageTypes.DOC_ANNO = 'document.anno';
-
 MessageTypes.ANNO_UPDATE = 'anno_update';
 
-MessageTypes.DOC_DEL='document.delete';
 MessageTypes.AUDIO_SHOW='audio.message';
 
-
 export default MessageTypes;
 
diff --git a/src/Sass.js b/src/Sass.js
index facb2d2..8f32c41 100644
--- a/src/Sass.js
+++ b/src/Sass.js
@@ -3,10 +3,10 @@ import Loger from 'Loger';
 import MessageTypes from 'MessageTypes';
 
 // 日志对象
-const loger = Loger.getLoger('H5Sass');
+const loger = Loger.getLoger('Sass');
 
 let confInfo = {};
-class H5Sass extends Emiter {
+class Sass extends Emiter {
   constructor() {
     super();
   }
@@ -14,10 +14,10 @@ class H5Sass extends Emiter {
   // Sass校验
   sassChecking(_confInfo) {
     loger.log('发起Sass校验', _confInfo);
-    this.confInfo = _confInfo;
+    confInfo = _confInfo;
 
     // 密码校验
-    if (this.confInfo.nopassword === 'true') {
+    if (confInfo.nopassword === 'true') {
       return this.sendPWDChecking();
     }
 
@@ -27,7 +27,7 @@ class H5Sass extends Emiter {
 
   // 入会校验
   sendPWDChecking() {
-    let url = `http://${this.confInfo.portal}/3m/getCheckMeetinig.do?siteId=${this.confInfo.siteId}&classId=${this.confInfo.confId}&password=${this.confInfo.password}`;
+    let url = `http://${confInfo.portal}/3m/getCheckMeetinig.do?siteId=${confInfo.siteId}&classId=${confInfo.confId}&password=${confInfo.password}`;
     loger.log('会议密码校验', url);
     fetch(url, {
         timeout: 5000
@@ -37,14 +37,14 @@ class H5Sass extends Emiter {
           return ret.text();
         } else {
           loger.error(`会议密码校验-网络异常.状态码:${ret.status}`);
-          this.emit(MessageTypes.NET_ERROR);
+          this._emit(MessageTypes.NET_ERROR);
           throw '';
         }
       })
       .then(ret => {
         if (ret === 'false') {
           loger.error(`会议密码校验-失败.`);
-          return this.emit(MessageTypes.CONFERENCE_SHOW_WRONG_PASSWORD);
+          return this._emit(MessageTypes.CONFERENCE_SHOW_WRONG_PASSWORD);
         }
         if (ret === 'true') {
           loger.log(`会议密码校验-成功.`);
@@ -52,17 +52,17 @@ class H5Sass extends Emiter {
           return
         }
         loger.error(`会议密码校验-协议异常.`);
-        this.emit(MessageTypes.PRO_ERROR);
+        this._emit(MessageTypes.PRO_ERROR);
       })
       .catch(err => {
         loger.error(`会议密码校验-异常.状态码:${err}`);
-        this.emit(MessageTypes.NET_ERROR);
+        this._emit(MessageTypes.NET_ERROR);
       });
   }
 
   // 发起入会
   sendMD5Checking() {
-    let url = `http://${this.confInfo.portal}/3m/meeting/md5CheckMeeting.do?siteId=${this.confInfo.siteId}&meetingNumber=${this.confInfo.confId}&userId=${this.confInfo.userId}&userName=${this.confInfo.userName}&userType=${this.confInfo.userType}&nopassword=${this.confInfo.nopassword}&md5=${this.confInfo.md5}`;
+    let url = `http://${confInfo.portal}/3m/meeting/md5CheckMeeting.do?siteId=${confInfo.siteId}&meetingNumber=${confInfo.confId}&userId=${confInfo.userId}&userName=${confInfo.userName}&userType=${confInfo.userType}&nopassword=${confInfo.nopassword}&md5=${confInfo.md5}`;
 
     loger.log('H5SassMD5校验', url);
 
@@ -74,7 +74,7 @@ class H5Sass extends Emiter {
           return ret.json();
         } else {
           loger.error(`H5SassMD5校验-网络异常.状态码:${ret.status}`);
-          this.emit(MessageTypes.NET_ERROR);
+          this._emit(MessageTypes.NET_ERROR);
           throw '';
         }
       })
@@ -82,28 +82,31 @@ class H5Sass extends Emiter {
         if (ret.flag == "true") {
           if (ret.h5_mcu_list) {
             let server = ret.h5_mcu_list.split(";")[0];
-            this.confInfo.MCUServerIP = server.split(":")[0];
-            this.confInfo.MCUServerPort = server.split(":")[1];
+            confInfo.MCUServerIP = server.split(":")[0];
+            confInfo.MCUServerPort = server.split(":")[1];
           }
-          this.confInfo.maxVideoChannels = ret.maxVideoChannels;
-          this.confInfo.maxAudioChannels = ret.maxAudioChannels;
-          this.confInfo.maxMediaChannels = this.confInfo.maxVideoChannels + this.confInfo.maxAudioChannels;
+          console.log(ret);
+          confInfo.maxVideoChannels = ret.maxVideoChannels;
+          confInfo.maxAudioChannels = ret.maxAudioChannels;
+          confInfo.maxMediaChannels = confInfo.maxVideoChannels + confInfo.maxAudioChannels;
           loger.log('H5Sass校验完成');
-          this.emit(H5Sass.SUCCESS);
+
+          this._emit(Sass.SUCCESS);
         } else {
           loger.log('H5SassMD5校验-失败.');
-          this.emit(MessageTypes.CONFERENCE_JOIN_FAILED);
+          this._emit(MessageTypes.CONFERENCE_JOIN_FAILED);
         }
       })
       .catch(err => {
         loger.error(`H5SassMD5校验-异常.状态码:${err}`);
-        this.emit(MessageTypes.NET_ERROR);
+        this._emit(MessageTypes.NET_ERROR);
+        console.log("aaaaaaaaaaaaaaaaaaa");
       });
   }
 
   // 获取会议详情
   getClassDetail() {
-    let url = `http://${this.confInfo.portal}/3m/meeting/getClassH5.do?classNumber=${this.confInfo.confId}`;
+    let url = `http://${confInfo.portal}/3m/meeting/getClassH5.do?classNumber=${confInfo.confId}`;
 
     loger.log('H5Sass获取Class详情.', url);
 
@@ -115,27 +118,27 @@ class H5Sass extends Emiter {
           return ret.json();
         } else {
           loger.error(`H5Sass获取Class详情-网络异常.状态码:${ret.status}`);
-          this.emit(MessageTypes.NET_ERROR);
+          this._emit(MessageTypes.NET_ERROR);
           throw '';
         }
       })
       .then(ret => {
         if (ret.errorCode === 0) {
           loger.log('H5Sass获取Class详情完成');
-          this.emit(MessageTypes.CONFERENCE_SHOW_DETAIL, ret);
+          this._emit(MessageTypes.CONFERENCE_SHOW_DETAIL, ret);
         } else {
           loger.warn('H5Sass获取Class详情失败.');
-          this.emit(MessageTypes.NET_ERROR);
+          this._emit(MessageTypes.NET_ERROR);
         }
       })
       .catch(err => {
         loger.error(`H5Sass获取Class详情异常.状态码:${err}`);
-        this.emit(MessageTypes.NET_ERROR);
+        this._emit(MessageTypes.NET_ERROR);
       });
   }
 }
 
-H5Sass.prototype.SUCCESS = H5Sass.SUCCESS = 'h5sass.success';
+Sass.prototype.SUCCESS = Sass.SUCCESS = 'h5sass.success';
 
-export default new H5Sass;
+export default new Sass;
 
diff --git a/src/apes/ChatApe.js b/src/apes/ChatApe.js
index b8ad8cd..1e6ad0b 100644
--- a/src/apes/ChatApe.js
+++ b/src/apes/ChatApe.js
@@ -18,7 +18,7 @@ import ApeConsts from './ApeConsts';
 import pdu from 'pdu';
 import Loger from 'Loger';
 import MessageTypes from 'MessageTypes';
-
+import EngineUtils from "EngineUtils";
 let loger = Loger.getLoger('ChatApe');
 
 class ChatApe extends Ape {
@@ -43,11 +43,16 @@ class ChatApe extends Ape {
   }
 
   sendChatMsg(to, message) {
+    if(this._confInfo===null||EngineUtils.isEmptyObject(this._confInfo)){
+      loger.log('发送聊天消息.', to, message,"Engine 还未初始化数据!");
+      return ;
+    }
+
     loger.log('发送聊天消息.', to, message);
     let chatSendPdu = new pdu['RCChatSendDataRequestPdu'];
     chatSendPdu.type = pdu.RCPDU_CHAT_SEND_DATA_REQUEST;
-    chatSendPdu.initiator = this._confInfo.nodeId;
-    chatSendPdu.peer = to;
+    chatSendPdu.initiator = this._confInfo.nodeId;//发起人
+    chatSendPdu.peer = to;//发送给谁
     chatSendPdu.isPublic = true;
     chatSendPdu.userData = this._rCArrayBufferUtil.strToUint8Array("h5" + message);
     chatSendPdu.fromName = this._rCArrayBufferUtil.strToUint8Array("h5" + this._confInfo.userName);
@@ -71,7 +76,7 @@ class ChatApe extends Ape {
 
     loger.log('接受聊天消息.', chatMsg);
 
-    this.emit(MessageTypes.CHAT_RECEIVE, chatMsg);
+    this._emit(MessageTypes.CHAT_RECEIVE, chatMsg);
   }
 }
 
diff --git a/src/apes/ConferApe.js b/src/apes/ConferApe.js
index 5b1a982..e8fe1f6 100644
--- a/src/apes/ConferApe.js
+++ b/src/apes/ConferApe.js
@@ -97,7 +97,7 @@ class ConferApe extends Ape {
       if (tabTypeMatches.length > 1 && tabTypeMatches[1] == 'show.docsharing') {
         if (tabInfo.match(/<visible>(.+)<\/visible>/)[1] == 'true') {
           this.activeDocId = tabInfo.match(/<TabID>(.+)<\/TabID>/)[1];
-          this.emit(MessageTypes.DOC_SWITCH, this.activeDocId);
+          this._emit(MessageTypes.DOC_SWITCH, this.activeDocId);
         }
       }
     } catch (e) {
@@ -135,12 +135,12 @@ class ConferApe extends Ape {
     this.emitRosterChange();
     // 自己退出
     if (nodeId == this._confInfo.nodeId) {
-      this.emit(MessageTypes.CONFERENCE_EXIT);
+      this._emit(MessageTypes.CONFERENCE_EXIT);
     }
   }
 
   emitRosterChange() {
-    this.emit(MessageTypes.CONFERENCE_SHOW_ROSTER_NUM, Object.keys(this.rosters).length);
+    this._emit(MessageTypes.CONFERENCE_SHOW_ROSTER_NUM, Object.keys(this.rosters).length);
   }
 }
 
diff --git a/src/apes/DocApe.js b/src/apes/DocApe.js
index a8682d0..319c9bb 100644
--- a/src/apes/DocApe.js
+++ b/src/apes/DocApe.js
@@ -46,7 +46,7 @@ class DocApe extends Ape {
   tableDeleteHandler(tableId, record){
       const re={};
       re.type=ApeConsts.DOCUMENT_DEL;
-      this.emit(MessageTypes.DOC_DEL, re);
+      this._emit(MessageTypes.DOC_DEL, re);
   }
   tableUpdateHandler(owner, recordId, recordData) {
     try {
@@ -65,7 +65,7 @@ class DocApe extends Ape {
         recordInfo.loadURL = `${recordInfo.namePath}/${recordInfo.curPageNo}.jpg`;
       }
       this.docList[recordId] = recordInfo;
-      this.emit(MessageTypes.DOC_UPDATE, recordInfo);
+      this._emit(MessageTypes.DOC_UPDATE, recordInfo);
       loger.log('Doc update ->' + recordId);
     } catch (e) {
       loger.warn('Doc Table Update Decode包异常');
diff --git a/src/apes/VideoApe.js b/src/apes/VideoApe.js
index d917016..04a62fa 100644
--- a/src/apes/VideoApe.js
+++ b/src/apes/VideoApe.js
@@ -60,7 +60,7 @@ class VideoChat extends Ape {
 
     // this._notify(RCApeEvent.E_VIDEO_DATA, videoReceivePdu.sessionId, videoReceivePdu.channelId, video_data);
     loger.log('接受视频消息.', video_data);
-    this.emit(MessageTypes.VIDEO_SHOW, video_data);
+    this._emit(MessageTypes.VIDEO_SHOW, video_data);
 
   }
 
@@ -101,7 +101,7 @@ class VideoChat extends Ape {
   }
 
   emitVideoChange() {
-    this.emit(MessageTypes.VIDEO_SHOW, {
+    this._emit(MessageTypes.VIDEO_SHOW, {
       activeChannelId: this.activeChannelId,
       HLSURL: this.activeURL,
     });
diff --git a/src/apes/WhiteBoardApe.js b/src/apes/WhiteBoardApe.js
index 0a93798..68c903f 100644
--- a/src/apes/WhiteBoardApe.js
+++ b/src/apes/WhiteBoardApe.js
@@ -63,7 +63,7 @@ class WhiteBoardApe extends Ape {
         svg: UTF8.getStringFromBytes(uncompressedBytes)
       };
       this.annoInfos[recordId] = annoInfo;
-      this.emit(MessageTypes.ANNO_UPDATE, annoInfo);
+      this._emit(MessageTypes.ANNO_UPDATE, annoInfo);
     } else {
       loger.log('白板动作忽略,类型:', ApeConsts(recordInfo.type));
     }
diff --git a/src/index.js b/src/index.js
index 9490e9a..f953f55 100644
--- a/src/index.js
+++ b/src/index.js
@@ -22,5 +22,5 @@ import dfjsd from 'Loger';
 
 import fdsfds from 'mcu';
 
-import alexwang from 'MessageEngine.js';
+import alexwang from 'EngineEntrance.js';
 
diff --git a/src/mcu.js b/src/mcu.js
index 0591d58..d942ca5 100644
--- a/src/mcu.js
+++ b/src/mcu.js
@@ -83,10 +83,10 @@ class MCU extends Emiter {
       switch (pduResultCode) {
       case PduConsts.RET_SUCCESS:
         this._updateMCUConfInfoDesc(joinConfPdu.get("confDesc"));
-        this.emit(MessageTypes.CONFERENCE_JOIN_SUCCESS, this.confInfo);
+        this._emit(MessageTypes.CONFERENCE_JOIN_SUCCESS, this.confInfo);
         break;
       case PduConsts.RET_FULL_CAPACITY:
-        this.emit(MessageTypes.CONFERENCE_JOIN_FULL);
+        this._emit(MessageTypes.CONFERENCE_JOIN_FULL);
         break;
       default:
         loger.warn('JoinConfPdu-未知类型-等待处理.', pduResultCode);
@@ -98,7 +98,7 @@ class MCU extends Emiter {
       if (ape) {
         let subTypeLabel = pdu.id2type(pduMsg.subType);
         loger.log('MCU-SecondLayer封装消息', 'sessionId', sessionLabel, pduMsg.sessionId, 'subtype', subTypeLabel, pduMsg.subType);
-        ape.emit(pduMsg.subType, pduMsg.data);
+        ape._emit(pduMsg.subType, pduMsg.data);
       } else {
         loger.warn(sessionLabel + '尚未注册');
       }
diff --git a/webpack.config.umd.js b/webpack.config.umd.js
index ce1d134..2e8be7c 100644
--- a/webpack.config.umd.js
+++ b/webpack.config.umd.js
@@ -2,7 +2,7 @@ module.exports = function (umdConf) {
   umdConf.devServer.host = '0.0.0.0';
   //umdConf.webpackFeatures.enableEntryHTML();//生成
   umdConf.output.publicPath = '';
-  umdConf.output.library = 'MessageEngine';
+  umdConf.output.library = 'MCUClientEngine';
 
   //console.dir(umdConf);