From 7cd3b4edd2044edbe0bc37a71ca40fbf7ed5eab8 Mon Sep 17 00:00:00 2001 From: liyong <liyong@3mang.com> Date: Wed, 10 May 2017 20:03:36 +0800 Subject: [PATCH] 音视频模块推流逻辑处理,调用接口需要判断是否还能推流 --- dist/McuClient.js | 32 ++++++++++++++++---------------- src/EngineEntrance.js | 10 ++++++++-- src/Loger.js | 6 ++++-- src/apes/AudioApe.js | 15 +++++++++++++++ src/apes/MediaModule.js | 2 +- src/apes/VideoApe.js | 19 ++++++++++++++++++- 6 files changed, 62 insertions(+), 22 deletions(-) diff --git a/dist/McuClient.js b/dist/McuClient.js index 6b6f297..f55eb08 100644 --- a/dist/McuClient.js +++ b/dist/McuClient.js @@ -1,16 +1,16 @@ -!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(35)},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.sdkInfo=t||"",this.id=this.initId()}return r(e,[{key:"initId",value:function(){if(!this.sdkInfo)return console.log("this.sdkInfo无效-->",this.sdkInfo),"";var e=Object.prototype.toString.call(this.sdkInfo);return"[object String]"===e?this.sdkInfo:"[object Object]"===e?this.sdkInfo.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:"data",value:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];this._log(e.DATA,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);break;case e.DATA:console.log(r)}}}]),e}();i.LOG=0,i.WARN=1,i.ERROR=2,i.NO=1/0,i.logLevel=i.LOG,i.DATA=5;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,DATA:i.DATA};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(e){for(var t in n)if(n[t]===e)return t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.CLASS_STATUS_WAIT=0,n.CLASS_STATUS_STARTED=1,n.CLASS_STATUS_PAUSE=2,n.CLASS_STATUS_CLOSE=3,n.CLASS_STATUS_UPTATE=4,n.CLASS_WAIT_START="class.wait.start",n.CLASS_STARTING="class.started",n.CLASS_PAUSING="class.pause",n.CLASS_PAUSING="class.closed",n.CLASS_PAUSING="class.update",n.CLASS_ACTION_CLOSE_ALL=1,n.CLASS_TYPE_INTERACT=1,n.CLASS_TYPE_LIVE=2,n.NR_NORMAL=1,n.NR_ADMIN=2,n.NR_HOST=4,n.NR_PRESENTER=8,n.NR_ASSISTANT=16,n.NR_INVISIBLE=32,n.host="host",n.presenter="presenter",n.assistant="assistant",n.normal="normal",n.record="record",n.invisible="invisible",n.userTypes={},n.userTypes[n.NR_NORMAL]=n.normal,n.userTypes[n.NR_ADMIN]=n.record,n.userTypes[n.NR_HOST]=n.host,n.userTypes[n.NR_PRESENTER]=n.presenter,n.userTypes[n.NR_ASSISTANT]=n.assistant,n.userTypes[n.NR_INVISIBLE]=n.invisible,n.userTypesToId={},n.userTypesToId[n.normal]=n.NR_NORMAL,n.userTypesToId[n.record]=n.NR_ADMIN,n.userTypesToId[n.host]=n.NR_HOST,n.userTypesToId[n.presenter]=n.NR_PRESENTER,n.userTypesToId[n.assistant]=n.NR_ASSISTANT,n.userTypesToId[n.invisible]=n.NR_INVISIBLE,n.MS_TYPE_DEFAULT=0,n.MS_TYPE_FMS=1,n.USER_HAND_UP=32,n.USER_MIC_OPEN=64,n.USER_CAMERA_OPEN=128,n.MEDIA_ACTION_DEFAULT=0,n.MEDIA_ACTION_OPEN_CAMERA=1,n.MEDIA_ACTION_CLOSE_CAMERA=2,n.MEDIA_ACTION_OPEN_MIC=21,n.MEDIA_ACTION_CLOSE_MIC=22,n.MEDIA_ACTION_SETING=31,n.CHANNEL_STATUS_RELEASED=0,n.CHANNEL_STATUS_OPENING=1,n.MEDIA_TYPE_DEFAULT=0,n.MEDIA_TYPE_VIDEO=1,n.MEDIA_TYPE_AUDIO=2,n.RETURN_SUCCESS=0,n.RETURN_FAILED=1,n.INVALIDATE_CHANNEL_ID=-1,n.INVALIDATE_NODE_ID=-1,n.DOC_ACTION_NORMAL=0,n.DOC_ACTION_SWITCH_DOC=1,n.DOC_ACTION_SWITCH_PAGE=2,n.DOC_ACTION_COMMAND=3,n.DOC_ACTION_SWITCH_ANIMATION=4,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){"use strict";function n(){}Object.defineProperty(t,"__esModule",{value:!0}),n.CLASS_INIT_SUCCESS="class_init_success",n.CLASS_JOIN_MCU_SUCCESS="class_join_mcu_success",n.CLASS_GET_INFO_SUCCESS="class_get_info_success",n.CLASS_JOIN_SUCCESS="class_join_success",n.CLASS_UPDATE_ROSTER_NUM="class_update_roster_num",n.CLASS_INSERT_ROSTER="class_insert_roster",n.CLASS_UPDATE_ROSTER="class_update_roster",n.CLASS_DELETE_ROSTER="class_delete_roster",n.CLASS_NONENTITY_ROSTER="class_nonenetity_roster",n.CLASS_RUN_EXIT="class_run_exit",n.CLASS_EXIT="class_exit",n.CLASS_UPTATE_STATUS="class_update_status",n.CLASS_STATUS_INFO_CHANGE="class_status_info_change",n.CLASS_UPDATE_TIMER="class_update_timer",n.CLASS_RECORD_START="class_record_start",n.CLASS_RECORD_SUCCESS="class_record_success",n.CHAT_RECEIVE="chat_receive_message",n.USER_DEVICE_STATUS_CHAANGE="user_device_status_change",n.VIDEO_PLAY="video_play",n.VIDEO_STOP="video_stop",n.VIDEO_UPDATE="video_update",n.VIDEO_BROADCAST="video_broadcast",n.VIDEO_GET_PUBLISH_PATH="video_get_publish_path",n.VIDEO_PUBLISH_RESULT="video_publish_result",n.AUDIO_PLAY="audio_play",n.AUDIO_STOP="audio_stop",n.AUDIO_UPDATE="audio_update",n.AUDIO_BROADCAST="audio_broadcast",n.AUDIO_GET_PUBLISH_PATH="audio_get_publish_path",n.AUDIO_PUBLISH_RESULT="audio_publish_result",n.DOC_DELETE="document_delete",n.DOC_UPDATE="document_update",n.DOC_BROADCAST="doc_broadcast",n.WHITEBOARD_ANNOTATION_UPDATE="whiteboard_annotation_update",n.SWITCH_MCU_IP="switch_mcu_ip",n.SWITCH_MS_IP="switch_ms_ip",n.RECORD_PLAYBACK_UPDATE="record_playback_update",n.MCU_ERROR="mcu_error",n.ERROR_EVENT="error_event",n.ERR_CLASS_INIT_PARAM=100,n.ERR_CLASS_INIT_NETWORK=101,n.ERR_CLASS_INIT_PROTOCOL=102,n.ERR_CLASS_INIT_FAILED=103,n.ERR_CLASS_INIT_FAILED_1=104,n.ERR_CLASS_INIT_FAILED_2=105,n.ERR_CLASS_INIT_FAILED_3=106,n.ERR_CLASS_INIT_FAILED_4=107,n.ERR_CLASS_JOIN_NETWORK=200,n.ERR_CLASS_JOIN_PROTOCOL=201,n.ERR_CLASS_JOIN_FAILED=202,n.ERR_CLASS_JOIN_PARAM=203,n.ERR_CLASS_JOIN_FULL=204,n.ERR_CLASS_MD5_WRONG=205,n.ERR_CLASS_PASSWORD_WRONG=206,n.ERR_CLASS_JOIN_CONFILICT=207,n.ERR_CLASS_KICK_OUT=208,n.ERR_CLASS_REMOTE_LANDING=209,n.ERR_GET_CLASS_DETAIL=300,n.ERR_GET_CLASS_PARAML=301,n.ERR_APE_SEND_FAILED_NO_JOIN=500,n.ERR_APE_INTERFACE_PARAM_WRONG=501,n.ERR_DOC_DELETE_FAILED=600,n.ERR_DOC_DELETE_FAILED_PARAM=601,n.ERR_SDK_FAILED=700,n.ERR_INTERFACE_NONE=701,n.ERR_INTERFACE_PARAMS_ERROR=702,n.ERR_INIT_RECORD_PLAY_BACK_FAILED=910,n.ERR_GET_RECORD_PLAY_BACK_DATA_FAILED=911,n.ERR_NETWORK=1e4,n.ERR_UNKNOWN=10001,n.ERR_SOCKET_DISCONNECT=2e4,n.ERR_SOCKET_RECONNECT_FAILED=20001,n.ErrorReson={},n.ErrorReson[n.ERR_CLASS_INIT_PARAM]="初始化参数错误",n.ErrorReson[n.ERR_CLASS_INIT_NETWORK]="初始化网络错误",n.ErrorReson[n.ERR_CLASS_INIT_PROTOCOL]="初始化协议错误",n.ErrorReson[n.ERR_CLASS_INIT_FAILED]="初始化验证失败",n.ErrorReson[n.ERR_CLASS_INIT_FAILED_1]="初始化验证失败,课堂号必填",n.ErrorReson[n.ERR_CLASS_INIT_FAILED_2]="初始化验证失败,无效的课堂号",n.ErrorReson[n.ERR_CLASS_INIT_FAILED_3]="初始化验证失败,没有对应的站点",n.ErrorReson[n.ERR_CLASS_INIT_FAILED_4]="初始化验证失败,站点已过期",n.ErrorReson[n.ERR_CLASS_JOIN_NETWORK]="加入课堂网络错误",n.ErrorReson[n.ERR_CLASS_JOIN_PROTOCOL]="加入课堂化协议错误",n.ErrorReson[n.ERR_CLASS_JOIN_FAILED]="加入课堂化异常错误",n.ErrorReson[n.ERR_CLASS_JOIN_PARAM]="加入课堂参数错误",n.ErrorReson[n.ERR_CLASS_JOIN_FULL]="人数已满",n.ErrorReson[n.ERR_CLASS_MD5_WRONG]="MD5验证失败",n.ErrorReson[n.ERR_CLASS_PASSWORD_WRONG]="密码错误",n.ErrorReson[n.ERR_CLASS_JOIN_CONFILICT]="已经在其它地方登陆",n.ErrorReson[n.ERR_CLASS_KICK_OUT]="有相同身份的人员加入课堂,自己被踢出课堂",n.ErrorReson[n.ERR_CLASS_REMOTE_LANDING]="有相同的userId异地登陆",n.ErrorReson[n.ERR_GET_CLASS_DETAIL]="获取课堂基本信息失败",n.ErrorReson[n.ERR_GET_CLASS_PARAML]="获取课堂详细信息失败",n.ErrorReson[n.ERR_APE_SEND_FAILED_NO_JOIN]="APE在sdk为初始化或未加入课堂之前调用发送数据接口",n.ErrorReson[n.ERR_APE_INTERFACE_PARAM_WRONG]="APE在接口调用时参数错误",n.ErrorReson[n.ERR_DOC_DELETE_FAILED]="删除文档失败",n.ErrorReson[n.ERR_DOC_DELETE_FAILED_PARAM]="删除文档失败,参数错误",n.ErrorReson[n.ERR_SDK_FAILED]="sdk还没初始化",n.ErrorReson[n.ERR_INTERFACE_NONE]="调用的接口不存在",n.ErrorReson[n.ERR_INTERFACE_PARAMS_ERROR]="调用的接口,传递的参数不正确",n.ErrorReson[n.ERR_INIT_RECORD_PLAY_BACK_FAILED]="初始化录制回放失败",n.ErrorReson[n.ERR_GET_RECORD_PLAY_BACK_DATA_FAILED]="获取录制回放数据失败",n.ErrorReson[n.ERR_NETWORK]="网络错误",n.ErrorReson[n.ERR_UNKNOWN]="未知错误",n.ErrorReson[n.ERR_SOCKET_DISCONNECT]="MCU断开连接,已经离开课堂",n.ErrorReson[n.ERR_SOCKET_RECONNECT_FAILED]="MCU自动重连失败,已经达到最大重连次数";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,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")}Object.defineProperty(t,"__esModule",{value:!0});var o=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}}(),a=n(13),s=r(a),u=n(14),l=r(u),f=function(){function e(){i(this,e)}return o(e,null,[{key:"isEmptyObject",value:function(e){for(var t in e)return!1;return!0}},{key:"arrayToJsonString",value:function(e){try{return JSON.stringify(e)}catch(e){console.log("arrayToJsonString error:"+e.message)}return null}},{key:"arrayFromJsonString",value:function(e){try{return JSON.parse(e)}catch(e){console.log("arrayFromJsonString error:"+e.message)}return null}},{key:"creatSoleNumberFromTimestamp",value:function(){var e=(new Date).getTime(),t=e%1e9;return t}},{key:"creatTimestamp",value:function(){var e=parseInt((new Date).getTime()/1e3);return e}},{key:"creatTimestampStr",value:function(){var e=new Date,t=""+e.getFullYear()+"-";return t+=e.getMonth()+1+"-",t+=e.getDate()+"-",t+=e.getHours()+"-",t+=e.getMinutes()+"-",t+=e.getSeconds()}},{key:"creatTimestampYMD",value:function(){var e=new Date,t=""+e.getFullYear(),n=""+(e.getMonth()+1),r=""+e.getDate();return n.length<2&&(n="0"+n),r.length<2&&(r="0"+r),t+n+r}},{key:"objectToBase64",value:function(e){try{var t=JSON.stringify(e),n=l.default.setBytesFromString(t),r=s.default.fromByteArray(n);return r}catch(e){return console.log("objectToBase64 err:"+e.message),""}return""}},{key:"objectFromBase64",value:function(e){try{var t=s.default.toByteArray(e),n=l.default.getStringFromBytes(t),r=JSON.parse(n);return r}catch(e){return console.log("objectFromBase64 err:"+e.message),null}return null}}]),e}(),d=f;t.default=d;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(f,"EngineUtils","D:/work/McuClient/src/EngineUtils.js"),__REACT_HOT_LOADER__.register(d,"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")}Object.defineProperty(t,"__esModule",{value:!0});var o=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}}(),a=n(1),s=r(a),u=n(2),l=r(u),f=n(4),d=r(f),c=s.default.getLoger("GlobalConfig"),h=function(){function e(){i(this,e),this._currentStatus=null}return o(e,null,[{key:"getCurrentStatus",value:function(){return null==this._currentStatus&&(this._currentStatus=this.statusCode_0),this._currentStatus}},{key:"setCurrentStatus",value:function(e){this._currentStatus=e}},{key:"getClassDetail",value:function(){return this.classDetail}},{key:"setClassDetail",value:function(e){this.classDetail=e}},{key:"getClassInfo",value:function(){var e={};return e.siteId=this.siteId,e.classId=this.classId,e.className=this.className,e.h5Module=this.h5Module,e.nodeId=this.nodeId,e.topNodeID=this.topNodeID,e.userRole=this.userRole,e.role=this.role,e.isHost=this.isHost,e.userId=this.userId,e.userName=this.userName,e.password=this.password,e.userType=this.userType,e.passwordRequired=this.passwordRequired,e.md5=this.md5,e.msType=this.msType,e.portal=this.portal,e.mcuDelay=this.mcuDelay,e.MCUServerIP=this.MCUServerIP,e.MCUServerPort=this.MCUServerPort,e.maxVideoChannels=this.maxVideoChannels,e.maxAudioChannels=this.maxAudioChannels,e.maxMediaChannels=this.maxMediaChannels,e.fps=this.fps,e.gop=this.gop,e.videoQuality=this.videoQuality,e}},{key:"setClassStatusInfo",value:function(e){if(c.log("setClassStatusInfo"),null==e)return void c.warn("classStatusInfo error,_data:",e);var t=e;this.siteId=t.siteId||this.siteId,this.classId=t.classId||this.classId,this.className=t.className||this.className,this.classType=t.classType||this.classType,this.classStatus=t.classStatus||this.classStatus,this.classStartTime=t.classStartTime||this.classStartTime,this.classStopTime=t.classStopTime||this.classStopTime,this.classTimestamp=t.classTimestamp||this.classTimestamp,this.classBeginTime=t.classBeginTime||this.classBeginTime,this.classEndTime=t.classEndTime||this.classEndTime,this.recordStatus=t.recordStatus||this.recordStatus,this.recordTimestamp=t.recordTimestamp||this.recordTimestamp,this.recordFileName=t.recordFileName||this.recordFileName,this.recordDownloadUrl=t.recordDownloadUrl||this.recordDownloadUrl}},{key:"setDocListPrepare",value:function(e){null!=e&&(this.docListPrepare=e)}},{key:"getDocListPrepare",value:function(){return this.docListPrepare}},{key:"setRecordList",value:function(e){null!=e&&(this.recordList=e)}},{key:"getRecordList",value:function(){return this.recordList}},{key:"setDocList",value:function(e){null!=e&&(this.docList=e)}},{key:"getDocList",value:function(){return this.docList}},{key:"setMsList",value:function(t){if(null!=t)if(e.siteId==e.siteId_letv){this.msList=[],this.pullRtmpList=[],this.hlsList=[];for(var n=t.length,r=0;r<n;r++){var i=t[r];i&&i.ip&&(i.ip.indexOf("pull.")>=0?this.pullRtmpList.push(i):i.ip.indexOf("lehls.")>=0?this.hlsList.push(i):this.msList.push(i))}c.log("msListAll->",t),c.log("msList->",this.msList),c.log("pullList->",this.pullRtmpList),c.log("hlsList->",this.hlsList)}else this.msList=t}},{key:"getMsList",value:function(){return this.msList}},{key:"setMcuList",value:function(e){null!=e&&(this.mcuList=e)}},{key:"getMcuList",value:function(){return this.mcuList}},{key:"setMusicList",value:function(e){null!=e&&(this.musicList=e)}},{key:"getMusicList",value:function(){return this.musicList}},{key:"setMusicListPrepare",value:function(e){null!=e&&(this.musicListPrepare=e)}},{key:"getMusicListPrepare",value:function(){return this.musicListPrepare}},{key:"setRsList",value:function(e){null!=e&&(this.rsList=e)}},{key:"getRsList",value:function(){return this.rsList}},{key:"classStatusInfo",get:function(){var e={};return e.siteId=this.siteId,e.classId=this.classId,e.className=this.className,e.classType=this.classType,e.classStatus=this.classStatus,e.classStartTime=this.classStartTime,e.classStopTime=this.classStopTime,e.classTimestamp=this.classTimestamp,e.recordPlaybackMaxTime=this.recordPlaybackMaxTime,e.classBeginTime=this.classBeginTime,e.classEndTime=this.classEndTime,e.recordStatus=this.recordStatus,e.recordTimestamp=this.recordTimestamp,e.recordFileName=this.recordFileName,e.recordDownloadUrl=this.recordDownloadUrl,e.serverTimestamp=this.serverTimestamp,e.activeDocId=this.activeDocId,e.activeDocCurPage=this.activeDocCurPage,e}},{key:"isHost",get:function(){return this.userRole==l.default.host}},{key:"isAssistant",get:function(){return this.userRole==l.default.assistant}},{key:"isPresenter",get:function(){return this.userRole==l.default.presenter}},{key:"isNormal",get:function(){return this.userRole==l.default.normal}},{key:"isInvisible",get:function(){return this.userRole==l.default.invisible}},{key:"serverTimestamp",get:function(){return d.default.creatTimestamp()}}]),e}();h.statusCode_0={code:0,message:"SDK 未初始化"},h.statusCode_1={code:1,message:"未加入课堂"},h.statusCode_2={code:2,message:"已经加入课堂"},h.statusCode_3={code:3,message:"已经离开课堂"},h.statusCode_4={code:4,message:"未知状态"},h.md5="",h.msType=1,h.messageDelay=!1,h.mcuDelay=0,h.docDelay=1600,h.portal="112.126.80.182:80",h.MCUServerIP="",h.MCUServerPort="",h.MS_PUBLISH_IP="",h.MS_PUBLISH_PORT="",h.MS_PLAY_RTMP_IP="",h.MS_PLAY_RTMP_PORT="",h.MS_PLAY_HLS_IP="",h.MS_PLAY_HLS_PORT="",h.RS_RECORD_PLAY_IP="",h.RS_RECORD_PLAY_PORT="",h.DOCServerIP="",h.DOCServerPort="",h.RecordServerIP="",h.RecordServerPort="",h.maxVideoChannels=0,h.maxAudioChannels=0,h.maxMediaChannels=0,h.hasCamera=!1,h.hasMicrophone=!1,h.deviceType=0,h.userIp="",h.userId=0,h.userName="",h.handUpTime=0,h.level=0,h.openCamera=0,h.openMicrophones=0,h.fps=15,h.gop=3,h.videoQuality=2,h.cameras=[],h.microphones=[],h.curCamera="",h.curMicrophone="",h.curVideoQuality=0,h.micGain=50,h.speakerVolume=50,h.micCode=0,h.audioRecords=[],h.videoRecords=[],h.status=0,h.mobileDirection=0,h.nodeId=0,h.passwordRequired=!1,h.password="",h.userType=8,h.userRole=l.default.normal,h.role=l.default.NR_NORMAL,h.h5Module=1,h.topNodeID=101,h.siteId="",h.className="",h.classId=0,h.classType=l.default.CLASS_TYPE_INTERACT,h.classStatus=l.default.CLASS_STATUS_WAIT,h.classStartTime="",h.classStopTime="",h.classBeginTime="",h.classEndTime="",h.classTimestamp=0,h.recordPlaybackMaxTime=0,h.recordStatus=!1,h.recordTimestamp=0,h.recordFileName="",h.recordDownloadUrl="",h.recordReplaytickValues={},h.isAutoStartClass=0,h.updateClassInfoDelay=30,h.msDynamicChooseIpDelay=15,h.activeDocId=0,h.activeDocCurPage=1,h.classAllParam={},h.classDetail={},h.docListPrepare=[],h.recordList=[],h.docList=[],h.mcuList=[],h.msList=[],h.musicList=[],h.musicListPrepare=[],h.rsList=[],h.pullRtmpList=[],h.hlsList=[],h.mcuListFromServer=[],h.msListFromServer=[],h.country="",h.city="",h.province="",h.isp="",h.mcuListAll=[],h.msListAll=[],h.isRecordPlayBack=!1,h.allowRecordMaxTime=14400,h.siteId_letv="shchuanbao";var p=h;t.default=p;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(c,"loger","D:/work/McuClient/src/GlobalConfig.js"),__REACT_HOT_LOADER__.register(h,"GlobalConfig","D:/work/McuClient/src/GlobalConfig.js"),__REACT_HOT_LOADER__.register(p,"default","D:/work/McuClient/src/GlobalConfig.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,a,s,u,l,f){var d=new _.RCSendDataPdu;return d.set("type",e),d.set("subType",t),d.set("initiator",n),d.set("confId",r),d.set("sessionId",i),d.set("channelId",o),d.set("upward",a),d.set("reliability",s),d.set("priority",u),d.set("peer",l),d.set("seg",f),d}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},a=n(50),s=r(a),u=n(45),l=r(u),f=n(15),d=r(f),c=n(11),h=r(c),p=s.default.newBuilder({convertFieldsToCamelCase:!0});s.default.loadProto(l.default,p);var _=p.build();_.decode_pdu=function(e){return _.RCSendDataPdu.decode(e)},_.create_join_class_request_pdu=function(e,t,n,r,o,a,s,u,l){return i(d.default.RCPDU_CONNECT_PROVIDER_REQUEST,e,t,n,r,o,!0,a,s,u,l)},_.create_uniform_pdu=function(e,t,n,r,o,a,s,u,l){return i(d.default.RCPDU_UNIFORM_SEND_DATA_REQUEST,e,t,n,r,o,!0,a,s,u,l)},_.create_normal_pdu=function(e,t,n,r,o,a,s,u,l,f){return i(d.default.RCPDU_SEND_DATA_REQUEST,e,t,n,r,o,a,s,u,l,f)},_.id2type=function(e){for(var t in d.default)if(d.default[t]===e)return t},_=o({},_,d.default,h.default);var E=_;t.default=E;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(p,"builder","D:/work/McuClient/src/pdus/index.js"),__REACT_HOT_LOADER__.register(_,"pdu","D:/work/McuClient/src/pdus/index.js"),__REACT_HOT_LOADER__.register(i,"create_pdu","D:/work/McuClient/src/pdus/index.js"),__REACT_HOT_LOADER__.register(E,"default","D:/work/McuClient/src/pdus/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,n){if(e){var r=this.MAPS["*"];r&&r.length&&r.forEach(function(r){r(e,t,n)});var i=this.MAPS[e];i&&i.length&&i.forEach(function(e){e(t,n)})}}}]),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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var 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),l=r(u),f=n(7),d=r(f),c=n(22),h=r(c),p=n(1),_=r(p),E=n(3),g=r(E),y=n(2),R=r(y),m=n(10),v=r(m),T=n(11),C=r(T),S=n(5),I=r(S),A=n(18),b=r(A),w=_.default.getLoger("Ape"),D=function(e){function t(e,n,r){i(this,t);var a=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return a._session_id=e,a._channel_id=e,a._session_name=n,a._session_tag=r,a._session_channels={},a._adapter_pdu=new l.default.RCAdapterPdu,a._classInfo=null,a._rCArrayBufferUtil=v.default,a._apeDelayed=!0,a._apeDelayedMsgs=[],a._apeDelayedTimer=0,a.on(l.default.RCPDU_SESSION_JOIN_RESPONSE,a._joinSessionHandler.bind(a)),a.on(l.default.RCPDU_CHANNEL_JOIN_RESPONSE,a._joinChannelHandler.bind(a)),a.on(l.default.RCPDU_REG_ADAPTER,a._pduMessageHandler.bind(a)),a.mcu=h.default,a.mcu.on(g.default.CLASS_JOIN_MCU_SUCCESS,a._mcuConferenceJoinSuccessHandler.bind(a)),a.mcu.registerApe(a),a.recordPlayBackParse=b.default,a.recordPlayBackParse.on(b.default.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS,a._joinRecordPlaybackSuccessHandler.bind(a)),a.recordPlayBackParse.registerApe(a),a}return a(t,e),s(t,[{key:"regResponsePduHandler",value:function(){}},{key:"stopApe",value:function(){w.log("stopApe==============================")}},{key:"_pduMessageHandler",value:function(e,t){var n=t||0;this._pduRegAdapterHandler(e,n)}},{key:"_pduRegAdapterHandler",value:function(e,t){for(var n=l.default.RCAdapterPdu.decode(e),r=n.item,i=r.length,o=0;o<i;++o){var a=r[o],s=a.type,u=a.itemData;if(l.default.RCPDU_REG_UPDATE_OBJ===s){var f=l.default.RCRegistryUpdateObjPdu.decode(u),d=f.subType,c=f.objId,h=f.userData;switch(w.log("REG OBJECT EVENT ->",l.default.id2type(d)),d){case l.default.RCPDU_REG_ROSTER_INSERT_PDU:w.log("RCPDU_REG_ROSTER_INSERT_PDU---->"),console.log(h);for(var p=l.default.RCRegistryRosterInsertItemPdu.decode(h),_=p.items,E=_.length,g=0;g<E;++g){var y=_[g],R=y.item_id,m=l.default.RCNodeInfoRecordPdu.decode(y.item_data);this.rosterInsertHandler(R,m)}break;case l.default.RCPDU_REG_ROSTER_DELETE_PDU:var v=l.default.RCRegistryRosterDeleteItemPdu.decode(h);this.rosterDelHandler(v.nodeId);break;case l.default.RCPDU_REG_ROSTER_UPDATE_PDU:for(var T=l.default.RCRegistryRosterUpdateItemPdu.decode(h),C=T.items,S=C.length,I=0;I<S;++I){var A=C[I],b=A.nodeId,D=l.default.RCNodeInfoRecordPdu.decode(A.nodeData);this.rosterUpdateHandler(b,D)}break;case l.default.RCPDU_REG_TABLE_INSERT_PDU:for(var P=l.default.RCRegistryTableInsertItemPdu.decode(h),O=P.items,N=O.length,U=0;U<N;++U){var L=O[U];this.tableInsertHandler(L.owner,L.itemIdx,L.itemData)}this.tableInsertApeHandler(O);break;case l.default.RCPDU_REG_TABLE_DELETE_PDU:var k=l.default.RCRegistryTableDeleteItemPdu.decode(h);this.tableDeleteHandler(c,k);break;case l.default.RCPDU_REG_TABLE_UPDATE_PDU:for(var M=l.default.RCRegistryTableUpdateItemPdu.decode(h),x=M.items,B=x.length,F=0;F<B;++F){var H=x[F];this.tableUpdateHandler(H.owner,H.itemIdx,H.itemData,t)}this.tableUpdateApeHandler(x);break;case l.default.RCPDU_REG_QUEUE_UPDATE_PDU:case l.default.RCPDU_REG_QUEUE_DELETE_PDU:case l.default.RCPDU_REG_QUEUE_INSERT_PDU:w.warn("REG QUEUE ARE IGNORED")}}else if(l.default.RCPDU_REG_RESPONSE_OBJ==s){var j=l.default.RCRegistryResponseObjPdu.decode(u);this.regResponsePduHandler(j)}}}},{key:"rosterInsertHandler",value:function(e,t){}},{key:"rosterUpdateHandler",value:function(e,t){}},{key:"rosterDelHandler",value:function(e){}},{key:"tableInsertHandler",value:function(e,t){}},{key:"tableUpdateHandler",value:function(e,t,n,r){}},{key:"tableUpdateApeHandler",value:function(e,t){}},{key:"tableInsertApeHandler",value:function(e,t){}},{key:"tableDeleteHandler",value:function(e,t){}},{key:"onJoinChannelHandlerSuccess",value:function(){}},{key:"onJoinSessionHandlerSuccess",value:function(){}},{key:"_joinSessionHandler",value:function(e){this.onJoinSessionHandlerSuccess()}},{key:"_joinChannelHandler",value:function(e){var t=l.default.RCChannelJoinResponsePdu.decode(e);t.result===l.default.RET_SUCCESS?(w.log(this._session_name," -> 加入Channel成功. ChannelId",t.requestedChannelId),this._session_channels[t.requestedChannelId]=R.default.CJS_JOINNED,this.onJoinChannelHandlerSuccess()):w.log(this._session_name," -> 加入Channel失败.",t)}},{key:"_mcuConferenceJoinSuccessHandler",value:function(e){w.log("创建Ape->","SessionId",this._session_id,"SessionName",this._session_name,"SessionTag",this._session_tag),this._classInfo=I.default.getClassInfo();var t=new l.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 l.default.RCChannelJoinRequestPdu;n.initiator=this.mcu.classInfo.nodeId,n.channelId=this._session_id,this.send(n)}},{key:"_joinRecordPlaybackSuccessHandler",value:function(e){w.log("录制回放->Ape已经创建完毕->","SessionId",this._session_id,"SessionName",this._session_name,"SessionTag",this._session_tag)}},{key:"registerKey",value:function(e,t,n,r){var i=new l.default.RCAdapterItemPdu;i.type=l.default.RCPDU_REG_REGISTER_KEY;var o=new l.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 a=new l.default.RCAdapterItemPdu;a.type=l.default.RCPDU_REG_REGISTER_OBJ;var s=new l.default.RCRegistryRegisterObjPdu;s.type=e,s.objId=t,s.name=n,s.tag=r,i&&(s.owner=i),o.length&&(s.userData=o),a.itemData=s.toArrayBuffer(),this._adapter_pdu.item.push(a)}},{key:"send",value:function(e){if(w.log("Ape发送数据NORMAL PDU"),0==I.default.getCurrentStatus().code||1==I.default.getCurrentStatus().code)return void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_SEND_FAILED_NO_JOIN);var t=l.default.create_normal_pdu(e.type,this._classInfo.nodeId,this._classInfo.classId,this._session_id,this._channel_id,!0,!0,C.default.DP_TOP,this._classInfo.topNodeID,C.default.SEG_ONCE); -t.data=e.toArrayBuffer(),this.mcu.send(t)}},{key:"sendUniform",value:function(e,t){if(w.log("Ape发送数据UNIFORM PDU"),0==I.default.getCurrentStatus().code||1==I.default.getCurrentStatus().code)return void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_SEND_FAILED_NO_JOIN);var n=l.default.create_uniform_pdu(e.type,this._classInfo.nodeId,this._classInfo.classId,this._session_id,t?R.default.BROADCAST_CHANNEL_ID:this._channel_id,!0,C.default.DP_TOP,t?this._classInfo.topNodeID:e.peer||0,C.default.SEG_ONCE);n.data=e.toArrayBuffer(),this.mcu.send(n)}},{key:"sendChatUniform",value:function(e,t){if(0==I.default.getCurrentStatus().code||1==I.default.getCurrentStatus().code)return void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_SEND_FAILED_NO_JOIN);var n=l.default.create_uniform_pdu(e.type,this._classInfo.nodeId,this._classInfo.classId,this._session_id,t?R.default.BROADCAST_CHANNEL_ID:this._channel_id,!0,C.default.DP_TOP,0,C.default.SEG_ONCE);n.data=e.toArrayBuffer(),w.log("Ape发送数据UNIFORM PDU",n),this.mcu.send(n)}}]),t}(d.default),P=D;t.default=P;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(w,"loger","D:/work/McuClient/src/apes/Ape.js"),__REACT_HOT_LOADER__.register(D,"Ape","D:/work/McuClient/src/apes/Ape.js"),__REACT_HOT_LOADER__.register(P,"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(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,a=void 0,s=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:a=e.view[r++],n+=String.fromCharCode((31&o)<<6|63&a);break;case 14:a=e.view[r++],s=e.view[r++],n+=String.fromCharCode((15&o)<<12|(63&a)<<6|(63&s)<<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){"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/pdus/PduConsts.js")})()},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},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,a,s,u=e.length;a=n(e),s=new f(3*u/4-a),i=a>0?u-4:u;var d=0;for(t=0,r=0;t<i;t+=4,r+=3)o=l[e.charCodeAt(t)]<<18|l[e.charCodeAt(t+1)]<<12|l[e.charCodeAt(t+2)]<<6|l[e.charCodeAt(t+3)],s[d++]=o>>16&255,s[d++]=o>>8&255,s[d++]=255&o;return 2===a?(o=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,s[d++]=255&o):1===a&&(o=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,s[d++]=o>>8&255,s[d++]=255&o),s}function o(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function a(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16)+(e[a+1]<<8)+e[a+2],i.push(o(r));return i.join("")}function s(e){for(var t,n=e.length,r=n%3,i="",o=[],s=16383,l=0,f=n-r;l<f;l+=s)o.push(a(e,l,l+s>f?f:l+s));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=s;for(var u=[],l=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,h=d.length;c<h;++c)u[c]=d[c],l[d.charCodeAt(c)]=c;l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},function(e,t,n){(function(e){e.require&&(n(30),n(51));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,a=[];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 a.push(String.fromCodePoint(t.getCharCode(e,n,o,i)));n+=o-1}return a.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 a=0,s=e.length;a<s;a++){var u=t.getBytesForCharCode(e[a].codePointAt(0));if(o&&r+u>i)throw new Error('Not enought bytes to encode the char "'+e[a]+'" at the offset "'+r+'".');t.setBytesFromCharCode(e[a].codePointAt(0),n,r,u,o),r+=u}return n}};e.exports=t}).call(t,n(9)(e))},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_UNIFORM_SEND_DATA_REQUEST=125,n.RCPDU_SEND_DATA_REQUEST=120,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_INDICATION=121,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_CONFERENCE_RECORD_REQUEST=270,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,n.RCPDU_SEND_CONFERENCE_DATA_REQUEST=500,n.RCPDU_SEND_VIDEO_DATA_REQUEST=501,n.RCPDU_SEND_AUDIO_DATA_REQUEST=502,n.RCPDU_SEND_GIFT_DATA_REQUEST=503,n.RCPDU_SEND_CHAT_DATA_REQUEST=504,n.RCPDU_THIRD_BROADCAST_DATA_REQUEST=505,n.RCPDU_SEND_DOC_BROADCAST_DATA_REQUEST=506;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&__REACT_HOT_LOADER__.register(n,"RCPduPackage","D:/work/McuClient/src/pdus/PduType.js")})()},function(e,t,n){var r,i,o;(function(e){!function(a,s){n(12).amd?(i=[],r=s,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(e.exports=o))):"object"==typeof e&&e&&e.exports?e.exports=s():(a.dcodeIO=a.dcodeIO||{}).Long=s()}(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=s[e])?r:(n=i(e,e<0?-1:0,!1),o&&(s[e]=n),n))}function r(e,t){if(isNaN(e)||!isFinite(e))return t?E:_;if(t){if(e<0)return E;if(e>=c)return v}else{if(e<=-h)return T;if(e+1>=h)return m}return e<0?r(-e,t).neg():i(e%d|0,e/d|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 a=r(l(n,8)),s=_,u=0;u<e.length;u+=8){var f=Math.min(8,e.length-u),d=parseInt(e.substring(u,u+f),n);if(f<8){var c=r(l(n,f));s=s.mul(c).add(r(d))}else s=s.mul(a),s=s.add(r(d))}return s.unsigned=t,s}function a(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 s={},u={};e.fromInt=n,e.fromNumber=r,e.fromBits=i;var l=Math.pow;e.fromString=o,e.fromValue=a;var f=1<<24,d=4294967296,c=0x10000000000000000,h=c/2,p=n(f),_=n(0);e.ZERO=_;var E=n(0,!0);e.UZERO=E;var g=n(1);e.ONE=g;var y=n(1,!0);e.UONE=y;var R=n(-1);e.NEG_ONE=R;var m=i(-1,2147483647,!1);e.MAX_VALUE=m;var v=i(-1,-1,!0);e.MAX_UNSIGNED_VALUE=v;var T=i(0,-2147483648,!1);e.MIN_VALUE=T;var C=e.prototype;return C.toInt=function(){return this.unsigned?this.low>>>0:this.low},C.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},C.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(T)){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(l(e,6),this.unsigned),a=this,s="";;){var u=a.div(o),f=a.sub(u.mul(o)).toInt()>>>0,d=f.toString(e);if(a=u,a.isZero())return d+s;for(;d.length<6;)d="0"+d;s=""+d+s}},C.getHighBits=function(){return this.high},C.getHighBitsUnsigned=function(){return this.high>>>0},C.getLowBits=function(){return this.low},C.getLowBitsUnsigned=function(){return this.low>>>0},C.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?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},C.isZero=function(){return 0===this.high&&0===this.low},C.isNegative=function(){return!this.unsigned&&this.high<0},C.isPositive=function(){return this.unsigned||this.high>=0},C.isOdd=function(){return 1===(1&this.low)},C.isEven=function(){return 0===(1&this.low)},C.equals=function(e){return t(e)||(e=a(e)),(this.unsigned===e.unsigned||this.high>>>31!==1||e.high>>>31!==1)&&(this.high===e.high&&this.low===e.low)},C.eq=C.equals,C.notEquals=function(e){return!this.eq(e)},C.neq=C.notEquals,C.lessThan=function(e){return this.comp(e)<0},C.lt=C.lessThan,C.lessThanOrEqual=function(e){return this.comp(e)<=0},C.lte=C.lessThanOrEqual,C.greaterThan=function(e){return this.comp(e)>0},C.gt=C.greaterThan,C.greaterThanOrEqual=function(e){return this.comp(e)>=0},C.gte=C.greaterThanOrEqual,C.compare=function(e){if(t(e)||(e=a(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},C.comp=C.compare,C.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(g)},C.neg=C.negate,C.add=function(e){t(e)||(e=a(e));var n=this.high>>>16,r=65535&this.high,o=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,f=e.low>>>16,d=65535&e.low,c=0,h=0,p=0,_=0;return _+=s+d,p+=_>>>16,_&=65535,p+=o+f,h+=p>>>16,p&=65535,h+=r+l,c+=h>>>16,h&=65535,c+=n+u,c&=65535,i(p<<16|_,c<<16|h,this.unsigned)},C.subtract=function(e){return t(e)||(e=a(e)),this.add(e.neg())},C.sub=C.subtract,C.multiply=function(e){if(this.isZero())return _;if(t(e)||(e=a(e)),e.isZero())return _;if(this.eq(T))return e.isOdd()?T:_;if(e.eq(T))return this.isOdd()?T:_;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(p)&&e.lt(p))return r(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,o=65535&this.high,s=this.low>>>16,u=65535&this.low,l=e.high>>>16,f=65535&e.high,d=e.low>>>16,c=65535&e.low,h=0,E=0,g=0,y=0;return y+=u*c,g+=y>>>16,y&=65535,g+=s*c,E+=g>>>16,g&=65535,g+=u*d,E+=g>>>16,g&=65535,E+=o*c,h+=E>>>16,E&=65535,E+=s*d,h+=E>>>16,E&=65535,E+=u*f,h+=E>>>16,E&=65535,h+=n*c+o*d+s*f+u*l,h&=65535,i(g<<16|y,h<<16|E,this.unsigned)},C.mul=C.multiply,C.divide=function(e){if(t(e)||(e=a(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?E:_;var n,i,o;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return E;if(e.gt(this.shru(1)))return y;o=E}else{if(this.eq(T)){if(e.eq(g)||e.eq(R))return T;if(e.eq(T))return g;var s=this.shr(1);return n=s.div(e).shl(1),n.eq(_)?e.isNegative()?g:R:(i=this.sub(e.mul(n)),o=n.add(i.div(e)))}if(e.eq(T))return this.unsigned?E:_;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),f=u<=48?1:l(2,u-48),d=r(n),c=d.mul(e);c.isNegative()||c.gt(i);)n-=f,d=r(n,this.unsigned),c=d.mul(e);d.isZero()&&(d=g),o=o.add(d),i=i.sub(c)}return o},C.div=C.divide,C.modulo=function(e){return t(e)||(e=a(e)),this.sub(this.div(e).mul(e))},C.mod=C.modulo,C.not=function(){return i(~this.low,~this.high,this.unsigned)},C.and=function(e){return t(e)||(e=a(e)),i(this.low&e.low,this.high&e.high,this.unsigned)},C.or=function(e){return t(e)||(e=a(e)),i(this.low|e.low,this.high|e.high,this.unsigned)},C.xor=function(e){return t(e)||(e=a(e)),i(this.low^e.low,this.high^e.high,this.unsigned)},C.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)},C.shl=C.shiftLeft,C.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)},C.shr=C.shiftRight,C.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)},C.shru=C.shiftRightUnsigned,C.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},C.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},C.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},C.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]},C.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(9)(e))},function(e,t,n){!function(){var t=n(46),r=n(26).utf8,i=n(48),o=n(26).bin,a=function(e,n){e.constructor==String?e=n&&"binary"===n.encoding?o.stringToBytes(e):r.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());for(var s=t.bytesToWords(e),u=8*e.length,l=1732584193,f=-271733879,d=-1732584194,c=271733878,h=0;h<s.length;h++)s[h]=16711935&(s[h]<<8|s[h]>>>24)|4278255360&(s[h]<<24|s[h]>>>8);s[u>>>5]|=128<<u%32,s[(u+64>>>9<<4)+14]=u;for(var p=a._ff,_=a._gg,E=a._hh,g=a._ii,h=0;h<s.length;h+=16){var y=l,R=f,m=d,v=c;l=p(l,f,d,c,s[h+0],7,-680876936),c=p(c,l,f,d,s[h+1],12,-389564586),d=p(d,c,l,f,s[h+2],17,606105819),f=p(f,d,c,l,s[h+3],22,-1044525330),l=p(l,f,d,c,s[h+4],7,-176418897),c=p(c,l,f,d,s[h+5],12,1200080426),d=p(d,c,l,f,s[h+6],17,-1473231341),f=p(f,d,c,l,s[h+7],22,-45705983),l=p(l,f,d,c,s[h+8],7,1770035416),c=p(c,l,f,d,s[h+9],12,-1958414417),d=p(d,c,l,f,s[h+10],17,-42063),f=p(f,d,c,l,s[h+11],22,-1990404162),l=p(l,f,d,c,s[h+12],7,1804603682),c=p(c,l,f,d,s[h+13],12,-40341101),d=p(d,c,l,f,s[h+14],17,-1502002290),f=p(f,d,c,l,s[h+15],22,1236535329),l=_(l,f,d,c,s[h+1],5,-165796510),c=_(c,l,f,d,s[h+6],9,-1069501632),d=_(d,c,l,f,s[h+11],14,643717713),f=_(f,d,c,l,s[h+0],20,-373897302),l=_(l,f,d,c,s[h+5],5,-701558691),c=_(c,l,f,d,s[h+10],9,38016083),d=_(d,c,l,f,s[h+15],14,-660478335),f=_(f,d,c,l,s[h+4],20,-405537848),l=_(l,f,d,c,s[h+9],5,568446438),c=_(c,l,f,d,s[h+14],9,-1019803690),d=_(d,c,l,f,s[h+3],14,-187363961),f=_(f,d,c,l,s[h+8],20,1163531501),l=_(l,f,d,c,s[h+13],5,-1444681467),c=_(c,l,f,d,s[h+2],9,-51403784),d=_(d,c,l,f,s[h+7],14,1735328473),f=_(f,d,c,l,s[h+12],20,-1926607734),l=E(l,f,d,c,s[h+5],4,-378558),c=E(c,l,f,d,s[h+8],11,-2022574463),d=E(d,c,l,f,s[h+11],16,1839030562),f=E(f,d,c,l,s[h+14],23,-35309556),l=E(l,f,d,c,s[h+1],4,-1530992060),c=E(c,l,f,d,s[h+4],11,1272893353),d=E(d,c,l,f,s[h+7],16,-155497632),f=E(f,d,c,l,s[h+10],23,-1094730640),l=E(l,f,d,c,s[h+13],4,681279174),c=E(c,l,f,d,s[h+0],11,-358537222),d=E(d,c,l,f,s[h+3],16,-722521979),f=E(f,d,c,l,s[h+6],23,76029189),l=E(l,f,d,c,s[h+9],4,-640364487),c=E(c,l,f,d,s[h+12],11,-421815835),d=E(d,c,l,f,s[h+15],16,530742520),f=E(f,d,c,l,s[h+2],23,-995338651),l=g(l,f,d,c,s[h+0],6,-198630844),c=g(c,l,f,d,s[h+7],10,1126891415),d=g(d,c,l,f,s[h+14],15,-1416354905),f=g(f,d,c,l,s[h+5],21,-57434055),l=g(l,f,d,c,s[h+12],6,1700485571),c=g(c,l,f,d,s[h+3],10,-1894986606),d=g(d,c,l,f,s[h+10],15,-1051523),f=g(f,d,c,l,s[h+1],21,-2054922799),l=g(l,f,d,c,s[h+8],6,1873313359),c=g(c,l,f,d,s[h+15],10,-30611744),d=g(d,c,l,f,s[h+6],15,-1560198380),f=g(f,d,c,l,s[h+13],21,1309151649),l=g(l,f,d,c,s[h+4],6,-145523070),c=g(c,l,f,d,s[h+11],10,-1120210379),d=g(d,c,l,f,s[h+2],15,718787259),f=g(f,d,c,l,s[h+9],21,-343485551),l=l+y>>>0,f=f+R>>>0,d=d+m>>>0,c=c+v>>>0}return t.endian([l,f,d,c])};a._ff=function(e,t,n,r,i,o,a){var s=e+(t&n|~t&r)+(i>>>0)+a;return(s<<o|s>>>32-o)+t},a._gg=function(e,t,n,r,i,o,a){var s=e+(t&r|n&~r)+(i>>>0)+a;return(s<<o|s>>>32-o)+t},a._hh=function(e,t,n,r,i,o,a){var s=e+(t^n^r)+(i>>>0)+a;return(s<<o|s>>>32-o)+t},a._ii=function(e,t,n,r,i,o,a){var s=e+(n^(t|~r))+(i>>>0)+a;return(s<<o|s>>>32-o)+t},a._blocksize=16,a._digestsize=16,e.exports=function(e,n){if(void 0===e||null===e)throw new Error("Illegal argument "+e);var r=t.wordsToBytes(a(e,n));return n&&n.asBytes?r:n&&n.asString?o.bytesToString(r):t.bytesToHex(r)}}()},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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var 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(44),l=r(u),f=n(7),d=r(f),c=n(3),h=r(c),p=n(1),_=r(p),E=n(6),g=r(E),y=n(15),R=r(y),m=n(11),v=r(m),T=n(2),C=r(T),S=n(10),I=(r(S),n(13)),A=(r(I),n(5)),b=r(A),w=n(4),D=(r(w),n(19)),P=r(D),O=void 0,N=_.default.getLoger("RecordPlayBackParse"),U=0,L=1,k=2,M=3,x=4,B=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return O=new l.default(l.default.DEFAULT_CAPACITY,l.default.LITTLE_ENDIAN),O.clear(),e._recordPlaybackTimestamp=0,e._recordPlaybackMaxTime=0,e._isReady=!1,e._apes={},e._conferApeMssages={},e._chatApeMssages={},e._videoApeMssages={},e._audioApeMssages={},e._docApeMssages={},e._whiteApeMssages={},e._timerCounter=new P.default,e._timerCounter.addTimerCallBack(e._timerCounterUptate.bind(e),1),e}return a(t,e),s(t,[{key:"registerApe",value:function(e){this._apes[e._session_id]=e}},{key:"initReplay",value:function(){this._stopTimerCounter(),this._recordPlaybackTimestamp=0,this._recordPlaybackMaxTime=0,this._isReady=!1,this._conferApeMssages={},this._chatApeMssages={},this._videoApeMssages={},this._audioApeMssages={},this._docApeMssages={},this._whiteApeMssages={}}},{key:"_everSocketMsgReceivedHandler",value:function(e,t){var n=g.default.decode_pdu(e),r=n.get("type"),i=n.get("data");switch(r==R.default.RCPDU_UNIFORM_SEND_DATA_REQUEST&&(n.type=R.default.RCPDU_SEND_DATA_REQUEST,r=R.default.RCPDU_SEND_DATA_REQUEST),N.log("_everSocketMsgReceivedHandler->pduType",r,"seekTime->",t),r){case R.default.RCPDU_CONNECT_PROVIDER_RESPONSE:var o=g.default.RCConferenceJoinResponsePdu.decode(i),a=o.result;switch(N.warn("RCPDU_CONNECT_PROVIDER_RESPONSE ->pduResultCode:"+a),a){case v.default.RET_SUCCESS:this._emit(h.default.CLASS_JOIN_MCU_SUCCESS,this.classInfo);break;case v.default.RET_FULL_CAPACITY:this._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_JOIN_FULL);break;default:N.warn("JoinConfPdu-未知类型-等待处理.",a)}break;case R.default.RCPDU_SEND_DATA_REQUEST:var s=this._apes[n.sessionId],u=(0,C.default)(n.sessionId);if(s){g.default.id2type(n.subType);s._emit(n.subType,n.data,t)}else N.warn(u+"尚未注册");break;default:N.warn("PDU-未知类型-等待处理.",r)}}},{key:"_parseSaveSocketMsgReceivedHandler",value:function(e,t){var n=g.default.decode_pdu(e),r=n.get("type"),i=n.get("data");switch(r==R.default.RCPDU_UNIFORM_SEND_DATA_REQUEST&&(n.type=R.default.RCPDU_SEND_DATA_REQUEST,r=R.default.RCPDU_SEND_DATA_REQUEST),r){case R.default.RCPDU_CONNECT_PROVIDER_RESPONSE:var o=g.default.RCConferenceJoinResponsePdu.decode(i),a=o.result;switch(N.warn("RCPDU_CONNECT_PROVIDER_RESPONSE ->pduResultCode:"+a),a){case v.default.RET_SUCCESS:this._emit(h.default.CLASS_JOIN_MCU_SUCCESS,this.classInfo);break;case v.default.RET_FULL_CAPACITY:this._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_JOIN_FULL);break;default:N.warn("JoinConfPdu-未知类型-等待处理.",a)}break;case R.default.RCPDU_SEND_DATA_REQUEST:this._apes[n.sessionId],(0,C.default)(n.sessionId);switch(n.sessionId){case C.default.CONFERENCE_SESSION_ID:this.saveParseData(e,t,this._conferApeMssages);break;case C.default.CHAT_SESSION_ID:this.saveParseData(e,t,this._chatApeMssages);break;case C.default.DOCSHARING_SESSION_ID:this.saveParseData(e,t,this._docApeMssages);break;case C.default.WHITEBOARD_SESSION_ID:this.saveParseData(e,t,this._whiteApeMssages);break;case C.default.VIDEO_SESSION_ID:this.saveParseData(e,t,this._videoApeMssages);break;case C.default.AUDIO_SESSION_ID:this.saveParseData(e,t,this._audioApeMssages)}break;default:N.warn("PDU-未知类型-等待处理.",r)}}},{key:"saveParseData",value:function(e,t,n){var r=n[t];r||(n[t]=[],r=n[t]),r.push({timestamp:t,byteData:e})}},{key:"_startTimerCounter",value:function(){this._timerCounter&&this._timerCounter.startTimer()}},{key:"_stopTimerCounter",value:function(){this._timerCounter&&this._timerCounter.stopTimer()}},{key:"_timerCounterUptate",value:function(){return this._recordPlaybackTimestamp=this._recordPlaybackTimestamp+1,N.log("录制回放中...",this._recordPlaybackTimestamp),this._emit(h.default.CLASS_UPDATE_TIMER,{classTimestamp:this._recordPlaybackTimestamp}),this._recordPlaybackTimestamp>=this._recordPlaybackMaxTime?(N.log("录制回放结束...当前时间->",this._recordPlaybackTimestamp," 总时间->",this._recordPlaybackMaxTime),void this.stopRecordPlayback()):(this._searchMessageFromTime(this._recordPlaybackTimestamp,this._conferApeMssages,"conferApe"),this._searchMessageFromTime(this._recordPlaybackTimestamp,this._chatApeMssages,"chatApe"),this._searchMessageFromTime(this._recordPlaybackTimestamp,this._docApeMssages,"docApe"),this._searchMessageFromTime(this._recordPlaybackTimestamp,this._whiteApeMssages,"whiteApe"),this._searchMessageFromTime(this._recordPlaybackTimestamp,this._videoApeMssages,"videoAp"),void this._searchMessageFromTime(this._recordPlaybackTimestamp,this._audioApeMssages,"audioApe"))}},{key:"readyRecordPlay",value:function(){var e=this;this.initReplay(),N.log("读取回放数据");var t="http://"+b.default.RecordServerIP+":"+b.default.RecordServerPort+"/"+b.default.recordFileName;N.log(t),fetch(t,{timeout:18e4}).then(function(t){if(t.ok)return t.arrayBuffer();throw N.error("读取回放数据-网络异常.状态码:"+t.status),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_RECORD_PLAY_BACK_DATA_FAILED),""}).then(function(t){t?(N.log("读取回放数据-完成"),e._loadRecordDataSuccess(t)):(N.warn("读取回放数据-失败."),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_RECORD_PLAY_BACK_DATA_FAILED))}).catch(function(t){N.error("读取回放数据.状态码:"+t),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_RECORD_PLAY_BACK_DATA_FAILED)})}},{key:"_loadRecordDataSuccess",value:function(e){N.log("获取录制回放数据的长度",e.byteLength),O&&(O.clear(),O.append(e),this.parseArrayBuf())}},{key:"parseArrayBuf",value:function(){var e=O.offset;O.byteOffset=0;for(var n=0;n<e;){var r=O.readUInt32(n);n+=4;var i=O.readUInt32(n);n+=4;var o=O.buffer.slice(n,n+i);n+=i,this._parseSaveSocketMsgReceivedHandler(o,r),this._recordPlaybackMaxTime=r}this._recordPlaybackTimestamp=0,this._isReady=!0,this._stopTimerCounter(),this._recordPlaybackMaxTime<b.default.recordTimestamp&&(this._recordPlaybackMaxTime=b.default.recordTimestamp),b.default.recordPlaybackMaxTime=this._recordPlaybackMaxTime,N.log("录制回放数据解析完成,录制回放的总时间长为->",this._recordPlaybackMaxTime),this._emit(t.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS,{recordPlaybackMaxTime:this._recordPlaybackMaxTime})}},{key:"_searchMessageFromTime",value:function(e,t,n){var r=t[e];if(r){N.log(n,"回放数据->",r.length);for(var i=0;i<r.length;i++)this._everSocketMsgReceivedHandler(r[i].byteData,0)}else;}},{key:"startRecordPlayback",value:function(e){return this._isReady?(N.log("classStatusInfo",b.default.classStatusInfo),this._startTimerCounter(),void this._emit(h.default.RECORD_PLAYBACK_UPDATE,{status:L})):{code:C.default.RETURN_FAILED,data:"录制回放还未准备完成"}}},{key:"stopRecordPlayback",value:function(e){this._stopTimerCounter(),this._recordPlaybackTimestamp=0,b.default.activeDocId=0,b.default.activeDocCurPage=1,this._emit(t.RECORD_PLAYBACK_CLEAR_DATA),this._emit(h.default.RECORD_PLAYBACK_UPDATE,{status:x})}},{key:"pauseRecordPlayback",value:function(e){this._stopTimerCounter(),this._emit(h.default.RECORD_PLAYBACK_UPDATE,{status:k})}},{key:"seekRecordPlayback",value:function(e){return this._isReady?e&&e.time?(this._stopTimerCounter(),this._recordPlaybackTimestamp=e.time||0,b.default.activeDocId=0,b.default.activeDocCurPage=1,this._emit(t.RECORD_PLAYBACK_CLEAR_DATA),void this._searchKeyfram()):{code:C.default.RETURN_FAILED,data:"参数不正确"}:{code:C.default.RETURN_FAILED,data:"录制回放还未准备完成"}}},{key:"_searchKeyfram",value:function(){this._searchApeMessageKeyfram(this._conferApeMssages,C.default.CONFERENCE_SESSION_ID),this._searchApeMessageKeyfram(this._docApeMssages,C.default.DOCSHARING_SESSION_ID),this._searchApeMessageKeyfram(this._videoApeMssages,C.default.VIDEO_SESSION_ID),this._searchApeMessageKeyfram(this._audioApeMssages,C.default.AUDIO_SESSION_ID),this._searchChatHistoryMessageKeyfram(this._chatApeMssages,C.default.CHAT_SESSION_ID),this._searchWhiteboradHistoryMessageKeyfram(this._whiteApeMssages,C.default.WHITEBOARD_SESSION_ID),this._startTimerCounter()}},{key:"_searchApeMessageKeyfram",value:function(e,t){for(var n=void 0,r=0,i=this._recordPlaybackTimestamp;i>0;i--)if(n=e[i]){r=this._recordPlaybackTimestamp-i,N.log("SEEK->APE",(0,C.default)(t),this._recordPlaybackTimestamp,"查找到相连的timestamp->",i,"需要seek->",r,"秒");for(var o=0;o<n.length;o++)this._everSocketMsgReceivedHandler(n[o].byteData,r);return void(t!=C.default.AUDIO_SESSION_ID&&t!=C.default.VIDEO_SESSION_ID||this._emit(h.default.RECORD_PLAYBACK_UPDATE,{status:M,keyFrameSeekTime:r}))}N.log("SEEK->APE",(0,C.default)(t),this._recordPlaybackTimestamp,"没有查找到相连的数据")}},{key:"_searchChatHistoryMessageKeyfram",value:function(e){for(var t=0,n=void 0,r=[],i=this._recordPlaybackTimestamp;i>0;i--)if(n=e[i])for(var o=0;o<n.length;o++)if(r.push(n[o].byteData),t++,t>30){N.warn("SEEK->最多处理历史消息30条");break}var a=r.length;if(a>0)for(var s=a-1;s>=0;s--)this._everSocketMsgReceivedHandler(r[s],0)}},{key:"_searchWhiteboradHistoryMessageKeyfram",value:function(e){for(var t=0,n=void 0,r=this._recordPlaybackTimestamp;r>0;r--)if(n=e[r])for(var i=0;i<n.length;i++)if(this._everSocketMsgReceivedHandler(n[i].byteData,0), -t++,t>30)return void N.warn("SEEK->最多处理历史消息30条")}}]),t}(d.default);B.prototype.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS=B.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS="class_join_recordPlayback_success",B.prototype.RECORD_PLAYBACK_CLEAR_DATA=B.RECORD_PLAYBACK_CLEAR_DATA="record_playback_clear_data";var F=new B;t.default=F;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(O,"parseBuffer","D:/work/McuClient/src/RecordPlayBackParse.js"),__REACT_HOT_LOADER__.register(N,"loger","D:/work/McuClient/src/RecordPlayBackParse.js"),__REACT_HOT_LOADER__.register(U,"Default","D:/work/McuClient/src/RecordPlayBackParse.js"),__REACT_HOT_LOADER__.register(L,"PLAY","D:/work/McuClient/src/RecordPlayBackParse.js"),__REACT_HOT_LOADER__.register(k,"PAUSE","D:/work/McuClient/src/RecordPlayBackParse.js"),__REACT_HOT_LOADER__.register(M,"SEEK","D:/work/McuClient/src/RecordPlayBackParse.js"),__REACT_HOT_LOADER__.register(x,"STOP","D:/work/McuClient/src/RecordPlayBackParse.js"),__REACT_HOT_LOADER__.register(B,"RecordPlayBackParse","D:/work/McuClient/src/RecordPlayBackParse.js"),__REACT_HOT_LOADER__.register(F,"default","D:/work/McuClient/src/RecordPlayBackParse.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.timer=0,this.delay=1e3,this.counter=0,this.callBackDelay=1,this.callBackFun=null,this.isStart=!1}return r(e,[{key:"addTimerCallBack",value:function(e,t){this.callBackFun=e,this.callBackDelay=t}},{key:"startTimer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.isStart||(this.isStart=!0,e&&parseInt(e)>0?this.counter=e:this.counter=0,console.log("startTimer",this.counter),this.timerClear(),this.timerStart())}},{key:"stopTimer",value:function(){this.isStart&&(console.log("stopTimer",this.counter),this.isStart=!1,this.timerClear())}},{key:"updateCounter",value:function(){this.counter++,null!=this.callBackFun&&this.counter%this.callBackDelay==0&&this.callBackFun()}},{key:"timerStart",value:function(){this.timer=setInterval(this.updateCounter.bind(this),this.delay)}},{key:"timerClear",value:function(){clearInterval(this.timer)}}]),e}(),o=i;t.default=o;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"TimerCounter","D:/work/McuClient/src/TimerCounter.js"),__REACT_HOT_LOADER__.register(o,"default","D:/work/McuClient/src/TimerCounter.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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var 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(8),l=r(u),f=n(2),d=r(f),c=n(3),h=r(c),p=n(6),_=r(p),E=(n(31),n(14)),g=(r(E),n(1)),y=r(g),R=n(5),m=r(R),v=n(4),T=r(v),C=n(19),S=r(C),I=y.default.getLoger("ConferApe"),A=0,b=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,d.default.CONFERENCE_SESSION_ID,d.default.CONFERENCE_SESSION_NAME,d.default.CONFERENCE_SESSION_TAG));return e.rosters={},e.timerCounter=new S.default,e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(_.default.RCPDU_REG_REGISTER_ROSTER,d.default.CONFERENCE_OBJ_ROSTER_ID,d.default.CONFERENCE_OBJ_ROSTER_NAME,d.default.CONFERENCE_OBJ_ROSTER_TAG,0,new ArrayBuffer),e.registerObj(_.default.RCPDU_REG_REGISTER_QUEUE,d.default.CONFERENCE_OBJ_QUEUE_ID,d.default.CONFERENCE_OBJ_QUEUE_NAME,d.default.CONFERENCE_OBJ_QUEUE_TAG,0,new ArrayBuffer),e.registerObj(_.default.RCPDU_REG_REGISTER_TABLE,d.default.CONFERENCE_OBJ_TABLE_ID,d.default.CONFERENCE_OBJ_TABLE_NAME,d.default.CONFERENCE_OBJ_TABLE_TAG,0,new ArrayBuffer),e.registerObj(_.default.RCPDU_REG_REGISTER_COUNTER,d.default.CONFERENCE_OBJ_COUNTER_ID,d.default.CONFERENCE_OBJ_COUNTER_NAME,d.default.CONFERENCE_OBJ_COUNTER_TAG,0,new ArrayBuffer),e.on(_.default.RCPDU_SESSION_JOIN_RESPONSE,e._joinSessionHandler.bind(e)),e.on(_.default.RCPDU_SEND_CONFERENCE_DATA_REQUEST,e.conferMsgComingHandler.bind(e)),e.on(_.default.RCPDU_CONFERENCE_RECORD_REQUEST,e.onSendConferRecordRequestHandler.bind(e)),e}return a(t,e),s(t,[{key:"_joinSessionHandler",value:function(e){var t=this.getNodeInfo(),n=new _.default.RCNodeInfoUserDataPdu;n.qq="",n.skype="",t.userData=n.toArrayBuffer(),t.deviceType=m.default.deviceType,I.log("开始加入->",t);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=d.default.CONFERENCE_OBJ_ROSTER_ID,o.subType=i.type,o.userData=i.toArrayBuffer();var a=new _.default.RCAdapterItemPdu;a.type=_.default.RCPDU_REG_UPDATE_OBJ,a.itemData=o.toArrayBuffer();var s=new _.default.RCAdapterPdu;s.type=_.default.RCPDU_REG_ADAPTER,s.item.push(a),this.sendUniform(s,!0)}},{key:"getNodeInfo",value:function(){var e=new _.default.RCNodeInfoRecordPdu;return e.nodeId=m.default.nodeId,e.name=m.default.userName,e.role=d.default.userTypesToId[m.default.userRole]||1,e.level=m.default.level,e.userData=m.default.userData,e.userId=m.default.userId,e.handUpTime=m.default.handUpTime,e.microphones=m.default.microphones,e.cameras=m.default.cameras,e.openCamera=m.default.openCamera,e.openMicrophones=m.default.openMicrophones,e.videoQuality=m.default.videoQuality,e.userIp=m.default.userIp,e.curVideoQuality=m.default.curVideoQuality,e.micGain=m.default.micGain,e.speakerVolume=m.default.speakerVolume,e.micCode=m.default.micCode,e.curCamera=m.default.curCamera,e.curMicrophone=m.default.curMicrophone,e.country=m.default.country,e.city=m.default.city,e.province=m.default.province,e.isp=m.default.isp,e}},{key:"updateUserInfo",value:function(){var e=this.getNodeInfo();I.log("更新用户信息->",e);var t=new _.default.RCNodeInfoUserDataPdu;t.qq="",t.skype="",e.userData=t.toArrayBuffer(),e.deviceType=m.default.deviceType;var n=new _.default.RCRegistryRosterItemPdu;n.nodeId=e.nodeId,n.nodeData=e.toArrayBuffer();var r=new _.default.RCRegistryRosterUpdateItemPdu;r.type=_.default.RCPDU_REG_ROSTER_UPDATE_PDU,r.items.push(n);var i=new _.default.RCRegistryUpdateObjPdu;i.objId=d.default.CONFERENCE_OBJ_ROSTER_ID,i.subType=r.type,i.userData=r.toArrayBuffer();var o=new _.default.RCAdapterItemPdu;o.type=_.default.RCPDU_REG_UPDATE_OBJ,o.itemData=i.toArrayBuffer();var a=new _.default.RCAdapterPdu;a.type=_.default.RCPDU_REG_ADAPTER,a.item.push(o),this.sendUniform(a,!0)}},{key:"sendConferMsg",value:function(e){if(null==this._classInfo||T.default.isEmptyObject(this._classInfo)){if(I.log("不能发送课堂消息.McuClient还未初始化数据!"),0==m.default.getCurrentStatus().code||1==m.default.getCurrentStatus().code)return void this._emit(h.default.MCU_ERROR,h.default.ERR_APE_SEND_FAILED_NO_JOIN)}else{I.log("发送课堂消息.",e);var t=new _.default.RCConferenceSendDataRequestPdu;t.type=_.default.RCPDU_SEND_CONFERENCE_DATA_REQUEST,t.initiator=this._classInfo.nodeId,t.peer=parseInt(e.to),t.userData=this._rCArrayBufferUtil.strToUint8Array("h5"+e.message),t.isPublic=!0,t.actionType=e.actionType,t.isPublic||0==t.peer?(I.log("发送公聊课堂消息."),this.sendChatUniform(t)):(I.log("发送私聊课堂消息."),this.send(t))}}},{key:"sendConferRecordMsg",value:function(e){if(!this.mcu.connected)return I.warn(m.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};if(null==e)return void I.warn("控制录制状的消息发送失败,参数错误",e);m.default.recordStatus=e.recordStatus||!1;var t=new _.default.RCConferenceRecordRequestPdu;t.type=_.default.RCPDU_CONFERENCE_RECORD_REQUEST,t.peer=0,t.isPublic=!0,t.initiator=this._classInfo.nodeId,t.record=m.default.recordStatus,t.classTime=m.default.recordTimestamp,t.filename=m.default.recordFileName||m.default.classId+"_"+T.default.creatTimestampYMD()+".rec",this.sendChatUniform(t),I.warn("发送录制消息-》",e)}},{key:"startRecord",value:function(){return m.default.recordTimestamp>=m.default.allowRecordMaxTime?void I.warn("不能再录制,录制时间已经达到最大限制",m.default.recordTimestamp):(I.log("startRecord","isHost",m.default.isHost,"recordStatus",m.default.recordStatus),void(m.default.isHost&&(m.default.classStopTime=T.default.creatTimestampStr(),this.sendConferRecordMsg({recordStatus:!0}),this._emit(h.default.CLASS_STATUS_INFO_CHANGE),this._emit(h.default.CLASS_RECORD_START))))}},{key:"stopRecord",value:function(e){I.log("stopRecord","isHost",m.default.isHost,"recordStatus",m.default.recordStatus),e&&1==e?m.default.recordStatus&&(m.default.classStopTime=T.default.creatTimestampStr(),this.sendConferRecordMsg({recordStatus:!1}),this._emit(h.default.CLASS_STATUS_INFO_CHANGE)):m.default.isHost&&m.default.recordStatus&&(m.default.classStopTime=T.default.creatTimestampStr(),this.sendConferRecordMsg({recordStatus:!1}),this._emit(h.default.CLASS_STATUS_INFO_CHANGE))}},{key:"leaveClass",value:function(){var e=this.mcu.mcuClassInfo.self,t=new _.default.RCNodeInfoUserDataPdu;t.qq="",t.skype="",e.userData=t.toArrayBuffer(),e.deviceType=m.default.deviceType;var n=new _.default.RCRegistryRosterItemPdu;n.nodeId=e.nodeId,n.nodeData=e.toArrayBuffer();var r=new _.default.RCRegistryRosterDeleteItemPdu;r.type=_.default.RCPDU_REG_ROSTER_DELETE_PDU,r.nodeId=m.default.nodeId;var i=new _.default.RCRegistryUpdateObjPdu;i.objId=d.default.CONFERENCE_OBJ_ROSTER_ID,i.subType=r.type,i.userData=r.toArrayBuffer();var o=new _.default.RCAdapterItemPdu;o.type=_.default.RCPDU_REG_UPDATE_OBJ,o.itemData=i.toArrayBuffer();var a=new _.default.RCAdapterPdu;a.type=_.default.RCPDU_REG_ADAPTER,a.item.push(o),this.sendUniform(a,!0)}},{key:"restorClass",value:function(){m.default.classTimestamp=0,m.default.classStatus=d.default.CLASS_STATUS_WAIT,m.default.classStopTime=T.default.creatTimestampStr(),this.stopRecord(),this._emit(h.default.CLASS_STATUS_INFO_CHANGE),this.sendUpdaterClassStatusInfo({actionType:0}),I.log("restorClass")}},{key:"startClass",value:function(e){if(m.default.isHost){var t=T.default.creatTimestampStr();m.default.classStopTime=t;var n=T.default.creatTimestampYMD();m.default.recordFileName=m.default.recordFileName||m.default.siteId+"/"+n+"/"+m.default.classId+"_"+n+".rec",m.default.classStatus==d.default.CLASS_STATUS_WAIT&&(m.default.classStartTime=t),m.default.classStatus=d.default.CLASS_STATUS_STARTED,this.startRecord(),this._emit(h.default.CLASS_STATUS_INFO_CHANGE),this.sendUpdaterClassStatusInfo({actionType:1}),this.startTimerCounter()}else I.warn("没有权限")}},{key:"pauseClass",value:function(e){return m.default.classStatus==d.default.CLASS_STATUS_WAIT?void I.warn("还没有开始,不能点暂停"):(m.default.classStatus=d.default.CLASS_STATUS_PAUSE,m.default.classStopTime=T.default.creatTimestampStr(),this.stopRecord(),this._emit(h.default.CLASS_STATUS_INFO_CHANGE,e),this.sendUpdaterClassStatusInfo({actionType:2}),void this.stopTimerCounter())}},{key:"closeClass",value:function(e){return m.default.classStatus==d.default.CLASS_STATUS_WAIT?void I.warn("还没有开始,不能点关闭"):(this.stopTimerCounter(),this.restorClass(),void this.sendConferMsg({to:0,message:"所有人退出课堂",actionType:d.default.CLASS_ACTION_CLOSE_ALL}))}},{key:"changeHandUpStatus",value:function(e){I.log("切换举手状态->",e),e&&1==e.isHandUp?m.default.handUpTime=T.default.creatTimestamp():m.default.handUpTime=0,this.updateUserInfo()}},{key:"sendUpdaterClassStatusInfo",value:function(e){if(I.log("更新课堂信息->"),null==e||T.default.isEmptyObject(e))return I.log("更新课堂信息->参数错误"),void this._emit(h.default.MCU_ERROR,h.default.ERR_APE_INTERFACE_PARAM_WRONG);A=d.default.CONFERENCE_OBJ_TABLE_ID;var t=this.packPdu(e,A);if(I.log(t),null==t)return I.log("更新课堂信息->参数错误"),void this._emit(h.default.MCU_ERROR,h.default.ERR_APE_INTERFACE_PARAM_WRONG);var n=new _.default.RCRegistryTableItemPdu;n.itemIdx=A,n.owner=0,n.registerObjId=d.default.CONFERENCE_OBJ_TABLE_ID,n.itemData=t.toArrayBuffer();var r=new _.default.RCRegistryTableUpdateItemPdu;r.type=_.default.RCPDU_REG_TABLE_UPDATE_PDU,r.items.push(n);var i=new _.default.RCRegistryUpdateObjPdu;i.objId=d.default.CONFERENCE_OBJ_TABLE_ID,i.subType=r.type,i.userData=r.toArrayBuffer();var o=new _.default.RCAdapterItemPdu;o.type=_.default.RCPDU_REG_UPDATE_OBJ,o.itemData=i.toArrayBuffer();var a=new _.default.RCAdapterPdu;a.type=_.default.RCPDU_REG_ADAPTER,a.item.push(o),I.log("更新课堂信息->发送更新数据"),this.sendUniform(a,!0)}},{key:"onJoinChannelHandlerSuccess",value:function(){I.log("ConferApe.onJoinChannelHandlerSuccess",m.default.classStatus),this.timerCounter.addTimerCallBack(this.timerCounterUptate.bind(this),1),m.default.classStatus==d.default.CLASS_STATUS_STARTED?(this.startTimerCounter(),this.startRecord()):m.default.classStatus==d.default.CLASS_STATUS_WAIT&&m.default.isHost&&m.default.isAutoStartClass&&!m.default.isRecordPlayBack&&(I.log("自动开始上课->classStatus:",m.default.classStatus," isHost:",m.default.isHost," isAutoStartClass:",m.default.isAutoStartClass," isRecordPlayBack:",m.default.isRecordPlayBack),this.startClass())}},{key:"startTimerCounter",value:function(){this.stopTimerCounter(),this.timerCounter&&this.timerCounter.startTimer()}},{key:"stopTimerCounter",value:function(){this.timerCounter&&this.timerCounter.stopTimer()}},{key:"timerCounterUptate",value:function(){return this.mcu.connected||(I.warn("MCU 连接已经断开"),this.stopTimerCounter()),m.default.classStatus!=d.default.CLASS_STATUS_STARTED?void I.warn("当前课堂已经暂停或者未开始,不计时","classStatus-->",m.default.classStatus):(m.default.classTimestamp=m.default.classTimestamp+1,m.default.isHost&&(m.default.recordTimestamp=m.default.recordTimestamp+1),this._emit(h.default.CLASS_UPDATE_TIMER,{classTimestamp:m.default.classTimestamp}),m.default.classTimestamp%m.default.updateClassInfoDelay==0&&m.default.isHost&&(this._emit(h.default.CLASS_STATUS_INFO_CHANGE),this.sendUpdaterClassStatusInfo({actionType:1})),void(m.default.isRecordPlayBack||m.default.classTimestamp%m.default.msDynamicChooseIpDelay!=0||this._emit(h.default.SWITCH_MS_IP)))}},{key:"tableUpdateHandler",value:function(e,t,n){try{var r=this.unPackPdu(e,t,n);if(I.log("tableUpdateHandler"),I.log(r),r&&r.classStatusInfo&&m.default.setClassStatusInfo(r.classStatusInfo),this._emit(h.default.CLASS_UPTATE_STATUS,m.default.classStatusInfo),!this.mcu.connected)return void this.stopTimerCounter();m.default.classStatus==d.default.CLASS_STATUS_STARTED?this.startTimerCounter():this.stopTimerCounter()}catch(e){I.warn("ConferApe table update got exception. itemIdx",t)}}},{key:"conferMsgComingHandler",value:function(e){var t=_.default.RCConferenceSendDataRequestPdu.decode(e),n={};switch(n.fromNodeID=t.initiator,n.toNodeID=t.peer,n.message=this._rCArrayBufferUtil.uint8ArrayToStr(t.userData,2),n.actionType=t.actionType,I.log("conferMsgComingHandler",n),n.actionType){case d.default.CLASS_ACTION_CLOSE_ALL:I.log(n.message),this._emit(h.default.CLASS_RUN_EXIT,{type:1})}}},{key:"onSendConferRecordRequestHandler",value:function(e){try{var t=_.default.RCConferenceRecordRequestPdu.decode(e);I.log("onSendConferRecordRequestHandler->",t),(t&&1==t.record||"true"==t.record)&&this._emit(h.default.CLASS_RECORD_SUCCESS)}catch(e){I.warn("onSendConferRecordRequestHandler err",e.message)}}},{key:"rosterInsertHandler",value:function(e,t){I.log("rosterInsertHandler--->"),m.default.nodeId==e||this.rosterUpdateHandler(e,t)}},{key:"rosterUpdateHandler",value:function(e,t){if(t.userRole=d.default.userTypes[t.role],e==m.default.nodeId){I.log("自己加入课堂的消息->",e,"role-->",t.role,d.default.userTypes[t.role]);var n=Object.keys(this.rosters).length;return n<1&&!m.default.isHost&&m.default.classStatus==d.default.CLASS_STATUS_STARTED&&(I.warn("当前课堂没有老师->暂停课堂"),this.pauseClass({isForce:!0}),this.stopRecord(!0)),void this.unPackRosterInfo(e,t)}if(I.log(e,"加入课堂,role-->",t.role,d.default.userTypes[t.role]),parseInt(e)>m.default.nodeId){if(t.role==d.default.NR_HOST&&m.default.isHost)return void this.kickOutRoster();if(t.role==d.default.NR_PRESENTER&&m.default.isPresenter)return void this.kickOutRoster();if(t.role==d.default.NR_ASSISTANT&&m.default.isAssistant)return void this.kickOutRoster();if(t.role==d.default.NR_INVISIBLE&&m.default.isInvisible)return void this.kickOutRoster();t.userId==m.default.userId&&"0"!=m.default.userId&&(I.log("异地登陆->userId->",m.default.userId),this._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_REMOTE_LANDING),this._emit(h.default.CLASS_RUN_EXIT,{type:1}))}this.unPackRosterInfo(e,t)}},{key:"unPackRosterInfo",value:function(e,t){var n=this.rosters[e];this.rosters[e]=t;var r=null;try{r=_.default.RCNodeInfoUserDataPdu.decode(t.userData)}catch(e){I.log("RCNodeInfoUserDataPdu decode err",e.message)}var i=t;return i.userData=r,t.role==d.default.NR_INVISIBLE&&m.default.userRole!=d.default.invisible?void I.log("NR_INVISIBLE"):void(n?(I.log("人员更新信息->",i),this._emit(h.default.CLASS_UPDATE_ROSTER,{nodeId:e,nodeData:i})):(I.log("人员加入->",i),this._emit(h.default.CLASS_INSERT_ROSTER,{nodeId:e,nodeData:i}),this.emitRosterChange()))}},{key:"kickOutRoster",value:function(){this._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_KICK_OUT),this._emit(h.default.CLASS_RUN_EXIT,{type:1})}},{key:"updaterRosterStatus",value:function(e){e&&e.status==d.default.CHANNEL_STATUS_OPENING&&null==this.rosters[e.fromNodeId]&&(I.log("媒体模块被占用->占有人已经不存在课堂中->释放->",e),this._emit(h.default.CLASS_NONENTITY_ROSTER,{nodeId:e.fromNodeId}))}},{key:"updaterUserDeviecStatusChange",value:function(e){I.log("音视频设备状态更新->",e),this.updateUserInfo()}},{key:"rosterDelHandler",value:function(e){if(m.default.nodeId==e)I.log("自己离开课堂"),this._emit(h.default.CLASS_RUN_EXIT,{type:0});else{var t=this.rosters[e];t&&I.log(e,"->离开课堂->身份->",t.role),delete this.rosters[e],this.emitRosterChange(),this._emit(h.default.CLASS_DELETE_ROSTER,{nodeId:e});for(var n in this.rosters){var r=parseInt(n);return void(r==m.default.nodeId?(I.log(r,"有权限检查离开的人员是否占用channel"),this._emit(h.default.CLASS_NONENTITY_ROSTER,{nodeId:e}),t&&t.role==d.default.NR_HOST&&(this.pauseClass(),this.stopRecord(!0))):I.warn(m.default.nodeId,"没有权限检查离开的人员是否占用channel"))}}}},{key:"emitRosterChange",value:function(){this._emit(h.default.CLASS_UPDATE_ROSTER_NUM,Object.keys(this.rosters).length)}},{key:"packPdu",value:function(e,t){if(I.log("课堂===packPdu "),null==e||null==t)return this._emit(h.default.MCU_ERROR,h.default.ERR_APE_INTERFACE_PARAM_WRONG),null;var n=new _.default.RCClassStatusInfoPdu;n.nodeId=m.default.nodeId,n.userId=m.default.userId,n.userName=m.default.userName,n.siteId=m.default.siteId,n.classId=m.default.classId,n.className=m.default.className,n.classType=m.default.classType,n.classStatus=m.default.classStatus,n.classStartTime=m.default.classStartTime,n.classStopTime=m.default.classStopTime,n.classTimestamp=m.default.classTimestamp,n.classBeginTime=m.default.classBeginTime,n.classEndTime=m.default.classEndTime,n.recordStatus=m.default.recordStatus,n.recordTimestamp=m.default.recordTimestamp,n.recordFileName=m.default.recordFileName,n.recordDownloadUrl=m.default.recordDownloadUrl,n.serverTimestamp=m.default.serverTimestamp,n.activeDocId=m.default.activeDocId,n.activeDocCurPage=m.default.activeDocCurPage,I.log("classStatusInfo--->",n);var r=new _.default.RCClassSendDataModelPdu;return r.itemIdx=t,r.from=m.default.nodeId,r.owner=m.default.nodeId,r.classStatusInfo=n,r}},{key:"unPackPdu",value:function(e,t,n){if(I.log("课堂===unPackPdu "),null==e||null==t||null==n)return this._emit(h.default.MCU_ERROR,h.default.ERR_APE_INTERFACE_PARAM_WRONG),null;try{var r=_.default.RCClassSendDataModelPdu.decode(n);return r}catch(e){I.log("课堂收到数据 unPackPdu Pdu解析错误,itemIdx="+t+" err:"+e.message)}return null}}]),t}(l.default),w=b;t.default=w;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(I,"loger","D:/work/McuClient/src/apes/ConferApe.js"),__REACT_HOT_LOADER__.register(A,"itemIdx","D:/work/McuClient/src/apes/ConferApe.js"),__REACT_HOT_LOADER__.register(b,"ConferApe","D:/work/McuClient/src/apes/ConferApe.js"),__REACT_HOT_LOADER__.register(w,"default","D:/work/McuClient/src/apes/ConferApe.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")}Object.defineProperty(t,"__esModule",{value:!0});var o=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}}(),a=n(2),s=r(a),u=n(1),l=r(u),f=n(3),d=(r(f),n(5)),c=r(d),h=n(4),p=r(h),_=l.default.getLoger("MediaModule"),E=function(){function e(){i(this,e),this.needPublishMediaChannel={},this.mediaChannels={},this.maxMediaChannel=0,this.mediaType=s.default.MEDIA_TYPE_DEFAULT,this.MEDIA_OBJ_TABLE_ID=0}return o(e,[{key:"getMediaPlayPath",value:function(e){if(_.log("获取播放地址->"),null==e||null==e.streamId)return _.warn("获取播放地址->参数错误",e),{code:s.default.RETURN_FAILED,data:""};var t="",n="",r="";return"m3u8"==e.type?(r=c.default.siteId==c.default.siteId_letv?"desc.m3u8":"index.m3u8",n=""==c.default.MS_PLAY_HLS_PORT||null==c.default.MS_PLAY_HLS_PORT?"":":"+c.default.MS_PLAY_HLS_PORT,t="http://"+c.default.MS_PLAY_HLS_IP+n+"/live/"+e.streamId+"/"+r):(n=""==c.default.MS_PLAY_RTMP_PORT||null==c.default.MS_PLAY_RTMP_PORT?"":":"+c.default.MS_PLAY_RTMP_PORT,t="rtmp://"+c.default.MS_PLAY_RTMP_IP+n+"/live/"+e.streamId),t=t.replace("::",":"),{code:s.default.RETURN_SUCCESS,data:"",playUrl:t}}},{key:"getMediaRecordPlaybackPath",value:function(e){if(_.log("getMediaRecordPlaybackPath"),null==e||null==e.streamId)return _.warn("getMediaRecordPlaybackPath,参数错误",e),{code:s.default.RETURN_FAILED,data:""};var t=""==c.default.RS_RECORD_PLAY_PORT||null==c.default.RS_RECORD_PLAY_PORT?"":":"+c.default.RS_RECORD_PLAY_PORT,n="http://"+c.default.RS_RECORD_PLAY_IP+t+"/live/"+e.streamId+"/total.m3u8";return n=n.replace("::",":"),{code:s.default.RETURN_SUCCESS,data:"",playUrl:n}}},{key:"getMediaPublishPath",value:function(e){_.log("getMediaPublishPath");var t=this.getFreeMediaChannel();if(0==t)return{code:s.default.RETURN_FAILED,data:"不能再打开更多的设备",mediaChannels:this.mediaChannels};var n="live";e&&"flash"==e.type&&(n="flash");var r=""==c.default.MS_PUBLISH_PORT||null==c.default.MS_PUBLISH_PORT?"":":"+c.default.MS_PUBLISH_PORT,i=p.default.creatTimestamp(),o=c.default.siteId+"_"+c.default.classId+"_"+c.default.userId+"_"+t+"_"+i,a="rtmp://"+c.default.MS_PUBLISH_IP+r+"/"+n+"/"+o;return a=a.replace("::",":"),this.needPublishMediaChannel[a]={channelId:t,publishUrl:a,streamId:o,timestamp:i,nodeId:c.default.nodeId},{code:s.default.RETURN_SUCCESS,data:"",mediaId:t,publishUrl:a}}},{key:"getFreeMediaChannel",value:function(){var e=0;for(var t in this.mediaChannels){var n=this.mediaChannels[t];if(n&&n.status==s.default.CHANNEL_STATUS_RELEASED)return n.channelId;e++}return _.log("getFreeMediaChannel","maxMediaChannel",this.maxMediaChannel,"counter:",e),_.log(this.mediaChannels),e<this.maxMediaChannel?this.MEDIA_OBJ_TABLE_ID+e:0}},{key:"getNeedPublishMediaChannel",value:function(e){return this.needPublishMediaChannel[e]}},{key:"getOpeningMediaChannel",value:function(e){if(_.log("getOpeningMediaChannel","nodeId",e,"mediaChannels:",this.mediaChannels),null==e||0==e)return 0;for(var t in this.mediaChannels){var n=this.mediaChannels[t];if(n&&n.status==s.default.CHANNEL_STATUS_OPENING&&n.fromNodeId==e)return n.channelId}return 0}},{key:"checkChannelIsOpening",value:function(e){if(null==e)return _.warn("checkChannelIsOpening error,channel=",e),!0;var t=this.mediaChannels[e];return null!=t&&t.status!=s.default.CHANNEL_STATUS_RELEASED}},{key:"getAllMediaChannelInfo",value:function(){var e=[];for(var t in this.mediaChannels){var n=this.mediaChannels[t];n&&e.push({mediaId:n.channelId,status:n.status,fromNodeId:n.fromNodeId})}if(e.length<this.maxMediaChannel)for(var r=e.length;r<this.maxMediaChannel;r++){var i=this.MEDIA_OBJ_TABLE_ID+r;e.push({mediaId:i,status:s.default.CHANNEL_STATUS_RELEASED,fromNodeId:0})}return e}},{key:"getDefaultChannelInfo",value:function(){var e={};return e.owner=0,e.status=s.default.CHANNEL_STATUS_RELEASED,e.fromNodeId=c.default.nodeId,e.channelId=0,e.streamId="",e.classId=c.default.classId,e.siteId=c.default.siteId,e.toNodeId=0,e.userId=c.default.userId,e.mediaType=this.mediaType||s.default.MEDIA_TYPE_DEFAULT,e}}]),e}(),g=E;t.default=g;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(_,"loger","D:/work/McuClient/src/apes/MediaModule.js"),__REACT_HOT_LOADER__.register(E,"MediaModule","D:/work/McuClient/src/apes/MediaModule.js"),__REACT_HOT_LOADER__.register(g,"default","D:/work/McuClient/src/apes/MediaModule.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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=function(){function e(e,t){for(var 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}}(),l=n(7),f=r(l),d=n(3),c=r(d),h=n(1),p=r(h),_=n(43),E=r(_),g=n(6),y=r(g),R=n(15),m=r(R),v=n(11),T=r(v),C=n(2),S=r(C),I=n(20),A=(r(I),n(10)),b=r(A),w=n(13),D=r(w),P=n(5),O=r(P),N=n(4),U=r(N),L=p.default.getLoger("MCU"),k=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._apes={},e._everSocket=E.default,e._everSocket.on(E.default.OPEN,e._everSocketOpenHandler.bind(e)),e._everSocket.on(E.default.MESSAGE,e._everSocketMsgReceivedHandler.bind(e)),e._everSocket.on(E.default.CLOSED,e._everSocketCloseHandler.bind(e)),e._everSocket.on(E.default.ERROR,e._everSocketErrorHandler.bind(e)),e}return a(t,e),u(t,[{key:"registerApe",value:function(e){this._apes[e._session_id]=e}},{key:"_everSocketOpenHandler",value:function(){this._sendJoinClassRequest()}},{key:"_everSocketCloseHandler",value:function(){return O.default.getCurrentStatus().code==O.default.statusCode_3.code?void L.warn("已经断开连接->"):(O.default.setCurrentStatus(O.default.statusCode_3),void this._emit(c.default.MCU_ERROR,c.default.ERR_SOCKET_DISCONNECT))}},{key:"_everSocketErrorHandler",value:function(e){e==E.default.ERR_SOCKET_RECONNECT_FAILED&&this._emit(c.default.SWITCH_MCU_IP)}},{key:"_sendJoinClassRequest",value:function(){L.log("MCU-发送加入课堂请求."),L.log(this.classInfo);var e=new y.default.RCConferenceDescriptorPdu;e.id=this.classInfo.classId,e.name=this.classInfo.className||"",e.mode=0,e.capacity=1;var t=new y.default.RCConferenceJoinRequestPdu;t.type=2,t.initiator=this.classInfo.nodeId,t.nodeType=T.default.NT_TERMINAL,t.classDescription=e;var n=y.default.create_join_class_request_pdu(t.type,this.classInfo.nodeId,this.classInfo.classId,0,S.default.BROADCAST_CHANNEL_ID,!0,T.default.DP_TOP,this.classInfo.topNodeID,T.default.SEG_ONCE);n.set("site",this.classInfo.siteId),n.set("userId",this.classInfo.userId),n.set("userName",D.default.fromByteArray(b.default.strToUint8Array(this.classInfo.userName))),n.set("userRole",this.classInfo.userRole),n.set("deviceType",""+O.default.deviceType),n.set("data",t.toArrayBuffer()),this._everSocket.send(n.toArrayBuffer())}},{key:"_everSocketMsgReceivedHandler",value:function(e){var t=this,n=y.default.decode_pdu(e),r=n.get("type"),i=n.get("data"),o=function(){switch(r){case m.default.RCPDU_CONNECT_PROVIDER_RESPONSE:var e=y.default.RCConferenceJoinResponsePdu.decode(i),o=e.result;switch(L.warn("RCPDU_CONNECT_PROVIDER_RESPONSE ->pduResultCode:"+o),o){case T.default.RET_SUCCESS:t._updateMCUConfInfoDescription(e.classDescription),t._emit(c.default.CLASS_JOIN_MCU_SUCCESS,t.classInfo);break;case T.default.RET_FULL_CAPACITY:t._emit(c.default.MCU_ERROR,c.default.ERR_CLASS_JOIN_FULL);break;default:L.arn("JoinConfPdu-未知类型-等待处理.",o)}break;case m.default.RCPDU_SEND_DATA_REQUEST:var a=t._apes[n.sessionId],s=(0,S.default)(n.sessionId);if(a){y.default.id2type(n.subType);if(L.warn("接收服务端消息----------------->subType->",n.subType,O.default.mcuDelay,O.default.messageDelay),a._apeDelayed&&O.default.messageDelay&&O.default.mcuDelay>0)return L.warn("延迟处理消息->",O.default.mcuDelay),setTimeout(function(){a._emit(n.subType,n.data)},1e3*O.default.mcuDelay),{v:void 0};a._emit(n.subType,n.data)}else L.warn(s+"尚未注册");break;default:L.warn("PDU-未知类型-等待处理.",r)}}();if("object"===("undefined"==typeof o?"undefined":s(o)))return o.v}},{key:"_updateMCUConfInfoDescription",value:function(e){L.log("_updateMCUConfInfoDescription."),L.log(e)}},{key:"send",value:function(e){this.connected?(L.log("发送数据到服务端-------------------->"),this._everSocket.send(e.toArrayBuffer())):(L.log("发送数据到服务端-------------------->失败->未连接到服务端"),this._emit(c.default.MCU_ERROR,c.default.ERR_SOCKET_DISCONNECT))}},{key:"leaveMCU",value:function(){for(var e in this._apes)this._apes[e].stopApe();L.log("leaveMCU"),O.default.setCurrentStatus(O.default.statusCode_3),this._everSocket.end()}},{key:"joinMCU",value:function(e){L.log("开始建立EverSocket通道."),L.log(e),e.classId=parseInt(e.classId),this.classInfo=e,this.classInfo.nodeId=U.default.creatSoleNumberFromTimestamp(),O.default.nodeId=this.classInfo.nodeId;var t=new y.default.RCNodeInfoRecordPdu;t.name=this.classInfo.userName,t.nodeId=this.classInfo.nodeId,t.userId=this.classInfo.userId,t.role=S.default.userTypesToId[this.classInfo.userRole]||1,t.level=0,t.handUpTime=0,t.openCamera=0,t.openMicrophones=0,t.microphones=O.default.microphones,t.cameras=O.default.cameras,t.videoQuality=O.default.videoQuality,t.userIp=O.default.userIp;var n={};n._conference_id=this.classInfo.classId,n._top_node_id=this.classInfo.topNodeID,this.mcuClassInfo={},this.mcuClassInfo.self=t,this.mcuClassInfo.info=n,this.classInfo.mcuClassInfo=this.mcuClassInfo,this._everSocket.begin(this.classInfo.MCUServerIP,this.classInfo.MCUServerPort)}},{key:"switchMCUIp",value:function(e){e&&e.MCUServerIP&&(this.classInfo.MCUServerIP=e.MCUServerIP,this.classInfo.MCUServerPort=e.MCUServerPort,this._everSocket&&this._everSocket.switchSocketIp(this.classInfo.MCUServerIP,this.classInfo.MCUServerPort))}},{key:"connected",get:function(){return!(!this._everSocket||!this._everSocket.connected)}}]),t}(f.default),M=new k;t.default=M;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(L,"loger","D:/work/McuClient/src/mcu.js"),__REACT_HOT_LOADER__.register(k,"MCU","D:/work/McuClient/src/mcu.js"),__REACT_HOT_LOADER__.register(M,"default","D:/work/McuClient/src/mcu.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(f===setTimeout)return setTimeout(e,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function o(e){if(d===clearTimeout)return clearTimeout(e);if((d===r||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function a(){_&&h&&(_=!1,h.length?p=h.concat(p):E=-1,p.length&&s())}function s(){if(!_){var e=i(a);_=!0;for(var t=p.length;t;){for(h=p,p=[];++E<t;)h&&h[E].run();E=-1,t=p.length}h=null,_=!1,o(e)}}function u(e,t){this.fun=e,this.array=t}function l(){}var f,d,c=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(e){f=n}try{d="function"==typeof clearTimeout?clearTimeout:r}catch(e){d=r}}();var h,p=[],_=!1,E=-1;c.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];p.push(new u(e,t)),1!==p.length||_||i(s)},u.prototype.run=function(){this.fun.apply(null,this.array)},c.title="browser",c.browser=!0,c.env={},c.argv=[],c.version="",c.versions={},c.on=l,c.addListener=l,c.once=l,c.off=l,c.removeListener=l,c.removeAllListeners=l,c.emit=l,c.binding=function(e){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(e){throw new Error("process.chdir is not supported")},c.umask=function(){return 0}},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,n){var r,i,o;(function(e){!function(a,s){n(12).amd?(i=[n(16)],r=s,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 s(e)}():(a.dcodeIO=a.dcodeIO||{}).ByteBuffer=s(a.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,a,s=8*i-r-1,u=(1<<s)-1,l=u>>1,f=-7,d=n?i-1:0,c=n?-1:1,h=e[t+d];for(d+=c,o=h&(1<<-f)-1,h>>=-f,f+=s;f>0;o=256*o+e[t+d],d+=c,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=r;f>0;a=256*a+e[t+d],d+=c,f-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:(h?-1:1)*(1/0);a+=Math.pow(2,r),o-=l}return(h?-1:1)*a*Math.pow(2,o-r)}function i(e,t,n,r,i,o){var a,s,u,l=8*o-i-1,f=(1<<l)-1,d=f>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),t+=a+d>=1?c/u:c*Math.pow(2,1-d),t*u>=2&&(a++,u/=2),a+d>=f?(s=0,a=f):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[n+h]=255&a,h+=p,a/=256,l-=8);e[n+h-p]|=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?s: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 a=o.prototype;a.__isByteBuffer__,Object.defineProperty(a,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var s=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,a=0,s=0,u=e.length;s<u;++s)o.isByteBuffer(e[s])||(e[s]=o.wrap(e[s],t)),i=e[s].limit-e[s].offset,i>0&&(a+=i);if(0===a)return new o(0,n,r);var l,f=new o(a,n,r);for(s=0;s<u;)l=e[s++],i=l.limit-l.offset,i<=0||(f.view.set(l.view.subarray(l.offset,l.limit),f.offset),f.offset+=i);return f.limit=f.offset,f.offset=0,f},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=a.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 s=0;s<e.length;++s)i.view[s]=e[s]}return i},a.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,a=o>>3,s=0;for(t+=this.writeVarint32(o,t);a--;)r=1&!!e[s++]|(1&!!e[s++])<<1|(1&!!e[s++])<<2|(1&!!e[s++])<<3|(1&!!e[s++])<<4|(1&!!e[s++])<<5|(1&!!e[s++])<<6|(1&!!e[s++])<<7,this.writeByte(r,t++);if(s<o){var u=0;for(r=0;s<o;)r|=(1&!!e[s++])<<u++;this.writeByte(r,t++)}return n?(this.offset=t,this):t-i},a.readBitSet=function(e){var t="undefined"==typeof e;t&&(e=this.offset);var n,r=this.readVarint32(e),i=r.value,o=i>>3,a=0,s=[];for(e+=r.length;o--;)n=this.readByte(e++),s[a++]=!!(1&n),s[a++]=!!(2&n),s[a++]=!!(4&n),s[a++]=!!(8&n),s[a++]=!!(16&n),s[a++]=!!(32&n),s[a++]=!!(64&n),s[a++]=!!(128&n);if(a<i){var u=0;for(n=this.readByte(e++);a<i;)s[a++]=!!(n>>u++&1)}return t&&(this.offset=e),s},a.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},a.writeBytes=a.append,a.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},a.writeByte=a.writeInt8,a.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},a.readByte=a.readInt8,a.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},a.writeUInt8=a.writeUint8,a.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},a.readUInt8=a.readUint8,a.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},a.writeShort=a.writeInt16,a.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},a.readShort=a.readInt16,a.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},a.writeUInt16=a.writeUint16,a.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},a.readUInt16=a.readUint16,a.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},a.writeInt=a.writeInt32,a.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},a.readInt=a.readInt32,a.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},a.writeUInt32=a.writeUint32,a.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},a.readUInt32=a.readUint32,e&&(a.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,a=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]=a>>>24&255,this.view[n+2]=a>>>16&255,this.view[n+1]=a>>>8&255,this.view[n]=255&a):(this.view[n]=a>>>24&255,this.view[n+1]=a>>>16&255,this.view[n+2]=a>>>8&255,this.view[n+3]=255&a,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},a.writeLong=a.writeInt64,a.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},a.readLong=a.readInt64,a.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,a=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]=a>>>24&255,this.view[n+2]=a>>>16&255,this.view[n+1]=a>>>8&255,this.view[n]=255&a):(this.view[n]=a>>>24&255,this.view[n+1]=a>>>16&255,this.view[n+2]=a>>>8&255,this.view[n+3]=255&a,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},a.writeUInt64=a.writeUint64,a.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},a.readUInt64=a.readUint64),a.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},a.writeFloat=a.writeFloat32,a.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},a.readFloat=a.readFloat32,a.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},a.writeDouble=a.writeFloat64,a.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},a.readDouble=a.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},a.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 a=this.buffer.byteLength;for(t>a&&this.resize((a*=2)>t?a: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},a.writeVarint32ZigZag=function(e,t){return this.writeVarint32(o.zigZagEncode32(e),t)},a.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}},a.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()},a.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),a=t.toInt()>>>0,s=t.shiftRightUnsigned(28).toInt()>>>0,u=t.shiftRightUnsigned(56).toInt()>>>0;n+=i;var l=this.buffer.byteLength;switch(n>l&&this.resize((l*=2)>n?l: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?s>>>21|128:s>>>21&127;case 7:this.view[n+6]=7!==i?s>>>14|128:s>>>14&127;case 6:this.view[n+5]=6!==i?s>>>7|128:s>>>7&127;case 5:this.view[n+4]=5!==i?128|s:127&s;case 4:this.view[n+3]=4!==i?a>>>21|128:a>>>21&127;case 3:this.view[n+2]=3!==i?a>>>14|128:a>>>14&127;case 2:this.view[n+1]=2!==i?a>>>7|128:a>>>7&127;case 1:this.view[n]=1!==i?128|a:127&a}return r?(this.offset+=i,this):i},a.writeVarint64ZigZag=function(e,t){return this.writeVarint64(o.zigZagEncode64(e),t)},a.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,a=0,s=0;if(s=this.view[t++],i=127&s,128&s&&(s=this.view[t++],i|=(127&s)<<7,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],i|=(127&s)<<14,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],i|=(127&s)<<21,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],o=127&s,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],o|=(127&s)<<7,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],o|=(127&s)<<14,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],o|=(127&s)<<21,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],a=127&s,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],a|=(127&s)<<7,128&s||this.noAssert&&"undefined"==typeof s))))))))))throw Error("Buffer overrun");var u=e.fromBits(i|o<<28,o>>>4|a<<24,!1);return n?(this.offset=t,u):{value:u,length:t-r}},a.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}),a.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=f.calculateUTF16asUTF8(t(e))[1],n+=o+1;var a=this.buffer.byteLength;return n>a&&this.resize((a*=2)>n?a:n),n-=o+1,f.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),this.view[n++]=0,r?(this.offset=n,this):o},a.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 f.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}},a.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=f.calculateUTF16asUTF8(t(e),this.noAssert)[1],n+=4+i;var a=this.buffer.byteLength;if(n>a&&this.resize((a*=2)>n?a: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,f.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},a.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",a.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=f.calculateUTF16asUTF8(t(e))[1],n+=i;var a=this.buffer.byteLength;return n>a&&this.resize((a*=2)>n?a:n),n-=i,f.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),r?(this.offset=n,this):n-o},a.writeString=a.writeUTF8String,o.calculateUTF8Chars=function(e){return f.calculateUTF16asUTF8(t(e))[0]},o.calculateUTF8Bytes=function(e){return f.calculateUTF16asUTF8(t(e))[1]},o.calculateString=o.calculateUTF8Bytes,a.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 a,s=0,u=r;if(t===o.METRICS_CHARS){if(a=n(),f.decodeUTF8(function(){return s<e&&r<this.limit?this.view[r++]:null}.bind(this),function(e){++s,f.UTF8toUTF16(e,a)}),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return i?(this.offset=r,a()):{string:a(),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 l=r+e;if(f.decodeUTF8toUTF16(function(){return r<l?this.view[r++]:null}.bind(this),a=n(),this.noAssert),r!==l)throw RangeError("Illegal range: Truncated data, "+r+" == "+l);return i?(this.offset=r,a()):{string:a(),length:r-u}}throw TypeError("Unsupported metrics: "+t)},a.readString=a.readUTF8String,a.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,a,s=n;i=f.calculateUTF16asUTF8(t(e),this.noAssert)[1],a=o.calculateVarint32(i),n+=a+i;var u=this.buffer.byteLength;if(n>u&&this.resize((u*=2)>n?u:n),n-=a+i,n+=this.writeVarint32(i,n),f.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==s+i+a)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+i+a));return r?(this.offset=n,this):n-s},a.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}},a.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 a=this.buffer.byteLength;return n>a&&this.resize((a*=2)>n?a:n),n-=i,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=i,r&&(this.offset+=i),this},a.appendTo=function(e,t){return e.append(this,t),this},a.assert=function(e){return this.noAssert=!e,this},a.capacity=function(){return this.buffer.byteLength},a.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},a.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},a.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=s,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},a.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},a.copyTo=function(e,t,n,r){var i,a;if(!this.noAssert&&!o.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(a="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 s=r-n;return 0===s?e:(e.ensureCapacity(t+s),e.view.set(this.view.subarray(n,r),t),i&&(this.offset+=s),a&&(e.offset+=s),this)},a.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},a.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},a.flip=function(){return this.limit=this.offset,this.offset=0,this},a.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},a.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},a.LE=function(e){return this.littleEndian="undefined"==typeof e||!!e,this},a.BE=function(e){return this.littleEndian="undefined"!=typeof e&&!e,this},a.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 a=i-n;if(a>0){var s=new ArrayBuffer(this.buffer.byteLength+a),u=new Uint8Array(s);u.set(this.view.subarray(n,this.buffer.byteLength),i),this.buffer=s,this.view=u,this.offset+=a,this.markedOffset>=0&&(this.markedOffset+=a),this.limit+=a,n+=a}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},a.prependTo=function(e,t){return e.prepend(this,t),this},a.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},a.remaining=function(){return this.limit-this.offset},a.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},a.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},a.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)},a.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},a.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},a.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 s;var r=new ArrayBuffer(n-t);return new Uint8Array(r).set(new Uint8Array(this.buffer).subarray(t,n),0),r},a.toArrayBuffer=a.toBuffer,a.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 l=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,a;null!==(i=e());)if(o=n[i],"undefined"==typeof o&&r(i),null!==(i=e())&&(a=n[i],"undefined"==typeof a&&r(i),t(o<<2>>>0|(48&a)>>4),null!==(i=e()))){if(o=n[i],"undefined"==typeof o){if(61===i)break;r(i)}if(t((15&a)<<4>>>0|(60&o)>>2),null!==(i=e())){if(a=n[i],"undefined"==typeof a){if(61===i)break;r(i)}t((3&o)<<6>>>0|a)}}},e.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},e}();a.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 l.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 l.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()},a.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,a=new o(i,t);r<i;){if(n=e.charCodeAt(r),n>255)throw RangeError("illegal char code: "+n);a.view[r++]=n}return a.limit=i,a},a.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",o="",a="";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+=" ";a+=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+=" ";a+=i+o+"\n"}return e?a:i},o.fromDebug=function(e,t,n){for(var r,i,a=e.length,s=new o((a+1)/3|0,t,n),u=0,l=0,f=!1,d=!1,c=!1,h=!1,p=!1;u<a;){switch(r=e.charAt(u++)){case"!":if(!n){if(d||c||h){p=!0;break}d=c=h=!0}s.offset=s.markedOffset=s.limit=l,f=!1;break;case"|":if(!n){if(d||h){p=!0;break}d=h=!0}s.offset=s.limit=l,f=!1;break;case"[":if(!n){if(d||c){p=!0;break}d=c=!0}s.offset=s.markedOffset=l,f=!1;break;case"<":if(!n){if(d){p=!0;break}d=!0}s.offset=l,f=!1;break;case"]":if(!n){if(h||c){p=!0;break}h=c=!0}s.limit=s.markedOffset=l,f=!1;break;case">":if(!n){if(h){p=!0;break}h=!0}s.limit=l,f=!1;break;case"'":if(!n){if(c){p=!0;break}c=!0}s.markedOffset=l,f=!1;break;case" ":f=!1;break;default:if(!n&&f){p=!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");s.view[l++]=i,f=!0}if(p)throw TypeError("Illegal str: Invalid symbol at "+u)}if(!n){if(!d||!h)throw TypeError("Illegal str: Missing offset or limit");if(l<s.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+l+" < "+a)}return s},a.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,a=new o(i/2|0,t),s=0,u=0;s<i;s+=2){if(r=parseInt(e.substring(s,s+2),16),!n&&(!isFinite(r)||r<0||r>255))throw TypeError("Illegal str: Contains non-hex characters");a.view[u++]=r}return a.limit=u,a};var f=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,a=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())&&a([n,r]),t((31&n)<<6|63&r);else if(224===(240&n))(null===(r=e())||null===(i=e()))&&a([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()))&&a([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 a.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{f.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(f.calculateUTF16asUTF8(t(e),!0)[1],n,r),a=0;return f.encodeUTF16toUTF8(t(e),function(e){i.view[a++]=e}),i.limit=a,i},o})}).call(t,n(9)(e))},function(e,t){var n={utf8:{stringToBytes:function(e){return n.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(n.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}};e.exports=n},function(e,t,n){var r,i,o;!function(n,a){i=[t,e],r=a,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(e.exports=o))}(this,function(e,t){"use strict";function n(){return"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random())}function r(e){try{delete window[e]}catch(t){window[e]=void 0}}function i(e){var t=document.getElementById(e);document.getElementsByTagName("head")[0].removeChild(t)}function o(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=e,s=t.timeout||a.timeout,u=t.jsonpCallback||a.jsonpCallback,l=void 0;return new Promise(function(a,f){var d=t.jsonpCallbackFunction||n(),c=u+"_"+d;window[d]=function(e){a({ok:!0,json:function(){return Promise.resolve(e)}}),l&&clearTimeout(l),i(c),r(d)},o+=o.indexOf("?")===-1?"?":"&";var h=document.createElement("script");h.setAttribute("src",""+o+u+"="+d),h.id=c,document.getElementsByTagName("head")[0].appendChild(h),l=setTimeout(function(){f(new Error("JSONP request to "+e+" timed out")),r(d),i(c)},s)})}var a={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};t.exports=o})},function(e,t,n){!function(t,n){e.exports=n()}(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,t,n){e.exports=n(1)},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;if(!(e&&e.length&&t))throw new Error("ips and callback are required.");new o(e,t,n)}Object.defineProperty(t,"__esModule",{value:!0});var i=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}}();t.default=r;var o=function(){function e(t,r,i){n(this,e),this.ip="",this.ipcallback=r,this.timeoutId=null,this.reqsCache=[];for(var o=0;o<t.length;o++)this.reqsCache.push(this.send(t[o],i-10));this.timeoutId=setTimeout(this.notify.bind(this),i)}return i(e,[{key:"clearAll",value:function(){this.reqsCache&&this.reqsCache.length&&this.reqsCache.forEach(function(e){e.abort()}),clearTimeout(this.timeoutId),this.ip="",this.ipcallback=null,this.timeoutId=null,this.reqsCache=[]}},{key:"clearReq",value:function(e){this.reqsCache.splice(this.reqsCache.indexOf(e),1)}},{key:"notify",value:function(){this.ipcallback(this.ip),this.clearAll()}},{key:"send",value:function(e,t){var n=this,r=new XMLHttpRequest;return r.open("HEAD","//"+e+"/?_="+Date.now()),r.timeout=t,r.onload=function(){n.ip=e,n.clearReq(r),r.onload=null,n.notify()},r.ontimeout=function(){n.clearReq(r),r.ontimeout=null},r.onerror=function(){n.clearReq(r),r.onerror=null},r.onabort=function(){n.clearReq(r),r.onabort=null},r.send(),r}}]),e}();!function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(o,"IpHunter","/Users/AlexWang/ws/iphunter/src/main.js"),__REACT_HOT_LOADER__.register(r,"check","/Users/AlexWang/ws/iphunter/src/main.js"))}()}])})},function(e,t,n){var r,i;!function(t,n){"use strict";"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(n,o){"use strict";function a(e,t){t=t||re;var n=t.createElement("script");n.text=e,t.head.appendChild(n).parentNode.removeChild(n)}function s(e){var t=!!e&&"length"in e&&e.length,n=Ee.type(e);return"function"!==n&&!Ee.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function u(e,t,n){if(Ee.isFunction(t))return Ee.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return Ee.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(Ae.test(t))return Ee.filter(t,e,n);t=Ee.filter(t,e)}return Ee.grep(e,function(e){return ue.call(t,e)>-1!==n&&1===e.nodeType})}function l(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function f(e){var t={};return Ee.each(e.match(Ne)||[],function(e,n){t[n]=!0}),t}function d(e){return e}function c(e){throw e}function h(e,t,n){var r;try{e&&Ee.isFunction(r=e.promise)?r.call(e).done(t).fail(n):e&&Ee.isFunction(r=e.then)?r.call(e,t,n):t.call(void 0,e)}catch(e){n.call(void 0,e)}}function p(){re.removeEventListener("DOMContentLoaded",p),n.removeEventListener("load",p),Ee.ready()}function _(){this.expando=Ee.expando+_.uid++}function E(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(He,"-$&").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:Fe.test(n)?JSON.parse(n):n)}catch(e){}Be.set(e,t,n)}else n=void 0;return n}function g(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return Ee.css(e,t,"")},u=s(),l=n&&n[3]||(Ee.cssNumber[t]?"":"px"),f=(Ee.cssNumber[t]||"px"!==l&&+u)&&Ge.exec(Ee.css(e,t));if(f&&f[3]!==l){l=l||f[3],n=n||[],f=+u||1;do o=o||".5",f/=o,Ee.style(e,t,f+l);while(o!==(o=s()/u)&&1!==o&&--a)}return n&&(f=+f||+u||0,i=n[1]?f+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=f,r.end=i)),i}function y(e){var t,n=e.ownerDocument,r=e.nodeName,i=Je[r];return i?i:(t=n.body.appendChild(n.createElement(r)),i=Ee.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),Je[r]=i,i)}function R(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)r=e[o],r.style&&(n=r.style.display,t?("none"===n&&(i[o]=xe.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&Ve(r)&&(i[o]=y(r))):"none"!==n&&(i[o]="none",xe.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}function m(e,t){var n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&Ee.nodeName(e,t)?Ee.merge([e],n):n}function v(e,t){for(var n=0,r=e.length;n<r;n++)xe.set(e[n],"globalEval",!t||xe.get(t[n],"globalEval"))}function T(e,t,n,r,i){for(var o,a,s,u,l,f,d=t.createDocumentFragment(),c=[],h=0,p=e.length;h<p;h++)if(o=e[h],o||0===o)if("object"===Ee.type(o))Ee.merge(c,o.nodeType?[o]:o);else if($e.test(o)){for(a=a||d.appendChild(t.createElement("div")),s=(Qe.exec(o)||["",""])[1].toLowerCase(),u=ze[s]||ze._default,a.innerHTML=u[1]+Ee.htmlPrefilter(o)+u[2],f=u[0];f--;)a=a.lastChild;Ee.merge(c,a.childNodes),a=d.firstChild,a.textContent=""}else c.push(t.createTextNode(o));for(d.textContent="",h=0;o=c[h++];)if(r&&Ee.inArray(o,r)>-1)i&&i.push(o);else if(l=Ee.contains(o.ownerDocument,o),a=m(d.appendChild(o),"script"),l&&v(a),n)for(f=0;o=a[f++];)Ke.test(o.type||"")&&n.push(o);return d}function C(){return!0}function S(){return!1}function I(){try{return re.activeElement}catch(e){}}function A(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)A(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=S;else if(!i)return e;return 1===o&&(a=i,i=function(e){return Ee().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=Ee.guid++)),e.each(function(){Ee.event.add(this,t,i,r,n)})}function b(e,t){return Ee.nodeName(e,"table")&&Ee.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e:e}function w(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function D(e){var t=ot.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function P(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(xe.hasData(e)&&(o=xe.access(e),a=xe.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n<r;n++)Ee.event.add(t,i,l[i][n])}Be.hasData(e)&&(s=Be.access(e),u=Ee.extend({},s),Be.set(t,u))}}function O(e,t){var n=t.nodeName.toLowerCase();"input"===n&&We.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function N(e,t,n,r){t=ae.apply([],t);var i,o,s,u,l,f,d=0,c=e.length,h=c-1,p=t[0],_=Ee.isFunction(p);if(_||c>1&&"string"==typeof p&&!pe.checkClone&&it.test(p))return e.each(function(i){var o=e.eq(i);_&&(t[0]=p.call(this,i,o.html())),N(o,t,n,r)});if(c&&(i=T(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(s=Ee.map(m(i,"script"),w),u=s.length;d<c;d++)l=i,d!==h&&(l=Ee.clone(l,!0,!0),u&&Ee.merge(s,m(l,"script"))),n.call(e[d],l,d);if(u)for(f=s[s.length-1].ownerDocument,Ee.map(s,D),d=0;d<u;d++)l=s[d],Ke.test(l.type||"")&&!xe.access(l,"globalEval")&&Ee.contains(f,l)&&(l.src?Ee._evalUrl&&Ee._evalUrl(l.src):a(l.textContent.replace(at,""),f))}return e}function U(e,t,n){for(var r,i=t?Ee.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||Ee.cleanData(m(r)),r.parentNode&&(n&&Ee.contains(r.ownerDocument,r)&&v(m(r,"script")),r.parentNode.removeChild(r));return e}function L(e,t,n){var r,i,o,a,s=e.style;return n=n||lt(e),n&&(a=n.getPropertyValue(t)||n[t],""!==a||Ee.contains(e.ownerDocument,e)||(a=Ee.style(e,t)),!pe.pixelMarginRight()&&ut.test(a)&&st.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function k(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function M(e){if(e in pt)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=ht.length;n--;)if(e=ht[n]+t,e in pt)return e}function x(e,t,n){var r=Ge.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function B(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;o<4;o+=2)"margin"===n&&(a+=Ee.css(e,n+qe[o],!0,i)),r?("content"===n&&(a-=Ee.css(e,"padding"+qe[o],!0,i)),"margin"!==n&&(a-=Ee.css(e,"border"+qe[o]+"Width",!0,i))):(a+=Ee.css(e,"padding"+qe[o],!0,i),"padding"!==n&&(a+=Ee.css(e,"border"+qe[o]+"Width",!0,i)));return a}function F(e,t,n){var r,i=!0,o=lt(e),a="border-box"===Ee.css(e,"boxSizing",!1,o);if(e.getClientRects().length&&(r=e.getBoundingClientRect()[t]),r<=0||null==r){if(r=L(e,t,o),(r<0||null==r)&&(r=e.style[t]),ut.test(r))return r;i=a&&(pe.boxSizingReliable()||r===e.style[t]),r=parseFloat(r)||0}return r+B(e,t,n||(a?"border":"content"),i,o)+"px"}function H(e,t,n,r,i){return new H.prototype.init(e,t,n,r,i)}function j(){Et&&(n.requestAnimationFrame(j),Ee.fx.tick())}function G(){return n.setTimeout(function(){_t=void 0}),_t=Ee.now()}function q(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)n=qe[r],i["margin"+n]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function V(e,t,n){for(var r,i=(W.tweeners[t]||[]).concat(W.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function Y(e,t,n){var r,i,o,a,s,u,l,f,d="width"in t||"height"in t,c=this,h={},p=e.style,_=e.nodeType&&Ve(e),E=xe.get(e,"fxshow");n.queue||(a=Ee._queueHooks(e,"fx"),null==a.unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,c.always(function(){c.always(function(){a.unqueued--,Ee.queue(e,"fx").length||a.empty.fire()})}));for(r in t)if(i=t[r],gt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(_?"hide":"show")){if("show"!==i||!E||void 0===E[r])continue;_=!0}h[r]=E&&E[r]||Ee.style(e,r)}if(u=!Ee.isEmptyObject(t),u||!Ee.isEmptyObject(h)){d&&1===e.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],l=E&&E.display,null==l&&(l=xe.get(e,"display")),f=Ee.css(e,"display"),"none"===f&&(l?f=l:(R([e],!0),l=e.style.display||l,f=Ee.css(e,"display"),R([e]))),("inline"===f||"inline-block"===f&&null!=l)&&"none"===Ee.css(e,"float")&&(u||(c.done(function(){p.display=l}),null==l&&(f=p.display,l="none"===f?"":f)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",c.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]})),u=!1;for(r in h)u||(E?"hidden"in E&&(_=E.hidden):E=xe.access(e,"fxshow",{display:l}),o&&(E.hidden=!_),_&&R([e],!0),c.done(function(){_||R([e]),xe.remove(e,"fxshow");for(r in h)Ee.style(e,r,h[r])})),u=V(_?E[r]:0,r,c),r in E||(E[r]=u.start,_&&(u.end=u.start,u.start=0))}}function J(e,t){var n,r,i,o,a;for(n in e)if(r=Ee.camelCase(n),i=t[r],o=e[n],Ee.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=Ee.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function W(e,t,n){var r,i,o=0,a=W.prefilters.length,s=Ee.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=_t||G(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;a<u;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),o<1&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:Ee.extend({},t),opts:Ee.extend(!0,{specialEasing:{},easing:Ee.easing._default},n),originalProperties:t,originalOptions:n,startTime:_t||G(),duration:n.duration,tweens:[],createTween:function(t,n){var r=Ee.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),f=l.props;for(J(f,l.opts.specialEasing);o<a;o++)if(r=W.prefilters[o].call(l,e,f,l.opts))return Ee.isFunction(r.stop)&&(Ee._queueHooks(l.elem,l.opts.queue).stop=Ee.proxy(r.stop,r)),r;return Ee.map(f,V,l),Ee.isFunction(l.opts.start)&&l.opts.start.call(e,l),Ee.fx.timer(Ee.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function Q(e){return e.getAttribute&&e.getAttribute("class")||""}function K(e,t,n,r){var i;if(Ee.isArray(t))Ee.each(t,function(t,i){n||Pt.test(e)?r(e,i):K(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==Ee.type(t))r(e,t);else for(i in t)K(e+"["+i+"]",t[i],n,r)}function z(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(Ne)||[];if(Ee.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function $(e,t,n,r){function i(s){var u;return o[s]=!0,Ee.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||a||o[l]?a?!(u=l):void 0:(t.dataTypes.unshift(l),i(l),!1)}),u}var o={},a=e===Gt;return i(t.dataTypes[0])||!o["*"]&&i("*")}function Z(e,t){var n,r,i=Ee.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&Ee.extend(!0,e,r),e}function X(e,t,n){for(var r,i,o,a,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function ee(e,t,n,r){var i,o,a,s,u,l={},f=e.dataTypes.slice();if(f[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];for(o=f.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=f.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(a=l[u+" "+o]||l["* "+o],!a)for(i in l)if(s=i.split(" "),s[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){a===!0?a=l[i]:l[i]!==!0&&(o=s[0],f.unshift(s[1]));break}if(a!==!0)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}function te(e){return Ee.isWindow(e)?e:9===e.nodeType&&e.defaultView}var ne=[],re=n.document,ie=Object.getPrototypeOf,oe=ne.slice,ae=ne.concat,se=ne.push,ue=ne.indexOf,le={},fe=le.toString,de=le.hasOwnProperty,ce=de.toString,he=ce.call(Object),pe={},_e="3.1.0",Ee=function(e,t){return new Ee.fn.init(e,t)},ge=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ye=/^-ms-/,Re=/-([a-z])/g,me=function(e,t){return t.toUpperCase()};Ee.fn=Ee.prototype={jquery:_e,constructor:Ee,length:0,toArray:function(){return oe.call(this)},get:function(e){return null!=e?e<0?this[e+this.length]:this[e]:oe.call(this)},pushStack:function(e){var t=Ee.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return Ee.each(this,e)},map:function(e){return this.pushStack(Ee.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(oe.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:se,sort:ne.sort,splice:ne.splice},Ee.extend=Ee.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||Ee.isFunction(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],r=e[t],a!==r&&(l&&r&&(Ee.isPlainObject(r)||(i=Ee.isArray(r)))?(i?(i=!1,o=n&&Ee.isArray(n)?n:[]):o=n&&Ee.isPlainObject(n)?n:{},a[t]=Ee.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},Ee.extend({expando:"jQuery"+(_e+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===Ee.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=Ee.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==fe.call(e))&&(!(t=ie(e))||(n=de.call(t,"constructor")&&t.constructor, -"function"==typeof n&&ce.call(n)===he))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?le[fe.call(e)]||"object":typeof e},globalEval:function(e){a(e)},camelCase:function(e){return e.replace(ye,"ms-").replace(Re,me)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var n,r=0;if(s(e))for(n=e.length;r<n&&t.call(e[r],r,e[r])!==!1;r++);else for(r in e)if(t.call(e[r],r,e[r])===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(ge,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(s(Object(e))?Ee.merge(n,"string"==typeof e?[e]:e):se.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:ue.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],o=0,a=e.length,s=!n;o<a;o++)r=!t(e[o],o),r!==s&&i.push(e[o]);return i},map:function(e,t,n){var r,i,o=0,a=[];if(s(e))for(r=e.length;o<r;o++)i=t(e[o],o,n),null!=i&&a.push(i);else for(o in e)i=t(e[o],o,n),null!=i&&a.push(i);return ae.apply([],a)},guid:1,proxy:function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),Ee.isFunction(e))return r=oe.call(arguments,2),i=function(){return e.apply(t||this,r.concat(oe.call(arguments)))},i.guid=e.guid=e.guid||Ee.guid++,i},now:Date.now,support:pe}),"function"==typeof Symbol&&(Ee.fn[Symbol.iterator]=ne[Symbol.iterator]),Ee.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){le["[object "+t+"]"]=t.toLowerCase()});var ve=function(e){function t(e,t,n,r){var i,o,a,s,u,l,f,c=t&&t.ownerDocument,p=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==p&&9!==p&&11!==p)return n;if(!r&&((t?t.ownerDocument||t:j)!==U&&N(t),t=t||U,k)){if(11!==p&&(u=ge.exec(e)))if(i=u[1]){if(9===p){if(!(a=t.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(c&&(a=c.getElementById(i))&&F(t,a)&&a.id===i)return n.push(a),n}else{if(u[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((i=u[3])&&T.getElementsByClassName&&t.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(i)),n}if(T.qsa&&!J[e+" "]&&(!M||!M.test(e))){if(1!==p)c=t,f=e;else if("object"!==t.nodeName.toLowerCase()){for((s=t.getAttribute("id"))?s=s.replace(ve,Te):t.setAttribute("id",s=H),l=A(e),o=l.length;o--;)l[o]="#"+s+" "+h(l[o]);f=l.join(","),c=ye.test(e)&&d(t.parentNode)||t}if(f)try{return Z.apply(n,c.querySelectorAll(f)),n}catch(e){}finally{s===H&&t.removeAttribute("id")}}}return w(e.replace(se,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>C.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[H]=!0,e}function i(e){var t=U.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)C.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return function(t){return"label"in t&&t.disabled===e||"form"in t&&t.disabled===e||"form"in t&&t.disabled===!1&&(t.isDisabled===e||t.isDisabled!==!e&&("label"in t||!Se(t))!==e)}}function f(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function d(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function c(){}function h(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function p(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=q++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,i)}:function(t,n,u){var l,f,d,c=[G,s];if(u){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,u))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(d=t[H]||(t[H]={}),f=d[t.uniqueID]||(d[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=f[o])&&l[0]===G&&l[1]===s)return c[2]=l[2];if(f[o]=c,c[2]=e(t,n,u))return!0}}}function _(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function E(e,n,r){for(var i=0,o=n.length;i<o;i++)t(e,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function y(e,t,n,i,o,a){return i&&!i[H]&&(i=y(i)),o&&!o[H]&&(o=y(o,a)),r(function(r,a,s,u){var l,f,d,c=[],h=[],p=a.length,_=r||E(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?_:g(_,c,e,s,u),R=n?o||(r?e:p||i)?[]:a:y;if(n&&n(y,R,s,u),i)for(l=g(R,h),i(l,[],s,u),f=l.length;f--;)(d=l[f])&&(R[h[f]]=!(y[h[f]]=d));if(r){if(o||e){if(o){for(l=[],f=R.length;f--;)(d=R[f])&&l.push(y[f]=d);o(null,R=[],l,u)}for(f=R.length;f--;)(d=R[f])&&(l=o?ee(r,d):c[f])>-1&&(r[l]=!(a[l]=d))}}else R=g(R===a?R.splice(p,R.length):R),o?o(null,a,R,u):Z.apply(a,R)})}function R(e){for(var t,n,r,i=e.length,o=C.relative[e[0].type],a=o||C.relative[" "],s=o?1:0,u=p(function(e){return e===t},a,!0),l=p(function(e){return ee(t,e)>-1},a,!0),f=[function(e,n,r){var i=!o&&(r||n!==D)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];s<i;s++)if(n=C.relative[e[s].type])f=[p(_(f),n)];else{if(n=C.filter[e[s].type].apply(null,e[s].matches),n[H]){for(r=++s;r<i&&!C.relative[e[r].type];r++);return y(s>1&&_(f),s>1&&h(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,s<r&&R(e.slice(s,r)),r<i&&R(e=e.slice(r)),r<i&&h(e))}f.push(n)}return _(f)}function m(e,n){var i=n.length>0,o=e.length>0,a=function(r,a,s,u,l){var f,d,c,h=0,p="0",_=r&&[],E=[],y=D,R=r||o&&C.find.TAG("*",l),m=G+=null==y?1:Math.random()||.1,v=R.length;for(l&&(D=a===U||a||l);p!==v&&null!=(f=R[p]);p++){if(o&&f){for(d=0,a||f.ownerDocument===U||(N(f),s=!k);c=e[d++];)if(c(f,a||U,s)){u.push(f);break}l&&(G=m)}i&&((f=!c&&f)&&h--,r&&_.push(f))}if(h+=p,i&&p!==h){for(d=0;c=n[d++];)c(_,E,a,s);if(r){if(h>0)for(;p--;)_[p]||E[p]||(E[p]=z.call(u));E=g(E)}Z.apply(u,E),l&&!r&&E.length>0&&h+n.length>1&&t.uniqueSort(u)}return l&&(G=m,D=y),_};return i?r(a):a}var v,T,C,S,I,A,b,w,D,P,O,N,U,L,k,M,x,B,F,H="sizzle"+1*new Date,j=e.document,G=0,q=0,V=n(),Y=n(),J=n(),W=function(e,t){return e===t&&(O=!0),0},Q={}.hasOwnProperty,K=[],z=K.pop,$=K.push,Z=K.push,X=K.slice,ee=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",ie="\\["+ne+"*("+re+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+re+"))|)"+ne+"*\\]",oe=":("+re+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ie+")*)|.*)\\)|)",ae=new RegExp(ne+"+","g"),se=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),ue=new RegExp("^"+ne+"*,"+ne+"*"),le=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),fe=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),de=new RegExp(oe),ce=new RegExp("^"+re+"$"),he={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,_e=/^h\d$/i,Ee=/^[^{]+\{\s*\[native \w/,ge=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,Re=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),me=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},ve=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,Te=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},Ce=function(){N()},Se=p(function(e){return e.disabled===!0},{dir:"parentNode",next:"legend"});try{Z.apply(K=X.call(j.childNodes),j.childNodes),K[j.childNodes.length].nodeType}catch(e){Z={apply:K.length?function(e,t){$.apply(e,X.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}T=t.support={},I=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},N=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:j;return r!==U&&9===r.nodeType&&r.documentElement?(U=r,L=U.documentElement,k=!I(U),j!==U&&(n=U.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Ce,!1):n.attachEvent&&n.attachEvent("onunload",Ce)),T.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),T.getElementsByTagName=i(function(e){return e.appendChild(U.createComment("")),!e.getElementsByTagName("*").length}),T.getElementsByClassName=Ee.test(U.getElementsByClassName),T.getById=i(function(e){return L.appendChild(e).id=H,!U.getElementsByName||!U.getElementsByName(H).length}),T.getById?(C.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&k){var n=t.getElementById(e);return n?[n]:[]}},C.filter.ID=function(e){var t=e.replace(Re,me);return function(e){return e.getAttribute("id")===t}}):(delete C.find.ID,C.filter.ID=function(e){var t=e.replace(Re,me);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),C.find.TAG=T.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):T.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},C.find.CLASS=T.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&k)return t.getElementsByClassName(e)},x=[],M=[],(T.qsa=Ee.test(U.querySelectorAll))&&(i(function(e){L.appendChild(e).innerHTML="<a id='"+H+"'></a><select id='"+H+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&M.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||M.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+H+"-]").length||M.push("~="),e.querySelectorAll(":checked").length||M.push(":checked"),e.querySelectorAll("a#"+H+"+*").length||M.push(".#.+[+~]")}),i(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=U.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&M.push("name"+ne+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&M.push(":enabled",":disabled"),L.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&M.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),M.push(",.*:")})),(T.matchesSelector=Ee.test(B=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){T.disconnectedMatch=B.call(e,"*"),B.call(e,"[s!='']:x"),x.push("!=",oe)}),M=M.length&&new RegExp(M.join("|")),x=x.length&&new RegExp(x.join("|")),t=Ee.test(L.compareDocumentPosition),F=t||Ee.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},W=t?function(e,t){if(e===t)return O=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!T.sortDetached&&t.compareDocumentPosition(e)===n?e===U||e.ownerDocument===j&&F(j,e)?-1:t===U||t.ownerDocument===j&&F(j,t)?1:P?ee(P,e)-ee(P,t):0:4&n?-1:1)}:function(e,t){if(e===t)return O=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],u=[t];if(!i||!o)return e===U?-1:t===U?1:i?-1:o?1:P?ee(P,e)-ee(P,t):0;if(i===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;s[r]===u[r];)r++;return r?a(s[r],u[r]):s[r]===j?-1:u[r]===j?1:0},U):U},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==U&&N(e),n=n.replace(fe,"='$1']"),T.matchesSelector&&k&&!J[n+" "]&&(!x||!x.test(n))&&(!M||!M.test(n)))try{var r=B.call(e,n);if(r||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return t(n,U,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==U&&N(e),F(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==U&&N(e);var n=C.attrHandle[t.toLowerCase()],r=n&&Q.call(C.attrHandle,t.toLowerCase())?n(e,t,!k):void 0;return void 0!==r?r:T.attributes||!k?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.escape=function(e){return(e+"").replace(ve,Te)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(O=!T.detectDuplicates,P=!T.sortStable&&e.slice(0),e.sort(W),O){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return P=null,e},S=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=S(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=S(t);return n},C=t.selectors={cacheLength:50,createPseudo:r,match:he,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Re,me),e[3]=(e[3]||e[4]||e[5]||"").replace(Re,me),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=A(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Re,me).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=V[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&V(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ae," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,f,d,c,h,p,_=o!==a?"nextSibling":"previousSibling",E=t.parentNode,g=s&&t.nodeName.toLowerCase(),y=!u&&!s,R=!1;if(E){if(o){for(;_;){for(c=t;c=c[_];)if(s?c.nodeName.toLowerCase()===g:1===c.nodeType)return!1;p=_="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?E.firstChild:E.lastChild],a&&y){for(c=E,d=c[H]||(c[H]={}),f=d[c.uniqueID]||(d[c.uniqueID]={}),l=f[e]||[],h=l[0]===G&&l[1],R=h&&l[2],c=h&&E.childNodes[h];c=++h&&c&&c[_]||(R=h=0)||p.pop();)if(1===c.nodeType&&++R&&c===t){f[e]=[G,h,R];break}}else if(y&&(c=t,d=c[H]||(c[H]={}),f=d[c.uniqueID]||(d[c.uniqueID]={}),l=f[e]||[],h=l[0]===G&&l[1],R=h),R===!1)for(;(c=++h&&c&&c[_]||(R=h=0)||p.pop())&&((s?c.nodeName.toLowerCase()!==g:1!==c.nodeType)||!++R||(y&&(d=c[H]||(c[H]={}),f=d[c.uniqueID]||(d[c.uniqueID]={}),f[e]=[G,R]),c!==t)););return R-=i,R===r||R%r===0&&R/r>=0}}},PSEUDO:function(e,n){var i,o=C.pseudos[e]||C.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[H]?o(n):o.length>1?(i=[e,e,"",n],C.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=b(e.replace(se,"$1"));return i[H]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(Re,me),function(t){return(t.textContent||t.innerText||S(t)).indexOf(e)>-1}}),lang:r(function(e){return ce.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(Re,me).toLowerCase(),function(t){var n;do if(n=k?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===L},focus:function(e){return e===U.activeElement&&(!U.hasFocus||U.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:l(!1),disabled:l(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!C.pseudos.empty(e)},header:function(e){return _e.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:f(function(){return[0]}),last:f(function(e,t){return[t-1]}),eq:f(function(e,t,n){return[n<0?n+t:n]}),even:f(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:f(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:f(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:f(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},C.pseudos.nth=C.pseudos.eq;for(v in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.pseudos[v]=s(v);for(v in{submit:!0,reset:!0})C.pseudos[v]=u(v);return c.prototype=C.filters=C.pseudos,C.setFilters=new c,A=t.tokenize=function(e,n){var r,i,o,a,s,u,l,f=Y[e+" "];if(f)return n?0:f.slice(0);for(s=e,u=[],l=C.preFilter;s;){r&&!(i=ue.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(o=[])),r=!1,(i=le.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(se," ")}),s=s.slice(r.length));for(a in C.filter)!(i=he[a].exec(s))||l[a]&&!(i=l[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?t.error(e):Y(e,u).slice(0)},b=t.compile=function(e,t){var n,r=[],i=[],o=J[e+" "];if(!o){for(t||(t=A(e)),n=t.length;n--;)o=R(t[n]),o[H]?r.push(o):i.push(o);o=J(e,m(i,r)),o.selector=e}return o},w=t.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,f=!r&&A(e=l.selector||e);if(n=n||[],1===f.length){if(o=f[0]=f[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&T.getById&&9===t.nodeType&&k&&C.relative[o[1].type]){if(t=(C.find.ID(a.matches[0].replace(Re,me),t)||[])[0],!t)return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=he.needsContext.test(e)?0:o.length;i--&&(a=o[i],!C.relative[s=a.type]);)if((u=C.find[s])&&(r=u(a.matches[0].replace(Re,me),ye.test(o[0].type)&&d(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&h(o),!e)return Z.apply(n,r),n;break}}return(l||b(e,f))(r,t,!k,n,!t||ye.test(e)&&d(t.parentNode)||t),n},T.sortStable=H.split("").sort(W).join("")===H,T.detectDuplicates=!!O,N(),T.sortDetached=i(function(e){return 1&e.compareDocumentPosition(U.createElement("fieldset"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),T.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(n);Ee.find=ve,Ee.expr=ve.selectors,Ee.expr[":"]=Ee.expr.pseudos,Ee.uniqueSort=Ee.unique=ve.uniqueSort,Ee.text=ve.getText,Ee.isXMLDoc=ve.isXML,Ee.contains=ve.contains,Ee.escapeSelector=ve.escape;var Te=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&Ee(e).is(n))break;r.push(e)}return r},Ce=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},Se=Ee.expr.match.needsContext,Ie=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,Ae=/^.[^:#\[\.,]*$/;Ee.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?Ee.find.matchesSelector(r,e)?[r]:[]:Ee.find.matches(e,Ee.grep(t,function(e){return 1===e.nodeType}))},Ee.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(Ee(e).filter(function(){for(t=0;t<r;t++)if(Ee.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)Ee.find(e,i[t],n);return r>1?Ee.uniqueSort(n):n},filter:function(e){return this.pushStack(u(this,e||[],!1))},not:function(e){return this.pushStack(u(this,e||[],!0))},is:function(e){return!!u(this,"string"==typeof e&&Se.test(e)?Ee(e):e||[],!1).length}});var be,we=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,De=Ee.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||be,"string"==typeof e){if(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:we.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof Ee?t[0]:t,Ee.merge(this,Ee.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:re,!0)),Ie.test(r[1])&&Ee.isPlainObject(t))for(r in t)Ee.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=re.getElementById(r[2]),i&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):Ee.isFunction(e)?void 0!==n.ready?n.ready(e):e(Ee):Ee.makeArray(e,this)};De.prototype=Ee.fn,be=Ee(re);var Pe=/^(?:parents|prev(?:Until|All))/,Oe={children:!0,contents:!0,next:!0,prev:!0};Ee.fn.extend({has:function(e){var t=Ee(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(Ee.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&Ee(e);if(!Se.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&Ee.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?Ee.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?ue.call(Ee(e),this[0]):ue.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(Ee.uniqueSort(Ee.merge(this.get(),Ee(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),Ee.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Te(e,"parentNode")},parentsUntil:function(e,t,n){return Te(e,"parentNode",n)},next:function(e){return l(e,"nextSibling")},prev:function(e){return l(e,"previousSibling")},nextAll:function(e){return Te(e,"nextSibling")},prevAll:function(e){return Te(e,"previousSibling")},nextUntil:function(e,t,n){return Te(e,"nextSibling",n)},prevUntil:function(e,t,n){return Te(e,"previousSibling",n)},siblings:function(e){return Ce((e.parentNode||{}).firstChild,e)},children:function(e){return Ce(e.firstChild)},contents:function(e){return e.contentDocument||Ee.merge([],e.childNodes)}},function(e,t){Ee.fn[e]=function(n,r){var i=Ee.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=Ee.filter(r,i)),this.length>1&&(Oe[e]||Ee.uniqueSort(i),Pe.test(e)&&i.reverse()),this.pushStack(i)}});var Ne=/\S+/g;Ee.Callbacks=function(e){e="string"==typeof e?f(e):Ee.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s<o.length;)o[s].apply(n[0],n[1])===!1&&e.stopOnFalse&&(s=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},l={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){Ee.each(n,function(n,r){Ee.isFunction(r)?e.unique&&l.has(r)||o.push(r):r&&r.length&&"string"!==Ee.type(r)&&t(r)})}(arguments),n&&!t&&u()),this},remove:function(){return Ee.each(arguments,function(e,t){for(var n;(n=Ee.inArray(t,o,n))>-1;)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?Ee.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},Ee.extend({Deferred:function(e){var t=[["notify","progress",Ee.Callbacks("memory"),Ee.Callbacks("memory"),2],["resolve","done",Ee.Callbacks("once memory"),Ee.Callbacks("once memory"),0,"resolved"],["reject","fail",Ee.Callbacks("once memory"),Ee.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return Ee.Deferred(function(n){Ee.each(t,function(t,r){var i=Ee.isFunction(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&Ee.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(e,r,i){function o(e,t,r,i){return function(){var s=this,u=arguments,l=function(){var n,l;if(!(e<a)){if(n=r.apply(s,u),n===t.promise())throw new TypeError("Thenable self-resolution");l=n&&("object"==typeof n||"function"==typeof n)&&n.then,Ee.isFunction(l)?i?l.call(n,o(a,t,d,i),o(a,t,c,i)):(a++,l.call(n,o(a,t,d,i),o(a,t,c,i),o(a,t,d,t.notifyWith))):(r!==d&&(s=void 0,u=[n]),(i||t.resolveWith)(s,u))}},f=i?l:function(){try{l()}catch(n){Ee.Deferred.exceptionHook&&Ee.Deferred.exceptionHook(n,f.stackTrace),e+1>=a&&(r!==c&&(s=void 0,u=[n]),t.rejectWith(s,u))}};e?f():(Ee.Deferred.getStackHook&&(f.stackTrace=Ee.Deferred.getStackHook()),n.setTimeout(f))}}var a=0;return Ee.Deferred(function(n){t[0][3].add(o(0,n,Ee.isFunction(i)?i:d,n.notifyWith)),t[1][3].add(o(0,n,Ee.isFunction(e)?e:d)),t[2][3].add(o(0,n,Ee.isFunction(r)?r:c))}).promise()},promise:function(e){return null!=e?Ee.extend(e,i):i}},o={};return Ee.each(t,function(e,n){var a=n[2],s=n[5];i[n[1]]=a.add,s&&a.add(function(){r=s},t[3-e][2].disable,t[0][2].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith}),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=oe.call(arguments),o=Ee.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?oe.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(h(e,o.done(a(n)).resolve,o.reject),"pending"===o.state()||Ee.isFunction(i[n]&&i[n].then)))return o.then();for(;n--;)h(i[n],a(n),o.reject);return o.promise()}});var Ue=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;Ee.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&Ue.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},Ee.readyException=function(e){n.setTimeout(function(){throw e})};var Le=Ee.Deferred();Ee.fn.ready=function(e){return Le.then(e).catch(function(e){Ee.readyException(e)}),this},Ee.extend({isReady:!1,readyWait:1,holdReady:function(e){e?Ee.readyWait++:Ee.ready(!0)},ready:function(e){(e===!0?--Ee.readyWait:Ee.isReady)||(Ee.isReady=!0,e!==!0&&--Ee.readyWait>0||Le.resolveWith(re,[Ee]))}}),Ee.ready.then=Le.then,"complete"===re.readyState||"loading"!==re.readyState&&!re.documentElement.doScroll?n.setTimeout(Ee.ready):(re.addEventListener("DOMContentLoaded",p),n.addEventListener("load",p));var ke=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===Ee.type(n)){i=!0;for(s in n)ke(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,Ee.isFunction(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(Ee(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},Me=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};_.uid=1,_.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Me(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[Ee.camelCase(t)]=n;else for(r in t)i[Ee.camelCase(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][Ee.camelCase(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){Ee.isArray(t)?t=t.map(Ee.camelCase):(t=Ee.camelCase(t),t=t in r?[t]:t.match(Ne)||[]),n=t.length;for(;n--;)delete r[t[n]]}(void 0===t||Ee.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!Ee.isEmptyObject(t)}};var xe=new _,Be=new _,Fe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,He=/[A-Z]/g;Ee.extend({hasData:function(e){return Be.hasData(e)||xe.hasData(e)},data:function(e,t,n){return Be.access(e,t,n)},removeData:function(e,t){Be.remove(e,t)},_data:function(e,t,n){return xe.access(e,t,n)},_removeData:function(e,t){xe.remove(e,t)}}),Ee.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=Be.get(o),1===o.nodeType&&!xe.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=Ee.camelCase(r.slice(5)),E(o,r,i[r])));xe.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){Be.set(this,e)}):ke(this,function(t){var n;if(o&&void 0===t){if(n=Be.get(o,e),void 0!==n)return n;if(n=E(o,e),void 0!==n)return n}else this.each(function(){Be.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Be.remove(this,e)})}}),Ee.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=xe.get(e,t),n&&(!r||Ee.isArray(n)?r=xe.access(e,t,Ee.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=Ee.queue(e,t),r=n.length,i=n.shift(),o=Ee._queueHooks(e,t),a=function(){Ee.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return xe.get(e,n)||xe.access(e,n,{empty:Ee.Callbacks("once memory").add(function(){xe.remove(e,[t+"queue",n])})})}}),Ee.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?Ee.queue(this[0],e):void 0===t?this:this.each(function(){var n=Ee.queue(this,e,t);Ee._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&Ee.dequeue(this,e)})},dequeue:function(e){return this.each(function(){Ee.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=Ee.Deferred(),o=this,a=this.length,s=function(){ ---r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)n=xe.get(o[a],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var je=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Ge=new RegExp("^(?:([+-])=|)("+je+")([a-z%]*)$","i"),qe=["Top","Right","Bottom","Left"],Ve=function(e,t){return e=t||e,"none"===e.style.display||""===e.style.display&&Ee.contains(e.ownerDocument,e)&&"none"===Ee.css(e,"display")},Ye=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i},Je={};Ee.fn.extend({show:function(){return R(this,!0)},hide:function(){return R(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Ve(this)?Ee(this).show():Ee(this).hide()})}});var We=/^(?:checkbox|radio)$/i,Qe=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,Ke=/^$|\/(?:java|ecma)script/i,ze={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ze.optgroup=ze.option,ze.tbody=ze.tfoot=ze.colgroup=ze.caption=ze.thead,ze.th=ze.td;var $e=/<|&#?\w+;/;!function(){var e=re.createDocumentFragment(),t=e.appendChild(re.createElement("div")),n=re.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),pe.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",pe.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Ze=re.documentElement,Xe=/^key/,et=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,tt=/^([^.]*)(?:\.(.+)|)/;Ee.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,f,d,c,h,p,_,E=xe.get(e);if(E)for(n.handler&&(o=n,n=o.handler,i=o.selector),i&&Ee.find.matchesSelector(Ze,i),n.guid||(n.guid=Ee.guid++),(u=E.events)||(u=E.events={}),(a=E.handle)||(a=E.handle=function(t){return"undefined"!=typeof Ee&&Ee.event.triggered!==t.type?Ee.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(Ne)||[""],l=t.length;l--;)s=tt.exec(t[l])||[],h=_=s[1],p=(s[2]||"").split(".").sort(),h&&(d=Ee.event.special[h]||{},h=(i?d.delegateType:d.bindType)||h,d=Ee.event.special[h]||{},f=Ee.extend({type:h,origType:_,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&Ee.expr.match.needsContext.test(i),namespace:p.join(".")},o),(c=u[h])||(c=u[h]=[],c.delegateCount=0,d.setup&&d.setup.call(e,r,p,a)!==!1||e.addEventListener&&e.addEventListener(h,a)),d.add&&(d.add.call(e,f),f.handler.guid||(f.handler.guid=n.guid)),i?c.splice(c.delegateCount++,0,f):c.push(f),Ee.event.global[h]=!0)},remove:function(e,t,n,r,i){var o,a,s,u,l,f,d,c,h,p,_,E=xe.hasData(e)&&xe.get(e);if(E&&(u=E.events)){for(t=(t||"").match(Ne)||[""],l=t.length;l--;)if(s=tt.exec(t[l])||[],h=_=s[1],p=(s[2]||"").split(".").sort(),h){for(d=Ee.event.special[h]||{},h=(r?d.delegateType:d.bindType)||h,c=u[h]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=c.length;o--;)f=c[o],!i&&_!==f.origType||n&&n.guid!==f.guid||s&&!s.test(f.namespace)||r&&r!==f.selector&&("**"!==r||!f.selector)||(c.splice(o,1),f.selector&&c.delegateCount--,d.remove&&d.remove.call(e,f));a&&!c.length&&(d.teardown&&d.teardown.call(e,p,E.handle)!==!1||Ee.removeEvent(e,h,E.handle),delete u[h])}else for(h in u)Ee.event.remove(e,h+t[l],n,r,!0);Ee.isEmptyObject(u)&&xe.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=Ee.event.fix(e),u=new Array(arguments.length),l=(xe.get(this,"events")||{})[s.type]||[],f=Ee.event.special[s.type]||{};for(u[0]=s,t=1;t<arguments.length;t++)u[t]=arguments[t];if(s.delegateTarget=this,!f.preDispatch||f.preDispatch.call(this,s)!==!1){for(a=Ee.event.handlers.call(this,s,l),t=0;(i=a[t++])&&!s.isPropagationStopped();)for(s.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!s.rnamespace.test(o.namespace)||(s.handleObj=o,s.data=o.data,r=((Ee.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,u),void 0!==r&&(s.result=r)===!1&&(s.preventDefault(),s.stopPropagation()));return f.postDispatch&&f.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(r=[],n=0;n<s;n++)o=t[n],i=o.selector+" ",void 0===r[i]&&(r[i]=o.needsContext?Ee(i,this).index(u)>-1:Ee.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&a.push({elem:u,handlers:r})}return s<t.length&&a.push({elem:this,handlers:t.slice(s)}),a},addProp:function(e,t){Object.defineProperty(Ee.Event.prototype,e,{enumerable:!0,configurable:!0,get:Ee.isFunction(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[Ee.expando]?e:new Ee.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==I()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===I()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&Ee.nodeName(this,"input"))return this.click(),!1},_default:function(e){return Ee.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},Ee.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},Ee.Event=function(e,t){return this instanceof Ee.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?C:S,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&Ee.extend(this,t),this.timeStamp=e&&e.timeStamp||Ee.now(),void(this[Ee.expando]=!0)):new Ee.Event(e,t)},Ee.Event.prototype={constructor:Ee.Event,isDefaultPrevented:S,isPropagationStopped:S,isImmediatePropagationStopped:S,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=C,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=C,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=C,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},Ee.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&Xe.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&et.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},Ee.event.addProp),Ee.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){Ee.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||Ee.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),Ee.fn.extend({on:function(e,t,n,r){return A(this,e,t,n,r)},one:function(e,t,n,r){return A(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,Ee(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return t!==!1&&"function"!=typeof t||(n=t,t=void 0),n===!1&&(n=S),this.each(function(){Ee.event.remove(this,e,n,t)})}});var nt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,rt=/<script|<style|<link/i,it=/checked\s*(?:[^=]|=\s*.checked.)/i,ot=/^true\/(.*)/,at=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;Ee.extend({htmlPrefilter:function(e){return e.replace(nt,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=Ee.contains(e.ownerDocument,e);if(!(pe.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||Ee.isXMLDoc(e)))for(a=m(s),o=m(e),r=0,i=o.length;r<i;r++)O(o[r],a[r]);if(t)if(n)for(o=o||m(e),a=a||m(s),r=0,i=o.length;r<i;r++)P(o[r],a[r]);else P(e,s);return a=m(s,"script"),a.length>0&&v(a,!u&&m(e,"script")),s},cleanData:function(e){for(var t,n,r,i=Ee.event.special,o=0;void 0!==(n=e[o]);o++)if(Me(n)){if(t=n[xe.expando]){if(t.events)for(r in t.events)i[r]?Ee.event.remove(n,r):Ee.removeEvent(n,r,t.handle);n[xe.expando]=void 0}n[Be.expando]&&(n[Be.expando]=void 0)}}}),Ee.fn.extend({detach:function(e){return U(this,e,!0)},remove:function(e){return U(this,e)},text:function(e){return ke(this,function(e){return void 0===e?Ee.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return N(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=b(this,e);t.appendChild(e)}})},prepend:function(){return N(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=b(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return N(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return N(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(Ee.cleanData(m(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return Ee.clone(this,e,t)})},html:function(e){return ke(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!rt.test(e)&&!ze[(Qe.exec(e)||["",""])[1].toLowerCase()]){e=Ee.htmlPrefilter(e);try{for(;n<r;n++)t=this[n]||{},1===t.nodeType&&(Ee.cleanData(m(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return N(this,arguments,function(t){var n=this.parentNode;Ee.inArray(this,e)<0&&(Ee.cleanData(m(this)),n&&n.replaceChild(t,this))},e)}}),Ee.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){Ee.fn[e]=function(e){for(var n,r=[],i=Ee(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),Ee(i[a])[t](n),se.apply(r,n.get());return this.pushStack(r)}});var st=/^margin/,ut=new RegExp("^("+je+")(?!px)[a-z%]+$","i"),lt=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=n),t.getComputedStyle(e)};!function(){function e(){if(s){s.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",s.innerHTML="",Ze.appendChild(a);var e=n.getComputedStyle(s);t="1%"!==e.top,o="2px"===e.marginLeft,r="4px"===e.width,s.style.marginRight="50%",i="4px"===e.marginRight,Ze.removeChild(a),s=null}}var t,r,i,o,a=re.createElement("div"),s=re.createElement("div");s.style&&(s.style.backgroundClip="content-box",s.cloneNode(!0).style.backgroundClip="",pe.clearCloneStyle="content-box"===s.style.backgroundClip,a.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",a.appendChild(s),Ee.extend(pe,{pixelPosition:function(){return e(),t},boxSizingReliable:function(){return e(),r},pixelMarginRight:function(){return e(),i},reliableMarginLeft:function(){return e(),o}}))}();var ft=/^(none|table(?!-c[ea]).+)/,dt={position:"absolute",visibility:"hidden",display:"block"},ct={letterSpacing:"0",fontWeight:"400"},ht=["Webkit","Moz","ms"],pt=re.createElement("div").style;Ee.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=L(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=Ee.camelCase(t),u=e.style;return t=Ee.cssProps[s]||(Ee.cssProps[s]=M(s)||s),a=Ee.cssHooks[t]||Ee.cssHooks[s],void 0===n?a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t]:(o=typeof n,"string"===o&&(i=Ge.exec(n))&&i[1]&&(n=g(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(Ee.cssNumber[s]?"":"px")),pe.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u[t]=n)),void 0)}},css:function(e,t,n,r){var i,o,a,s=Ee.camelCase(t);return t=Ee.cssProps[s]||(Ee.cssProps[s]=M(s)||s),a=Ee.cssHooks[t]||Ee.cssHooks[s],a&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=L(e,t,r)),"normal"===i&&t in ct&&(i=ct[t]),""===n||n?(o=parseFloat(i),n===!0||isFinite(o)?o||0:i):i}}),Ee.each(["height","width"],function(e,t){Ee.cssHooks[t]={get:function(e,n,r){if(n)return!ft.test(Ee.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?F(e,t,r):Ye(e,dt,function(){return F(e,t,r)})},set:function(e,n,r){var i,o=r&<(e),a=r&&B(e,t,r,"border-box"===Ee.css(e,"boxSizing",!1,o),o);return a&&(i=Ge.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=Ee.css(e,t)),x(e,n,a)}}}),Ee.cssHooks.marginLeft=k(pe.reliableMarginLeft,function(e,t){if(t)return(parseFloat(L(e,"marginLeft"))||e.getBoundingClientRect().left-Ye(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),Ee.each({margin:"",padding:"",border:"Width"},function(e,t){Ee.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+qe[r]+t]=o[r]||o[r-2]||o[0];return i}},st.test(e)||(Ee.cssHooks[e+t].set=x)}),Ee.fn.extend({css:function(e,t){return ke(this,function(e,t,n){var r,i,o={},a=0;if(Ee.isArray(t)){for(r=lt(e),i=t.length;a<i;a++)o[t[a]]=Ee.css(e,t[a],!1,r);return o}return void 0!==n?Ee.style(e,t,n):Ee.css(e,t)},e,t,arguments.length>1)}}),Ee.Tween=H,H.prototype={constructor:H,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||Ee.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(Ee.cssNumber[n]?"":"px")},cur:function(){var e=H.propHooks[this.prop];return e&&e.get?e.get(this):H.propHooks._default.get(this)},run:function(e){var t,n=H.propHooks[this.prop];return this.options.duration?this.pos=t=Ee.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):H.propHooks._default.set(this),this}},H.prototype.init.prototype=H.prototype,H.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=Ee.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){Ee.fx.step[e.prop]?Ee.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[Ee.cssProps[e.prop]]&&!Ee.cssHooks[e.prop]?e.elem[e.prop]=e.now:Ee.style(e.elem,e.prop,e.now+e.unit)}}},H.propHooks.scrollTop=H.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},Ee.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},Ee.fx=H.prototype.init,Ee.fx.step={};var _t,Et,gt=/^(?:toggle|show|hide)$/,yt=/queueHooks$/;Ee.Animation=Ee.extend(W,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return g(n.elem,e,Ge.exec(t),n),n}]},tweener:function(e,t){Ee.isFunction(e)?(t=e,e=["*"]):e=e.match(Ne);for(var n,r=0,i=e.length;r<i;r++)n=e[r],W.tweeners[n]=W.tweeners[n]||[],W.tweeners[n].unshift(t)},prefilters:[Y],prefilter:function(e,t){t?W.prefilters.unshift(e):W.prefilters.push(e)}}),Ee.speed=function(e,t,n){var r=e&&"object"==typeof e?Ee.extend({},e):{complete:n||!n&&t||Ee.isFunction(e)&&e,duration:e,easing:n&&t||t&&!Ee.isFunction(t)&&t};return Ee.fx.off||re.hidden?r.duration=0:r.duration="number"==typeof r.duration?r.duration:r.duration in Ee.fx.speeds?Ee.fx.speeds[r.duration]:Ee.fx.speeds._default,null!=r.queue&&r.queue!==!0||(r.queue="fx"),r.old=r.complete,r.complete=function(){Ee.isFunction(r.old)&&r.old.call(this),r.queue&&Ee.dequeue(this,r.queue)},r},Ee.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Ve).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=Ee.isEmptyObject(e),o=Ee.speed(t,n,r),a=function(){var t=W(this,Ee.extend({},e),o);(i||xe.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=Ee.timers,a=xe.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&yt.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||Ee.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=xe.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=Ee.timers,a=r?r.length:0;for(n.finish=!0,Ee.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),Ee.each(["toggle","show","hide"],function(e,t){var n=Ee.fn[t];Ee.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(q(t,!0),e,r,i)}}),Ee.each({slideDown:q("show"),slideUp:q("hide"),slideToggle:q("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){Ee.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),Ee.timers=[],Ee.fx.tick=function(){var e,t=0,n=Ee.timers;for(_t=Ee.now();t<n.length;t++)e=n[t],e()||n[t]!==e||n.splice(t--,1);n.length||Ee.fx.stop(),_t=void 0},Ee.fx.timer=function(e){Ee.timers.push(e),e()?Ee.fx.start():Ee.timers.pop()},Ee.fx.interval=13,Ee.fx.start=function(){Et||(Et=n.requestAnimationFrame?n.requestAnimationFrame(j):n.setInterval(Ee.fx.tick,Ee.fx.interval))},Ee.fx.stop=function(){n.cancelAnimationFrame?n.cancelAnimationFrame(Et):n.clearInterval(Et),Et=null},Ee.fx.speeds={slow:600,fast:200,_default:400},Ee.fn.delay=function(e,t){return e=Ee.fx?Ee.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,r){var i=n.setTimeout(t,e);r.stop=function(){n.clearTimeout(i)}})},function(){var e=re.createElement("input"),t=re.createElement("select"),n=t.appendChild(re.createElement("option"));e.type="checkbox",pe.checkOn=""!==e.value,pe.optSelected=n.selected,e=re.createElement("input"),e.value="t",e.type="radio",pe.radioValue="t"===e.value}();var Rt,mt=Ee.expr.attrHandle;Ee.fn.extend({attr:function(e,t){return ke(this,Ee.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){Ee.removeAttr(this,e)})}}),Ee.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?Ee.prop(e,t,n):(1===o&&Ee.isXMLDoc(e)||(i=Ee.attrHooks[t.toLowerCase()]||(Ee.expr.match.bool.test(t)?Rt:void 0)),void 0!==n?null===n?void Ee.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=Ee.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!pe.radioValue&&"radio"===t&&Ee.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(Ne);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),Rt={set:function(e,t,n){return t===!1?Ee.removeAttr(e,n):e.setAttribute(n,n),n}},Ee.each(Ee.expr.match.bool.source.match(/\w+/g),function(e,t){var n=mt[t]||Ee.find.attr;mt[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=mt[a],mt[a]=i,i=null!=n(e,t,r)?a:null,mt[a]=o),i}});var vt=/^(?:input|select|textarea|button)$/i,Tt=/^(?:a|area)$/i;Ee.fn.extend({prop:function(e,t){return ke(this,Ee.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[Ee.propFix[e]||e]})}}),Ee.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&Ee.isXMLDoc(e)||(t=Ee.propFix[t]||t,i=Ee.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=Ee.find.attr(e,"tabindex");return t?parseInt(t,10):vt.test(e.nodeName)||Tt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),pe.optSelected||(Ee.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),Ee.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){Ee.propFix[this.toLowerCase()]=this});var Ct=/[\t\r\n\f]/g;Ee.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(Ee.isFunction(e))return this.each(function(t){Ee(this).addClass(e.call(this,t,Q(this)))});if("string"==typeof e&&e)for(t=e.match(Ne)||[];n=this[u++];)if(i=Q(n),r=1===n.nodeType&&(" "+i+" ").replace(Ct," ")){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");s=Ee.trim(r),i!==s&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(Ee.isFunction(e))return this.each(function(t){Ee(this).removeClass(e.call(this,t,Q(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(Ne)||[];n=this[u++];)if(i=Q(n),r=1===n.nodeType&&(" "+i+" ").replace(Ct," ")){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");s=Ee.trim(r),i!==s&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):Ee.isFunction(e)?this.each(function(n){Ee(this).toggleClass(e.call(this,n,Q(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=Ee(this),o=e.match(Ne)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=Q(this),t&&xe.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||e===!1?"":xe.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+Q(n)+" ").replace(Ct," ").indexOf(t)>-1)return!0;return!1}});var St=/\r/g,It=/[\x20\t\r\n\f]+/g;Ee.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=Ee.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,Ee(this).val()):e,null==i?i="":"number"==typeof i?i+="":Ee.isArray(i)&&(i=Ee.map(i,function(e){return null==e?"":e+""})),t=Ee.valHooks[this.type]||Ee.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=Ee.valHooks[i.type]||Ee.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(St,""):null==n?"":n)}}}),Ee.extend({valHooks:{option:{get:function(e){var t=Ee.find.attr(e,"value");return null!=t?t:Ee.trim(Ee.text(e)).replace(It," ")}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type,a=o?null:[],s=o?i+1:r.length,u=i<0?s:o?i:0;u<s;u++)if(n=r[u],(n.selected||u===i)&&!n.disabled&&(!n.parentNode.disabled||!Ee.nodeName(n.parentNode,"optgroup"))){if(t=Ee(n).val(),o)return t;a.push(t)}return a},set:function(e,t){for(var n,r,i=e.options,o=Ee.makeArray(t),a=i.length;a--;)r=i[a],(r.selected=Ee.inArray(Ee.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),Ee.each(["radio","checkbox"],function(){Ee.valHooks[this]={set:function(e,t){if(Ee.isArray(t))return e.checked=Ee.inArray(Ee(e).val(),t)>-1}},pe.checkOn||(Ee.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var At=/^(?:focusinfocus|focusoutblur)$/;Ee.extend(Ee.event,{trigger:function(e,t,r,i){var o,a,s,u,l,f,d,c=[r||re],h=de.call(e,"type")?e.type:e,p=de.call(e,"namespace")?e.namespace.split("."):[];if(a=s=r=r||re,3!==r.nodeType&&8!==r.nodeType&&!At.test(h+Ee.event.triggered)&&(h.indexOf(".")>-1&&(p=h.split("."),h=p.shift(),p.sort()),l=h.indexOf(":")<0&&"on"+h,e=e[Ee.expando]?e:new Ee.Event(h,"object"==typeof e&&e),e.isTrigger=i?2:3,e.namespace=p.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:Ee.makeArray(t,[e]),d=Ee.event.special[h]||{},i||!d.trigger||d.trigger.apply(r,t)!==!1)){if(!i&&!d.noBubble&&!Ee.isWindow(r)){for(u=d.delegateType||h,At.test(u+h)||(a=a.parentNode);a;a=a.parentNode)c.push(a),s=a;s===(r.ownerDocument||re)&&c.push(s.defaultView||s.parentWindow||n)}for(o=0;(a=c[o++])&&!e.isPropagationStopped();)e.type=o>1?u:d.bindType||h,f=(xe.get(a,"events")||{})[e.type]&&xe.get(a,"handle"),f&&f.apply(a,t),f=l&&a[l],f&&f.apply&&Me(a)&&(e.result=f.apply(a,t),e.result===!1&&e.preventDefault());return e.type=h,i||e.isDefaultPrevented()||d._default&&d._default.apply(c.pop(),t)!==!1||!Me(r)||l&&Ee.isFunction(r[h])&&!Ee.isWindow(r)&&(s=r[l],s&&(r[l]=null),Ee.event.triggered=h,r[h](),Ee.event.triggered=void 0,s&&(r[l]=s)),e.result}},simulate:function(e,t,n){var r=Ee.extend(new Ee.Event,n,{type:e,isSimulated:!0});Ee.event.trigger(r,null,t)}}),Ee.fn.extend({trigger:function(e,t){return this.each(function(){Ee.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return Ee.event.trigger(e,t,n,!0)}}),Ee.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){Ee.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),Ee.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),pe.focusin="onfocusin"in n,pe.focusin||Ee.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){Ee.event.simulate(t,e.target,Ee.event.fix(e))};Ee.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=xe.access(r,t);i||r.addEventListener(e,n,!0),xe.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=xe.access(r,t)-1;i?xe.access(r,t,i):(r.removeEventListener(e,n,!0),xe.remove(r,t))}}});var bt=n.location,wt=Ee.now(),Dt=/\?/;Ee.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||Ee.error("Invalid XML: "+e),t};var Pt=/\[\]$/,Ot=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,Ut=/^(?:input|select|textarea|keygen)/i;Ee.param=function(e,t){var n,r=[],i=function(e,t){var n=Ee.isFunction(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Ee.isArray(e)||e.jquery&&!Ee.isPlainObject(e))Ee.each(e,function(){i(this.name,this.value)});else for(n in e)K(n,e[n],t,i);return r.join("&")},Ee.fn.extend({serialize:function(){return Ee.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=Ee.prop(this,"elements");return e?Ee.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!Ee(this).is(":disabled")&&Ut.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!We.test(e))}).map(function(e,t){var n=Ee(this).val();return null==n?null:Ee.isArray(n)?Ee.map(n,function(e){return{name:t.name,value:e.replace(Ot,"\r\n")}}):{name:t.name,value:n.replace(Ot,"\r\n")}}).get()}});var Lt=/%20/g,kt=/#.*$/,Mt=/([?&])_=[^&]*/,xt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Bt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ft=/^(?:GET|HEAD)$/,Ht=/^\/\//,jt={},Gt={},qt="*/".concat("*"),Vt=re.createElement("a");Vt.href=bt.href,Ee.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:bt.href,type:"GET",isLocal:Bt.test(bt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":qt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":Ee.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Z(Z(e,Ee.ajaxSettings),t):Z(Ee.ajaxSettings,e)},ajaxPrefilter:z(jt),ajaxTransport:z(Gt),ajax:function(e,t){function r(e,t,r,s){var l,c,h,m,v,T=t;f||(f=!0,u&&n.clearTimeout(u),i=void 0,a=s||"",C.readyState=e>0?4:0,l=e>=200&&e<300||304===e,r&&(m=X(p,C,r)),m=ee(p,m,C,l),l?(p.ifModified&&(v=C.getResponseHeader("Last-Modified"),v&&(Ee.lastModified[o]=v),v=C.getResponseHeader("etag"),v&&(Ee.etag[o]=v)),204===e||"HEAD"===p.type?T="nocontent":304===e?T="notmodified":(T=m.state,c=m.data,h=m.error,l=!h)):(h=T,!e&&T||(T="error",e<0&&(e=0))),C.status=e,C.statusText=(t||T)+"",l?g.resolveWith(_,[c,T,C]):g.rejectWith(_,[C,T,h]),C.statusCode(R),R=void 0,d&&E.trigger(l?"ajaxSuccess":"ajaxError",[C,p,l?c:h]),y.fireWith(_,[C,T]),d&&(E.trigger("ajaxComplete",[C,p]),--Ee.active||Ee.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,o,a,s,u,l,f,d,c,h,p=Ee.ajaxSetup({},t),_=p.context||p,E=p.context&&(_.nodeType||_.jquery)?Ee(_):Ee.event,g=Ee.Deferred(),y=Ee.Callbacks("once memory"),R=p.statusCode||{},m={},v={},T="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(f){if(!s)for(s={};t=xt.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return f?a:null},setRequestHeader:function(e,t){return null==f&&(e=v[e.toLowerCase()]=v[e.toLowerCase()]||e,m[e]=t),this},overrideMimeType:function(e){return null==f&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(f)C.always(e[C.status]);else for(t in e)R[t]=[R[t],e[t]];return this},abort:function(e){var t=e||T;return i&&i.abort(t),r(0,t),this}};if(g.promise(C),p.url=((e||p.url||bt.href)+"").replace(Ht,bt.protocol+"//"),p.type=t.method||t.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(Ne)||[""],null==p.crossDomain){l=re.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Vt.protocol+"//"+Vt.host!=l.protocol+"//"+l.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=Ee.param(p.data,p.traditional)),$(jt,p,t,C),f)return C;d=Ee.event&&p.global,d&&0===Ee.active++&&Ee.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ft.test(p.type),o=p.url.replace(kt,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Lt,"+")):(h=p.url.slice(o.length),p.data&&(o+=(Dt.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(o=o.replace(Mt,""),h=(Dt.test(o)?"&":"?")+"_="+wt++ +h),p.url=o+h),p.ifModified&&(Ee.lastModified[o]&&C.setRequestHeader("If-Modified-Since",Ee.lastModified[o]),Ee.etag[o]&&C.setRequestHeader("If-None-Match",Ee.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||t.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+qt+"; q=0.01":""):p.accepts["*"]);for(c in p.headers)C.setRequestHeader(c,p.headers[c]);if(p.beforeSend&&(p.beforeSend.call(_,C,p)===!1||f))return C.abort(); -if(T="abort",y.add(p.complete),C.done(p.success),C.fail(p.error),i=$(Gt,p,t,C)){if(C.readyState=1,d&&E.trigger("ajaxSend",[C,p]),f)return C;p.async&&p.timeout>0&&(u=n.setTimeout(function(){C.abort("timeout")},p.timeout));try{f=!1,i.send(m,r)}catch(e){if(f)throw e;r(-1,e)}}else r(-1,"No Transport");return C},getJSON:function(e,t,n){return Ee.get(e,t,n,"json")},getScript:function(e,t){return Ee.get(e,void 0,t,"script")}}),Ee.each(["get","post"],function(e,t){Ee[t]=function(e,n,r,i){return Ee.isFunction(n)&&(i=i||r,r=n,n=void 0),Ee.ajax(Ee.extend({url:e,type:t,dataType:i,data:n,success:r},Ee.isPlainObject(e)&&e))}}),Ee._evalUrl=function(e){return Ee.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},Ee.fn.extend({wrapAll:function(e){var t;return this[0]&&(Ee.isFunction(e)&&(e=e.call(this[0])),t=Ee(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return Ee.isFunction(e)?this.each(function(t){Ee(this).wrapInner(e.call(this,t))}):this.each(function(){var t=Ee(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=Ee.isFunction(e);return this.each(function(n){Ee(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){Ee(this).replaceWith(this.childNodes)}),this}}),Ee.expr.pseudos.hidden=function(e){return!Ee.expr.pseudos.visible(e)},Ee.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},Ee.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var Yt={0:200,1223:204},Jt=Ee.ajaxSettings.xhr();pe.cors=!!Jt&&"withCredentials"in Jt,pe.ajax=Jt=!!Jt,Ee.ajaxTransport(function(e){var t,r;if(pe.cors||Jt&&!e.crossDomain)return{send:function(i,o){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);t=function(e){return function(){t&&(t=r=s.onload=s.onerror=s.onabort=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Yt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),r=s.onerror=t("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout(function(){t&&r()})},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),Ee.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),Ee.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return Ee.globalEval(e),e}}}),Ee.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),Ee.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=Ee("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),re.head.appendChild(t[0])},abort:function(){n&&n()}}}});var Wt=[],Qt=/(=)\?(?=&|$)|\?\?/;Ee.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Wt.pop()||Ee.expando+"_"+wt++;return this[e]=!0,e}}),Ee.ajaxPrefilter("json jsonp",function(e,t,r){var i,o,a,s=e.jsonp!==!1&&(Qt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Qt.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=Ee.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Qt,"$1"+i):e.jsonp!==!1&&(e.url+=(Dt.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||Ee.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=n[i],n[i]=function(){a=arguments},r.always(function(){void 0===o?Ee(n).removeProp(i):n[i]=o,e[i]&&(e.jsonpCallback=t.jsonpCallback,Wt.push(i)),a&&Ee.isFunction(o)&&o(a[0]),a=o=void 0}),"script"}),pe.createHTMLDocument=function(){var e=re.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),Ee.parseHTML=function(e,t,n){if("string"!=typeof e)return[];"boolean"==typeof t&&(n=t,t=!1);var r,i,o;return t||(pe.createHTMLDocument?(t=re.implementation.createHTMLDocument(""),r=t.createElement("base"),r.href=re.location.href,t.head.appendChild(r)):t=re),i=Ie.exec(e),o=!n&&[],i?[t.createElement(i[1])]:(i=T([e],t,o),o&&o.length&&Ee(o).remove(),Ee.merge([],i.childNodes))},Ee.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=Ee.trim(e.slice(s)),e=e.slice(0,s)),Ee.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&Ee.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?Ee("<div>").append(Ee.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},Ee.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){Ee.fn[t]=function(e){return this.on(t,e)}}),Ee.expr.pseudos.animated=function(e){return Ee.grep(Ee.timers,function(t){return e===t.elem}).length},Ee.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,f=Ee.css(e,"position"),d=Ee(e),c={};"static"===f&&(e.style.position="relative"),s=d.offset(),o=Ee.css(e,"top"),u=Ee.css(e,"left"),l=("absolute"===f||"fixed"===f)&&(o+u).indexOf("auto")>-1,l?(r=d.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),Ee.isFunction(t)&&(t=t.call(e,n,Ee.extend({},s))),null!=t.top&&(c.top=t.top-s.top+a),null!=t.left&&(c.left=t.left-s.left+i),"using"in t?t.using.call(e,c):d.css(c)}},Ee.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){Ee.offset.setOffset(this,e,t)});var t,n,r,i,o=this[0];if(o)return o.getClientRects().length?(r=o.getBoundingClientRect(),r.width||r.height?(i=o.ownerDocument,n=te(i),t=i.documentElement,{top:r.top+n.pageYOffset-t.clientTop,left:r.left+n.pageXOffset-t.clientLeft}):r):{top:0,left:0}},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===Ee.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),Ee.nodeName(e[0],"html")||(r=e.offset()),r={top:r.top+Ee.css(e[0],"borderTopWidth",!0),left:r.left+Ee.css(e[0],"borderLeftWidth",!0)}),{top:t.top-r.top-Ee.css(n,"marginTop",!0),left:t.left-r.left-Ee.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===Ee.css(e,"position");)e=e.offsetParent;return e||Ze})}}),Ee.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;Ee.fn[e]=function(r){return ke(this,function(e,r,i){var o=te(e);return void 0===i?o?o[t]:e[r]:void(o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i)},e,r,arguments.length)}}),Ee.each(["top","left"],function(e,t){Ee.cssHooks[t]=k(pe.pixelPosition,function(e,n){if(n)return n=L(e,t),ut.test(n)?Ee(e).position()[t]+"px":n})}),Ee.each({Height:"height",Width:"width"},function(e,t){Ee.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){Ee.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(i===!0||o===!0?"margin":"border");return ke(this,function(t,n,i){var o;return Ee.isWindow(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?Ee.css(t,n,s):Ee.style(t,n,i,s)},t,a?i:void 0,a)}})}),Ee.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),Ee.parseJSON=JSON.parse,r=[],i=function(){return Ee}.apply(t,r),!(void 0!==i&&(e.exports=i));var Kt=n.jQuery,zt=n.$;return Ee.noConflict=function(e){return n.$===Ee&&(n.$=zt),e&&n.jQuery===Ee&&(n.jQuery=Kt),Ee},o||(n.jQuery=n.$=Ee),Ee})},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,a=[],s=-1,u=arguments.length;if(!u)return"";for(var l="";++s<u;){var f=Number(arguments[s]);if(!isFinite(f)||f<0||f>1114111||n(f)!=f)throw RangeError("Invalid code point: "+f);f<=65535?a.push(f):(f-=65536,r=(f>>10)+55296,i=f%1024+56320,a.push(r,i)),(s+1==u||a.length>o)&&(l+=t.apply(null,a),a.length=0)}return l};e?e(String,"fromCodePoint",{value:r,configurable:!0,writable:!0}):String.fromCodePoint=r}()},function(e,t){(function(){"use strict";function e(e){throw e}function t(e,t){var n=e.split("."),r=T;!(n[0]in r)&&r.execScript&&r.execScript("var "+n[0]);for(var i;n.length&&(i=n.shift());)n.length||t===m?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(C?Uint8Array:Array)?t:new(C?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(C?Uint16Array:Array)(2*e),this.length=0}function i(e){var t,n,r,i,o,a,s,u,l,f,d=e.length,c=0,h=Number.POSITIVE_INFINITY;for(u=0;u<d;++u)e[u]>c&&(c=e[u]),e[u]<h&&(h=e[u]);for(t=1<<c,n=new(C?Uint32Array:Array)(t),r=1,i=0,o=2;r<=c;){for(u=0;u<d;++u)if(e[u]===r){for(a=0,s=i,l=0;l<r;++l)a=a<<1|1&s,s>>=1;for(f=r<<16|u,l=a;l<t;l+=o)n[l]=f;++i}++r,i<<=1,o<<=1}return[n,c,h]}function o(e,t){this.h=O,this.w=0,this.input=C&&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=C&&t.outputBuffer instanceof Array?new Uint8Array(t.outputBuffer):t.outputBuffer),"number"==typeof t.outputIndex&&(this.b=t.outputIndex)),this.a||(this.a=new(C?Uint8Array:Array)(32768))}function a(e,t){this.length=e,this.H=t}function s(t,n){function r(t,n){var r,i=t.H,o=[],a=0;r=k[t.length],o[a++]=65535&r,o[a++]=r>>16&255,o[a++]=r>>24;var s;switch(v){case 1===i:s=[0,i-1,0];break;case 2===i:s=[1,i-2,0];break;case 3===i:s=[2,i-3,0];break;case 4===i:s=[3,i-4,0];break;case 6>=i:s=[4,i-5,1];break;case 8>=i:s=[5,i-7,1];break;case 12>=i:s=[6,i-9,2];break;case 16>=i:s=[7,i-13,2];break;case 24>=i:s=[8,i-17,3];break;case 32>=i:s=[9,i-25,3];break;case 48>=i:s=[10,i-33,4];break;case 64>=i:s=[11,i-49,4];break;case 96>=i:s=[12,i-65,5];break;case 128>=i:s=[13,i-97,5];break;case 192>=i:s=[14,i-129,6];break;case 256>=i:s=[15,i-193,6];break;case 384>=i:s=[16,i-257,7];break;case 512>=i:s=[17,i-385,7];break;case 768>=i:s=[18,i-513,8];break;case 1024>=i:s=[19,i-769,8];break;case 1536>=i:s=[20,i-1025,9];break;case 2048>=i:s=[21,i-1537,9];break;case 3072>=i:s=[22,i-2049,10];break;case 4096>=i:s=[23,i-3073,10];break;case 6144>=i:s=[24,i-4097,11];break;case 8192>=i:s=[25,i-6145,11];break;case 12288>=i:s=[26,i-8193,12];break;case 16384>=i:s=[27,i-12289,12];break;case 24576>=i:s=[28,i-16385,13];break;case 32768>=i:s=[29,i-24577,13];break;default:e("invalid distance")}r=s,o[a++]=r[0],o[a++]=r[1],o[a++]=r[2];var u,l;for(u=0,l=o.length;u<l;++u)_[E++]=o[u];y[o[0]]++,R[o[3]]++,g=t.length+n-1,c=null}var i,o,a,s,l,f,d,c,h,p={},_=C?new Uint16Array(2*n.length):[],E=0,g=0,y=new(C?Uint32Array:Array)(286),R=new(C?Uint32Array:Array)(30),T=t.w;if(!C){for(a=0;285>=a;)y[a++]=0;for(a=0;29>=a;)R[a++]=0}for(y[256]=1,i=0,o=n.length;i<o;++i){for(a=l=0,s=3;a<s&&i+a!==o;++a)l=l<<8|n[i+a];if(p[l]===m&&(p[l]=[]),f=p[l],!(0<g--)){for(;0<f.length&&32768<i-f[0];)f.shift();if(i+3>=o){for(c&&r(c,-1),a=0,s=o-i;a<s;++a)h=n[i+a],_[E++]=h,++y[h];break}0<f.length?(d=u(n,i,f),c?c.length<d.length?(h=n[i-1],_[E++]=h,++y[h],r(d,0)):r(c,-1):d.length<T?c=d:r(d,0)):c?r(c,-1):(h=n[i],_[E++]=h,++y[h])}f.push(i)}return _[E++]=256,y[256]++,t.M=y,t.L=R,C?_.subarray(0,E):_}function u(e,t,n){var r,i,o,s,u,l,f=0,d=e.length;s=0,l=n.length;e:for(;s<l;s++){if(r=n[l-s-1],o=3,3<f){for(u=f;3<u;u--)if(e[r+u-1]!==e[t+u-1])continue e;o=f}for(;258>o&&t+o<d&&e[r+o]===e[t+o];)++o;if(o>f&&(i=r,f=o),258===o)break}return new a(f,t-i)}function l(e,t){var n,i,o,a,s,u=e.length,l=new r(572),d=new(C?Uint8Array:Array)(u);if(!C)for(a=0;a<u;a++)d[a]=0;for(a=0;a<u;++a)0<e[a]&&l.push(a,e[a]);if(n=Array(l.length/2),i=new(C?Uint32Array:Array)(l.length/2),1===n.length)return d[l.pop().index]=1,d;for(a=0,s=l.length/2;a<s;++a)n[a]=l.pop(),i[a]=n[a].value;for(o=f(i,i.length,t),a=0,s=n.length;a<s;++a)d[n[a].index]=o[a];return d}function f(e,t,n){function r(e){var n=h[e][p[e]];n===t?(r(e+1),r(e+1)):--d[n],++p[e]}var i,o,a,s,u,l=new(C?Uint16Array:Array)(n),f=new(C?Uint8Array:Array)(n),d=new(C?Uint8Array:Array)(t),c=Array(n),h=Array(n),p=Array(n),_=(1<<n)-t,E=1<<n-1;for(l[n-1]=t,o=0;o<n;++o)_<E?f[o]=0:(f[o]=1,_-=E),_<<=1,l[n-2-o]=(l[n-1-o]/2|0)+t;for(l[0]=f[0],c[0]=Array(l[0]),h[0]=Array(l[0]),o=1;o<n;++o)l[o]>2*l[o-1]+f[o]&&(l[o]=2*l[o-1]+f[o]),c[o]=Array(l[o]),h[o]=Array(l[o]);for(i=0;i<t;++i)d[i]=n;for(a=0;a<l[n-1];++a)c[n-1][a]=e[a],h[n-1][a]=a;for(i=0;i<n;++i)p[i]=0;for(1===f[n-1]&&(--d[0],++p[n-1]),o=n-2;0<=o;--o){for(s=i=0,u=p[o+1],a=0;a<l[o];a++)s=c[o+1][u]+c[o+1][u+1],s>e[i]?(c[o][a]=s,h[o][a]=t,u+=2):(c[o][a]=e[i],h[o][a]=i,++i);p[o]=0,1===f[o]&&r(o)}return d}function d(e){var t,n,r,i,o=new(C?Uint16Array:Array)(e.length),a=[],s=[],u=0;for(t=0,n=e.length;t<n;t++)a[e[t]]=(0|a[e[t]])+1;for(t=1,n=16;t<=n;t++)s[t]=u,u+=0|a[t],u<<=1;for(t=0,n=e.length;t<n;t++)for(u=s[e[t]],s[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 c(t,n){switch(this.l=[],this.m=32768,this.e=this.g=this.c=this.q=0,this.input=C?new Uint8Array(t):t,this.s=!1,this.n=x,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 M:this.b=32768,this.a=new(C?Uint8Array:Array)(32768+this.m+258);break;case x:this.b=0,this.a=new(C?Uint8Array:Array)(this.m),this.f=this.K,this.t=this.I,this.o=this.J;break;default:e(Error("invalid inflate mode"))}}function h(t,n){for(var r,i=t.g,o=t.e,a=t.input,s=t.c,u=a.length;o<n;)s>=u&&e(Error("input buffer is broken")),i|=a[s++]<<o,o+=8;return r=i&(1<<n)-1,t.g=i>>>n,t.e=o-n,t.c=s,r}function p(e,t){for(var n,r,i=e.g,o=e.e,a=e.input,s=e.c,u=a.length,l=t[0],f=t[1];o<f&&!(s>=u);)i|=a[s++]<<o,o+=8;return n=l[i&(1<<f)-1],r=n>>>16,e.g=i>>r,e.e=o-r,e.c=s,65535&n}function _(e){function t(e,t,n){var r,i,o,a=this.z;for(o=0;o<e;)switch(r=p(this,t)){case 16:for(i=3+h(this,2);i--;)n[o++]=a;break;case 17:for(i=3+h(this,3);i--;)n[o++]=0;a=0;break;case 18:for(i=11+h(this,7);i--;)n[o++]=0;a=0;break;default:a=n[o++]=r}return this.z=a,n}var n,r,o,a,s=h(e,5)+257,u=h(e,5)+1,l=h(e,4)+4,f=new(C?Uint8Array:Array)(G.length);for(a=0;a<l;++a)f[G[a]]=h(e,3);if(!C)for(a=l,l=f.length;a<l;++a)f[G[a]]=0;n=i(f),r=new(C?Uint8Array:Array)(s),o=new(C?Uint8Array:Array)(u),e.z=0,e.o(i(t.call(e,s,n,r)),i(t.call(e,u,n,o)))}function E(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,a=0,s=e.length,u=0;0<s;){i=1024<s?1024:s,s-=i;do o+=e[u++],a+=o;while(--i);o%=65521,a%=65521}return(a<<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 c(t,{index:this.c,bufferSize:n.bufferSize,bufferType:n.bufferType,resize:n.resize})}function y(e,t){this.input=e,this.a=new(C?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 R(e,n){var r,i,o,a;if(Object.keys)r=Object.keys(n);else for(i in r=[],o=0,n)r[o++]=i;for(o=0,a=r.length;o<a;++o)i=r[o],t(e+"."+i,n[i])}var m=void 0,v=!0,T=this,C="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(C?Uint8Array:Array)(n<<1);if(C)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,a=this.i,s=i[o];if(n&&1<t&&(e=8<t?(D[255&e]<<24|D[e>>>8&255]<<16|D[e>>>16&255]<<8|D[e>>>24&255])>>32-t:D[e]>>8-t),8>t+a)s=s<<t|e,a+=t;else for(r=0;r<t;++r)s=s<<1|e>>t-r-1&1,8===++a&&(a=0,i[o++]=D[s],s=0,o===i.length&&(i=this.f()));i[o]=s,this.buffer=i,this.i=a,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]=D[t[n]],n++),C?e=t.subarray(0,n):(t.length=n,e=t),e};var S,I=new(C?Uint8Array:Array)(256);for(S=0;256>S;++S){for(var A=S,b=A,w=7,A=A>>>1;A;A>>>=1)b<<=1,b|=1&A,--w;I[S]=(b<<w&255)>>>0}var D=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 P,O=2,N={NONE:0,r:1,k:O,O:3},U=[];for(P=0;288>P;P++)switch(v){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,a=this.input;switch(this.h){case 0:for(i=0,o=a.length;i<o;){r=C?a.subarray(i,i+65535):a.slice(i,i+65535),i+=r.length;var u=r,f=i===o,c=m,h=m,p=m,_=m,E=m,g=this.a,y=this.b;if(C){for(g=new Uint8Array(this.a.buffer);g.length<=y+u.length+5;)g=new Uint8Array(g.length<<1);g.set(this.a)}if(c=f?1:0,g[y++]=0|c,h=u.length,p=~h+65536&65535,g[y++]=255&h,g[y++]=h>>>8&255,g[y++]=255&p,g[y++]=p>>>8&255,C)g.set(u,y),y+=u.length,g=g.subarray(0,y);else{for(_=0,E=u.length;_<E;++_)g[y++]=u[_];g.length=y}this.b=y,this.a=g}break;case 1:var R=new n(C?new Uint8Array(this.a.buffer):this.a,this.b);R.d(1,1,v),R.d(1,2,v);var T,S,I,A=s(this,a);for(T=0,S=A.length;T<S;T++)if(I=A[T],n.prototype.d.apply(R,U[I]),256<I)R.d(A[++T],A[++T],v),R.d(A[++T],5),R.d(A[++T],A[++T],v);else if(256===I)break;this.a=R.finish(),this.b=this.a.length;break;case O:var b,w,D,P,N,L,k,M,x,B,F,H,j,G,q,V=new n(C?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(b=O,V.d(1,1,v),V.d(b,2,v),w=s(this,a),L=l(this.M,15),k=d(L),M=l(this.L,7),x=d(M),D=286;257<D&&0===L[D-1];D--);for(P=30;1<P&&0===M[P-1];P--);var W,Q,K,z,$,Z,X=D,ee=P,te=new(C?Uint32Array:Array)(X+ee),ne=new(C?Uint32Array:Array)(316),re=new(C?Uint8Array:Array)(19);for(W=Q=0;W<X;W++)te[Q++]=L[W];for(W=0;W<ee;W++)te[Q++]=M[W];if(!C)for(W=0,z=re.length;W<z;++W)re[W]=0;for(W=$=0,z=te.length;W<z;W+=Q){for(Q=1;W+Q<z&&te[W+Q]===te[W];++Q);if(K=Q,0===te[W])if(3>K)for(;0<K--;)ne[$++]=0,re[0]++;else for(;0<K;)Z=138>K?K:138,Z>K-3&&Z<K&&(Z=K-3),10>=Z?(ne[$++]=17,ne[$++]=Z-3,re[17]++):(ne[$++]=18,ne[$++]=Z-11,re[18]++),K-=Z;else if(ne[$++]=te[W],re[te[W]]++,K--,3>K)for(;0<K--;)ne[$++]=te[W],re[te[W]]++;else for(;0<K;)Z=6>K?K:6,Z>K-3&&Z<K&&(Z=K-3),ne[$++]=16,ne[$++]=Z-3,re[16]++,K-=Z}for(t=C?ne.subarray(0,$):ne.slice(0,$),B=l(re,7),G=0;19>G;G++)J[G]=B[Y[G]];for(N=19;4<N&&0===J[N-1];N--);for(F=d(B),V.d(D-257,5,v),V.d(P-1,5,v),V.d(N-4,4,v),G=0;G<N;G++)V.d(J[G],3,v);for(G=0,q=t.length;G<q;G++)if(H=t[G],V.d(F[H],B[H],v),16<=H){switch(G++,H){case 16:j=2;break;case 17:j=3;break;case 18:j=7;break;default:e("invalid code: "+H)}V.d(t[G],j,v)}var ie,oe,ae,se,ue,le,fe,de,ce=[k,L],he=[x,M];for(ue=ce[0],le=ce[1],fe=he[0],de=he[1],ie=0,oe=w.length;ie<oe;++ie)if(ae=w[ie],V.d(ue[ae],le[ae],v),256<ae)V.d(w[++ie],w[++ie],v),se=w[++ie],V.d(fe[se],de[se],v),V.d(w[++ie],w[++ie],v);else if(256===ae)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(v){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=C?new Uint32Array(L):L,M=0,x=1,B={F:M,D:x};c.prototype.p=function(){for(;!this.s;){var t=h(this,3);switch(1&t&&(this.s=v),t>>>=1){case 0:var n=this.input,r=this.c,i=this.a,o=this.b,a=n.length,s=m,u=m,l=i.length,f=m;switch(this.e=this.g=0,r+1>=a&&e(Error("invalid uncompressed block header: LEN")),s=n[r++]|n[r++]<<8,r+1>=a&&e(Error("invalid uncompressed block header: NLEN")),u=n[r++]|n[r++]<<8,s===~u&&e(Error("invalid uncompressed block header: length verify")),r+s>n.length&&e(Error("input buffer is broken")),this.n){case M:for(;o+s>i.length;){if(f=l-o,s-=f,C)i.set(n.subarray(r,r+f),o),o+=f,r+=f;else for(;f--;)i[o++]=n[r++];this.b=o,i=this.f(),o=this.b}break;case x:for(;o+s>i.length;)i=this.f({v:2});break;default:e(Error("invalid inflate mode"))}if(C)i.set(n.subarray(r,r+s),o),o+=s,r+=s;else for(;s--;)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,j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],G=C?new Uint16Array(j):j,q=[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=C?new Uint16Array(q):q,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=C?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=C?new Uint16Array(W):W,K=[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],z=C?new Uint8Array(K):K,$=new(C?Uint8Array:Array)(288);for(F=0,H=$.length;F<H;++F)$[F]=143>=F?8:255>=F?9:279>=F?7:8;var Z,X,ee=i($),te=new(C?Uint8Array:Array)(30);for(Z=0,X=te.length;Z<X;++Z)te[Z]=5;var ne=i(te);c.prototype.o=function(e,t){var n=this.a,r=this.b;this.u=e;for(var i,o,a,s,u=n.length-258;256!==(i=p(this,e));)if(256>i)r>=u&&(this.b=r,n=this.f(),r=this.b),n[r++]=i;else for(o=i-257,s=V[o],0<J[o]&&(s+=h(this,J[o])),i=p(this,t),a=Q[i],0<z[i]&&(a+=h(this,z[i])),r>=u&&(this.b=r,n=this.f(),r=this.b);s--;)n[r]=n[r++-a];for(;8<=this.e;)this.e-=8,this.c--;this.b=r},c.prototype.J=function(e,t){var n=this.a,r=this.b;this.u=e;for(var i,o,a,s,u=n.length;256!==(i=p(this,e));)if(256>i)r>=u&&(n=this.f(),u=n.length),n[r++]=i;else for(o=i-257,s=V[o],0<J[o]&&(s+=h(this,J[o])),i=p(this,t),a=Q[i],0<z[i]&&(a+=h(this,z[i])),r+s>u&&(n=this.f(),u=n.length);s--;)n[r]=n[r++-a];for(;8<=this.e;)this.e-=8,this.c--;this.b=r},c.prototype.f=function(){var e,t,n=new(C?Uint8Array:Array)(this.b-32768),r=this.b-32768,i=this.a;if(C)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,C)i.set(i.subarray(r,r+32768));else for(e=0;32768>e;++e)i[e]=i[r+e];return this.b=32768,i},c.prototype.K=function(e){var t,n,r,i,o=this.input.length/this.c+1|0,a=this.input,s=this.a;return e&&("number"==typeof e.v&&(o=e.v),"number"==typeof e.G&&(o+=e.G)),2>o?(n=(a.length-this.c)/this.u[2],i=258*(n/2)|0,r=i<s.length?s.length+i:s.length<<1):r=s.length*o,C?(t=new Uint8Array(r),t.set(s)):t=s,this.a=t},c.prototype.t=function(){var e,t,n,r,i,o=0,a=this.a,s=this.l,u=new(C?Uint8Array:Array)(this.q+(this.b-32768));if(0===s.length)return C?this.a.subarray(32768,this.b):this.a.slice(32768,this.b);for(t=0,n=s.length;t<n;++t)for(e=s[t],r=0,i=e.length;r<i;++r)u[o++]=e[r];for(t=32768,n=this.b;t<n;++t)u[o++]=a[t];return this.l=[],this.buffer=u},c.prototype.I=function(){var e,t=this.b;return C?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!==E(t)&&e(Error("invalid adler-32 checksum"))),t};var re=8,ie=N;y.prototype.j=function(){var t,n,r,i,o,a,s,u=0;switch(s=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,s[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,s[u++]=i|31-(256*r+i)%31,a=E(this.input),this.A.b=u,s=this.A.j(),u=s.length,C&&(s=new Uint8Array(s.buffer),s.length<=u+4&&(this.a=new Uint8Array(s.length+4),this.a.set(s),s=this.a),s=s.subarray(0,u+4)),s[u++]=a>>24&255,s[u++]=a>>16&255,s[u++]=a>>8&255,s[u++]=255&a,s},t("Zlib.Inflate",g),t("Zlib.Inflate.prototype.decompress",g.prototype.p),R("Zlib.Inflate.BufferType",{ADAPTIVE:B.D,BLOCK:B.F}),t("Zlib.Deflate",y),t("Zlib.Deflate.compress",function(e,t){return new y(e,t).j()}),t("Zlib.Deflate.prototype.compress",y.prototype.j),R("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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var 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(7),l=r(u),f=n(36),d=r(f),c=n(34),h=r(c),p=n(18),_=r(p),E=n(17),g=r(E),y=n(22),R=r(y),m=n(3),v=r(m),T=n(1),C=r(T),S=n(20),I=r(S),A=n(38),b=r(A),w=n(40),D=r(w),P=n(37),O=r(P),N=n(39),U=r(N),L=n(41),k=r(L),M=n(4),x=r(M),B=n(5),F=r(B),H=n(2),j=r(H),G=n(13),q=(r(G),n(10)),V=(r(q),n(42)),Y=r(V),J=n(14);r(J);n(47).polyfill(),n(52),n(49),n(30);var W=C.default.getLoger("McuClient"),Q={version:"v1.16.1.201705010",author:"www.3mang.com"},K=void 0,z=void 0,$=void 0,Z=void 0,X=void 0,ee=void 0,te=void 0,ne=void 0,re=void 0,ie=void 0,oe=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.sdkInfo=Q,W.log(e.sdkInfo),e.isGetUserIpCallback=!1,e.isGetFastestMcuCallback=!1,e.isGetFastestMsCallback=!1,F.default.setCurrentStatus(F.default.statusCode_0),e.on(v.default.MCU_ERROR,e._mcuErrorHandler.bind(e)),K=d.default,K.on("*",function(t,n){return e._emit(t,n)}),K.on(K.SUCCESS,e._sassJoinSuccessHandler.bind(e)),K.on(K.CLASS_INIT_SUCCESS,e._sassInitSuccessHandler.bind(e)),K.on(K.CLASS_GET_CLASS_PARAM,e._sassGetClassParamSuccessHandler.bind(e)),K.on(K.CLASS_SAVE_STATUS_INFO_SUCCESS,e._sassSaveClassStatusInfoSuccessHandler.bind(e)),K.on(K.CLASS_SAVE_RECORD_INFO_SUCCESS,e._sassSaveClassRecordInfoSuccessHandler.bind(e)),K.on(K.DELETE_DOCUMENT_SUCCESS,e._sassDeleteDocumentSuccess.bind(e)),z=new h.default,$=R.default,$.on("*",function(t,n){return e._emit(t,n)}),$.on(v.default.CLASS_JOIN_MCU_SUCCESS,e._mcuJoinMCUClassSuccessHandler.bind(e)),$.on(v.default.SWITCH_MCU_IP,e._switchMcuIpHandler.bind(e)),ie=_.default,ie.on("*",function(t,n){return e._emit(t,n)}),ie.on(_.default.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS,e._joinRecordPlaybackSuccessHandler.bind(e)),ie.on(_.default.RECORD_PLAYBACK_CLEAR_DATA,e._recordPlaybackClearDataHandler.bind(e)),Z=new I.default,Z.on("*",function(t,n){return e._emit(t,n)}),Z.on(v.default.CLASS_RUN_EXIT,e._runClassExit.bind(e)),Z.on(v.default.CLASS_STATUS_INFO_CHANGE,e._onClassStatusInfoChange.bind(e)),Z.on(v.default.CLASS_DELETE_ROSTER,e._onClassDeleteRoster.bind(e)),Z.on(v.default.CLASS_NONENTITY_ROSTER,e._onClassNonentityRoster.bind(e)),Z.on(v.default.CLASS_RECORD_START,e._onClassRecordStart.bind(e)),Z.on(v.default.CLASS_RECORD_SUCCESS,e._onClassRecordSuccess.bind(e)),Z.on(v.default.SWITCH_MS_IP,e._switchMsIpHandler.bind(e)),X=new b.default,X.on("*",function(t,n){return e._emit(t,n)}),ee=new D.default,ee.on("*",function(t,n){return e._emit(t,n)}),ee.on(v.default.VIDEO_UPDATE,e.videoUpdate.bind(e)),ee.on(v.default.USER_DEVICE_STATUS_CHAANGE,e.userDeviecStatusChange.bind(e)),te=new O.default,te.on("*",function(t,n){return e._emit(t,n)}),te.on(v.default.AUDIO_UPDATE,e.audioUpdate.bind(e)),te.on(v.default.USER_DEVICE_STATUS_CHAANGE,e.userDeviecStatusChange.bind(e)),re=new k.default,re.on("*",function(t,n){return e._emit(t,n)}),ne=new U.default,ne.on("*",function(t,n){return e._emit(t,n)}),ne.on(v.default.DOC_UPDATE,e.docUpdateHandler.bind(e)),ne.on(v.default.DOC_DELETE,e.docDeleteHandler.bind(e)),ne.on(U.default.DOC_JOIN_CHANNEL_SUCCESS,e.docJoinChannelSuccess.bind(e)),e.init=e._init.bind(e),e.joinClass=e._joinClass.bind(e),e.leaveClass=e._leaveClass.bind(e),e.getMcuClientStatus=e._getMcuClientStatus.bind(e),e.getClassStatusInfo=e._getClassStatusInfo.bind(e),e.sendStartClass=e._sendStartClass.bind(e),e.sendPauseClass=e._sendPauseClass.bind(e),e.sendCloseClass=e._sendCloseClass.bind(e),e.changeHandUpStatus=e._changeHandUpStatus.bind(e),e.initRecordPlayback=e._initRecordPlayback.bind(e),e.startRecordPlayback=e._startRecordPlayback.bind(e),e.stopRecordPlayback=e._stopRecordPlayback.bind(e),e.pauseRecordPlayback=e._pauseRecordPlayback.bind(e),e.seekRecordPlayback=e._seekRecordPlayback.bind(e),e.sendChatMsg=e._sendChatMsg.bind(e),e.getVideoPublishPath=e._getVideoPublishPath.bind(e),e.getVideoAllChannelInfo=e._getVideoAllChannelInfo.bind(e),e.publishVideo=e._publishVideo.bind(e),e.stopPublishVideo=e.unPublishVideo=e._stopPublishVideo.bind(e),e.sendVideoBroadcastMsg=e._sendVideoBroadcastMsg.bind(e),e.getAudioPublishPath=e._getPublishAudioPath.bind(e),e.getAudioAllChannelInfo=e._getAudioAllChannelInfo.bind(e),e.publishAudio=e._publishAudio.bind(e),e.stopPublishAudio=e.unPublishAudio=e._stopPublishAudio.bind(e),e.sendAudioBroadcastMsg=e.sendAudioCommandMsg.bind(e),e.sendInsertAnnotaion=e._sendInsertAnnotaion.bind(e),e.sendDeleteAllAnnotation=e._sendDeleteAllAnnotation.bind(e),e.sendDeleteCurPageAnnotation=e._sendDeleteCurPageAnnotation.bind(e),e.sendGotoPrev=e._sendGotoPrev.bind(e), -e.sendDocumentUpload=e._sendDocumentUpload.bind(e),e.sendDocumentSwitchDoc=e._sendDocumentSwitchDoc.bind(e),e.sendDocumentSwitchPage=e._sendDocumentSwitchPage.bind(e),e.sendDocumentSwitchAnimation=e._sendDocumentSwitchAnimation.bind(e),e.sendDocumentDelete=e._sassDeleteDocument.bind(e),e.sendDocBroadcastMsg=e._sendDocBroadcastMsg.bind(e),e.sendDocumentCommand=e._sendDocumentCommand.bind(e),e.getDocImageFullPath=e._getDocImageFullPath.bind(e),e.getDocPDFFullPath=e._getDocPDFFullPath.bind(e),e.getDocFullAddress=e._getDocFullAddress.bind(e),e.setDeviceInfo=e._setDeviceInfo.bind(e),e.setMessageDelay=e._setMessageDelay.bind(e),e.switchServer=e._switchMcuIpHandler.bind(e),e.switchMediaServer=e._switchMsIpHandler.bind(e),e}return a(t,e),s(t,[{key:"_setDeviceInfo",value:function(e){W.log("设置设备信息-->",e),e&&(F.default.cameras=e.cameras||[],F.default.microphones=e.microphones||[],F.default.videoQuality=e.videoQuality||0,F.default.curVideoQuality=e.curVideoQuality||0,F.default.micGain=e.micGain||50,F.default.speakerVolume=e.speakerVolume||50,F.default.micCode=e.micCode||0,F.default.curCamera=e.curCamera||"",F.default.curMicrophone=e.curMicrophone||"",!F.default.curCamera&&F.default.cameras.length>0&&(F.default.curCamera=F.default.cameras[0]),!F.default.curMicrophone&&F.default.microphones.length>0&&(F.default.curMicrophone=F.default.microphones[0]))}},{key:"_setMessageDelay",value:function(e){W.warn("延迟消息-->",e),e&&(F.default.messageDelay=Boolean(e.messageDelay))}},{key:"_mcuErrorHandler",value:function(e,t){var n=t||"",r={code:e,reson:v.default.ErrorReson[e]+" "+n};this._emit(v.default.ERROR_EVENT,r),W.error("MCU_ERROR",r)}},{key:"_getMcuClientStatus",value:function(){return F.default.getCurrentStatus()}},{key:"_getClassDetail",value:function(){return F.default.getClassDetail()}},{key:"_getClassStatusInfo",value:function(){return F.default.classStatusInfo}},{key:"_runClassExit",value:function(e){this._leaveClass(e)}},{key:"_onClassStatusInfoChange",value:function(e){return F.default.getCurrentStatus().code!=F.default.statusCode_2.code?void W.warn("不能保存课堂状态",F.default.getCurrentStatus()):void this._sassSaveClassStatusInfo(e)}},{key:"_onClassRecordStart",value:function(e){return F.default.getCurrentStatus().code!=F.default.statusCode_2.code?void W.warn("不能保存课堂状态",F.default.getCurrentStatus()):void(K&&K.saveClassRecordContrlInfo(e))}},{key:"_onClassRecordSuccess",value:function(e){ne&&ne.updaterRecordStatus(),re&&re.updaterRecordStatus()}},{key:"_onClassDeleteRoster",value:function(e){}},{key:"_onClassNonentityRoster",value:function(e){if(F.default.isRecordPlayBack)return void W.warn("录制回放中,不处理");if(null==e||null==e.nodeId)return void W.warn("onClassNonentityRoster.参数错误");var t={nodeId:e.nodeId};ee&&ee.stopPublishVideo(t),te&&te.stopPublishAudio(t)}},{key:"_init",value:function(e){return null==e||x.default.isEmptyObject(e)?(W.error("初始化课堂失败->参数错误",e),void this._emit(v.default.MCU_ERROR,v.default.ERR_CLASS_INIT_PARAM)):null==e.classId||isNaN(e.classId)||null==e.portal||""==e.portal?(W.error("初始化课堂失败->参数错误",e),void this._emit(v.default.MCU_ERROR,v.default.ERR_CLASS_INIT_PARAM)):(W.log("初始化课堂->",e),F.default.isRecordPlayBack=!1,F.default.classId=parseInt(e.classId),F.default.portal=e.portal,F.default.userId=e.userId||"0",F.default.userName=e.userName||"",F.default.userRole=e.userRole||j.default.normal,F.default.userRole!=j.default.host&&F.default.userRole!=j.default.presenter&&F.default.userRole!=j.default.assistant&&F.default.userRole!=j.default.record&&F.default.userRole!=j.default.invisible&&(F.default.userRole=j.default.normal),F.default.messageDelay=e.messageDelay||!1,e.allowRecordMaxTime&&(F.default.allowRecordMaxTime=parseInt(e.allowRecordMaxTime)),void(K&&K.getJoinParams(F.default.getClassInfo())))}},{key:"_joinClass",value:function(e){if(null==e||x.default.isEmptyObject(e))return this._emit(v.default.MCU_ERROR,v.default.ERR_CLASS_JOIN_PARAM),void W.log("加入课堂失败->参数错误.",e);if(null==e.userName||""==e.userName)return W.log("加入课堂失败->参数错误->名字不能为空"),void this._emit(v.default.MCU_ERROR,v.default.ERR_CLASS_JOIN_PARAM);F.default.userName=e.userName||F.default.userName,F.default.autoLogin=e.autoLogin||"",F.default.password=e.password||"",F.default.hasCamera="boolean"==typeof e.hasCamera&&e.hasCamera,F.default.hasMicrophone="boolean"==typeof e.hasMicrophone&&e.hasMicrophone;var t=(0,g.default)(""+F.default.classId+F.default.userId+F.default.userRole);F.default.autoLogin&&t==F.default.autoLogin?(W.log("自动登录"),this._sassJoinSuccessHandler()):K&&K.passwordAndMd5Checking(F.default.getClassInfo())}},{key:"_sassInitSuccessHandler",value:function(e){F.default.md5=e.md5||"",F.default.msType=e.msType||1,F.default.siteId=e.siteId||"",F.default.classType=e.meetingType||0,F.default.passwordRequired=e.passwordRequired||!1,W.log("初始化课堂验证完成."),F.default.setCurrentStatus(F.default.statusCode_1);var t={};t.siteId=F.default.siteId,t.classId=F.default.classId,t.userRole=F.default.userRole,t.userId=F.default.userId,t.userName=F.default.userName,t.classType=F.default.classType,F.default.userRole==j.default.host?t.passwordRequired=!0:t.passwordRequired=F.default.passwordRequired,this._emit(v.default.CLASS_INIT_SUCCESS,t)}},{key:"_sassJoinSuccessHandler",value:function(e){K&&K.getClassParam()}},{key:"_sassGetClassParamSuccessHandler",value:function(e){if(W.log("获取课堂课堂信息完成."),e){if(F.default.mcuDelay=e.h5Delay||0,F.default.className=e.meetingName||"",F.default.classBeginTime=e.beginTime||"",F.default.classEndTime=e.endTime||"",F.default.userIp=e.userIp||"",F.default.maxVideoChannels=e.maxVideoChannels,F.default.maxAudioChannels=e.maxAudioChannels,F.default.maxMediaChannels=Math.max(F.default.maxVideoChannels,F.default.maxAudioChannels),F.default.fps=e.fps||15,F.default.gop=e.gop||3,F.default.videoQuality=e.videoQuality||2,F.default.isAutoStartClass=e.autoRecord||0,F.default.setDocListPrepare(e.docListPrepare),F.default.setRecordList(e.recordList),F.default.setDocList(e.docList),F.default.setMsList(e.msList),F.default.setRsList(e.rsList),F.default.setMcuList(e.mcuList),F.default.setMusicList(e.musicList),F.default.setMusicListPrepare(e.musicListPrepare),e.mcuList&&e.mcuList.length>0){var t=parseInt(Math.random()*e.mcuList.length);F.default.MCUServerIP=e.mcuList[t].ip||"",F.default.MCUServerPort=e.mcuList[t].port||"",W.log("初始->MCU->.",F.default.MCUServerIP,F.default.MCUServerPort)}if(e.rsList&&e.rsList.length>0){var n=parseInt(Math.random()*e.rsList.length);F.default.RS_RECORD_PLAY_IP=e.rsList[n].ip||"",F.default.RS_RECORD_PLAY_PORT=e.rsList[n].port||"",W.log("初始->RS->.",F.default.RS_RECORD_PLAY_IP,F.default.RS_RECORD_PLAY_PORT)}if(F.default.msList&&F.default.msList.length>0){var r=parseInt(Math.random()*F.default.msList.length);F.default.MS_PUBLISH_IP=F.default.msList[r].ip||"",F.default.MS_PUBLISH_PORT=F.default.msList[r].port||""}if(W.log("初始->MS->.",F.default.MS_PUBLISH_IP,F.default.MS_PUBLISH_PORT),F.default.pullRtmpList&&F.default.pullRtmpList.length>0){var i=parseInt(Math.random()*F.default.pullRtmpList.length);F.default.MS_PLAY_RTMP_IP=F.default.pullRtmpList[i].ip||"",F.default.MS_PLAY_RTMP_PORT=F.default.pullRtmpList[i].port||""}else F.default.MS_PLAY_RTMP_IP=F.default.MS_PUBLISH_IP,F.default.MS_PLAY_RTMP_PORT=F.default.MS_PUBLISH_PORT;if(W.log("初始->MSPull->.",F.default.MS_PLAY_RTMP_IP,F.default.MS_PLAY_RTMP_PORT),F.default.hlsList&&F.default.hlsList.length>0){var o=parseInt(Math.random()*F.default.hlsList.length);F.default.MS_PLAY_HLS_IP=F.default.hlsList[o].ip||"",F.default.MS_PLAY_HLS_PORT=F.default.hlsList[o].port||""}else F.default.MS_PLAY_HLS_IP=F.default.RS_RECORD_PLAY_IP,F.default.MS_PLAY_HLS_PORT=F.default.RS_RECORD_PLAY_PORT;if(W.log("初始->MSHls->.",F.default.MS_PLAY_HLS_IP,F.default.MS_PLAY_HLS_PORT),e.docList&&e.docList.length>0){var a=parseInt(Math.random()*e.docList.length);W.log("docServer->",e.docList[a]),F.default.DOCServerIP=e.docList[a].ip||"",F.default.DOCServerPort=e.docList[a].port||"",W.log("初始->DOC->.",F.default.DOCServerIP,F.default.DOCServerPort)}if(e.recordList&&e.recordList.length>0){var s=parseInt(Math.random()*e.recordList.length);F.default.RecordServerIP=e.recordList[s].ip||"",F.default.RecordServerPort=e.recordList[s].port||"",W.log("初始->RECORD->.",F.default.RecordServerIP,F.default.RecordServerPort)}}if(this._emit(v.default.CLASS_GET_INFO_SUCCESS,F.default.getClassInfo()),e.currentInfo){W.log("本地同步最后一次保存过的课堂状态信息");try{F.default.setClassStatusInfo(JSON.parse(e.currentInfo))}catch(t){F.default.setClassStatusInfo(e.currentInfo)}W.log(F.default.classStatusInfo)}else W.log("还没有保存过课堂状信息");F.default.isRecordPlayBack?ie?(W.log("开启录制回放流程"),ie.readyRecordPlay()):W.warn("开启录制回放流程失败->还未创建模块"):this.getUserIpInfo()}},{key:"getUserIpInfo",value:function(){z&&z.getUserIpInfo("",F.default.userIp,this._getUserIpCallbackHandler.bind(this),1e3)}},{key:"_getUserIpCallbackHandler",value:function(e){if(!this.isGetUserIpCallback){this.isGetUserIpCallback=!0,e&&"ok"==e.ret&&(F.default.country=e.country,F.default.city=e.city,F.default.province=e.province,F.default.isp=e.isp),this._mergeMcuAndMsList();var t=this;F.default.siteId_letv==F.default.siteId?(W.log("MS不需要选点->siteId->",F.default.siteId),t.isGetFastestMcuCallback=!0,t._startConnectMCU()):this._getFastestMsServer(function(e){W.log("MS选点结束->",e),e&&e.ip&&(F.default.MS_PUBLISH_IP=e.ip||"",F.default.MS_PUBLISH_PORT=e.port||""),W.log("当前使用的MS->",F.default.MS_PUBLISH_IP,F.default.MS_PUBLISH_PORT),t.isGetFastestMcuCallback=!0,t._startConnectMCU()}),this._getFastestMcuServer(function(e){W.log("MCU选点结束->",e),e&&e.ip&&(F.default.MCUServerIP=e.ip||"",F.default.MCUServerPort=e.port||""),W.log("当前使用的MCU->",F.default.MCUServerIP,F.default.MCUServerPort),t.isGetFastestMsCallback=!0,t._startConnectMCU()})}}},{key:"_startConnectMCU",value:function(){this.isGetFastestMcuCallback&&this.isGetFastestMsCallback&&this._joinMCU()}},{key:"_mergeMcuAndMsList",value:function(){z&&(F.default.mcuListFromServer=z.getServerMcuList(F.default.country,F.default.province,F.default.city,F.default.isp,Y.default.serverList),F.default.msListFromServer=z.getServerMsList(F.default.country,F.default.province,F.default.city,F.default.isp,Y.default.serverList)),F.default.mcuListAll.length=0,F.default.mcuListAll=F.default.mcuListAll.concat(F.default.mcuList,F.default.mcuListFromServer),F.default.msListAll.length=0,F.default.msListAll=F.default.msListAll.concat(F.default.msList,F.default.msListFromServer)}},{key:"_getFastestMcuServer",value:function(e){z?z.getFastestMcuServer(F.default.mcuListAll,e):e&&e({ip:""})}},{key:"_getFastestMsServer",value:function(e){z?z.getFastestMsServer(F.default.msListAll,e):e&&e({ip:""})}},{key:"_sassSaveClassStatusInfo",value:function(e){var t=!1;e&&1==e.isForce&&(t=!0),F.default.isHost||t?F.default.getCurrentStatus().code==F.default.statusCode_2.code?K.saveClassStatusInfo({classStatusInfo:F.default.classStatusInfo}):W.error("不能保存课堂数据",F.default.getCurrentStatus()):W.log("没有保存课堂状态信息的权限->身份",F.default.userRole)}},{key:"_sassSaveClassStatusInfoSuccessHandler",value:function(e){W.log("保存课堂状态信息成功."),W.log(e)}},{key:"_sassSaveClassRecordInfoSuccessHandler",value:function(e){W.log("保存课堂录制信息成功."),W.log(e)}},{key:"_joinMCU",value:function(){W.log("加入课堂->."),$&&$.joinMCU(F.default.getClassInfo())}},{key:"_switchMcuIp",value:function(){W.log("切换MCU IP->."),$&&$.switchMCUIp(F.default.getClassInfo())}},{key:"_mcuJoinMCUClassSuccessHandler",value:function(e){F.default.setCurrentStatus(F.default.statusCode_2);var t={};t.isRecordPlayBack=F.default.isRecordPlayBack,t.DOCServerIP=F.default.DOCServerIP,t.DOCServerPort=F.default.DOCServerPort,t.classStatus=F.default.classStatus,t.classId=F.default.classId,t.className=F.default.className,t.h5Module=F.default.h5Module,t.isHost=F.default.isHost,t.maxAudioChannels=F.default.maxAudioChannels,t.maxVideoChannels=F.default.maxVideoChannels,t.maxMediaChannels=F.default.maxMediaChannels,t.mcuDelay=F.default.mcuDelay,t.msType=F.default.msType,t.nodeId=F.default.nodeId,t.password=F.default.password,t.passwordRequired=F.default.passwordRequired,t.role=F.default.role,t.siteId=F.default.siteId,t.topNodeID=F.default.topNodeID,t.userId=F.default.userId,t.userName=F.default.userName,t.userRole=F.default.userRole,t.userType=F.default.userType,t.siteId=F.default.siteId,t.classId=F.default.classId,t.userRole=F.default.userRole,t.userId=F.default.userId,t.passwordRequired=F.default.passwordRequired,t.classType=F.default.classType||j.default.CLASS_TYPE_INTERACT,t.country=F.default.country,t.city=F.default.city,t.province=F.default.province,t.isp=F.default.isp,t.classTimestamp=F.default.classTimestamp,t.recordTimestamp=F.default.recordTimestamp,t.recordPlaybackMaxTime=F.default.recordPlaybackMaxTime,t.fps=F.default.fps,t.gop=F.default.gop,t.videoQuality=F.default.videoQuality,W.log("加入课堂成功->"),W.log(t),this._emit(v.default.CLASS_JOIN_SUCCESS,t)}},{key:"_switchMcuIpHandler",value:function(e){if(F.default.isRecordPlayBack)return void W.log("录制回放->不进行MCU动态选点");W.log("MCU->动态选点");var t=this;this._getFastestMcuServer(function(n){W.log("MCU选点结束->",n);var r=F.default.MCUServerIP;if(n&&n.ip)F.default.MCUServerIP=n.ip||"",F.default.MCUServerPort=n.port||"";else if(F.default.mcuList&&F.default.mcuList.length>0){var i=parseInt(Math.random()*F.default.mcuList.length);F.default.MCUServerIP=F.default.mcuList[i].ip||"",F.default.MCUServerPort=F.default.mcuList[i].port||""}r&&r!=F.default.MCUServerIP?(W.log("MCU->最新地址->",F.default.MCUServerIP,F.default.MCUServerPort),e&&1==e.reConnect?(W.log("MCU->切换到最新的IP->",F.default.MCUServerIP,F.default.MCUServerPort),t._startConnectMCU()):t._switchMcuIp()):W.log("MCU不需要切换->之前的IP->",r,"新的IP->",F.default.MCUServerIP)})}},{key:"_switchMsIpHandler",value:function(e){if(F.default.isRecordPlayBack)return void W.log("录制回放->不进行MS动态选点");W.log("MS->动态选点");this._getFastestMsServer(function(e){W.log("MS选点结束->",e);var t=F.default.MCUServerIP;if(e&&e.ip)F.default.MS_PUBLISH_IP=e.ip||"",F.default.MS_PUBLISH_PORT=e.port||"";else if(F.default.msList&&F.default.msList.length>0){var n=parseInt(Math.random()*F.default.msList.length);F.default.MS_PUBLISH_IP=F.default.msList[n].ip||"",F.default.MS_PUBLISH_PORT=F.default.msList[n].port||""}t&&t!=F.default.MS_PUBLISH_IP?W.log("MS->最新地址->",F.default.MS_PUBLISH_IP,F.default.MS_PUBLISH_PORT):W.log("MS不需要切换->IP",F.default.MS_PUBLISH_IP)})}},{key:"_sassDeleteDocument",value:function(e){return $.connected?null==e||x.default.isEmptyObject(e)?(W.error("删除文档失败->参数错误",e),void this._emit(v.default.MCU_ERROR,v.default.ERR_DOC_DELETE_FAILED_PARAM)):null==e.itemIdx||isNaN(e.itemIdx)||null==e.docId||""==e.docId?(W.error("删除文档失败->",e),void this._emit(v.default.MCU_ERROR,v.default.ERR_DOC_DELETE_FAILED_PARAM)):(W.log("删除文档->",e),void(K&&K.sassDeleteDocument(e))):void W.warn(F.default.getCurrentStatus())}},{key:"_sendDocBroadcastMsg",value:function(e){return $.connected?void(ne&&ne.sendDocBroadcastMsg(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sassDeleteDocumentSuccess",value:function(e){W.log("删除文档成功->",e),this._sendDocumentDelete(e)}},{key:"_sendStartClass",value:function(e){return $.connected?void(Z&&Z.startClass(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendPauseClass",value:function(e){return $.connected?void(Z&&Z.pauseClass(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_changeHandUpStatus",value:function(e){return $.connected?void(Z&&Z.changeHandUpStatus(e)):(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"_sendCloseClass",value:function(e){return $.connected?void(Z&&Z.closeClass(e)):(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"_leaveClass",value:function(e){if(!$.connected)return W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""};ee&&ee.stopPublishVideo(),te&&te.stopPublishAudio(),Z&&(Z.stopRecord(),Z.leaveClass());var t={};e&&e.type?t=e:t.type=0,W.warn("离开课堂->",v.default.CLASS_EXIT,t),this._emit(v.default.CLASS_EXIT,t),$&&($.leaveMCU(),F.default.setCurrentStatus(F.default.statusCode_3))}},{key:"_sendChatMsg",value:function(e){return $.connected?null===e||x.default.isEmptyObject(e)?(W.log("发送聊天消息失败->参数错误",e),{code:j.default.RETURN_FAILED,data:""}):void(X&&X.sendChatMsg(e)):(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"userDeviecStatusChange",value:function(e){Z&&Z.updaterUserDeviecStatusChange(e)}},{key:"videoUpdate",value:function(e){Z&&Z.updaterRosterStatus(e)}},{key:"_sendVideoBroadcastMsg",value:function(e){return $.connected?ee?ee.sendVideoBroadcastMsg(e):void 0:(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"_getVideoPlayPath",value:function(e){if(ee)return ee.getPlayVideoPath(e)}},{key:"_getVideoPublishPath",value:function(e){if(ee)return ee.getPublishVideoPath(e)}},{key:"_getVideoAllChannelInfo",value:function(e){if(ee)return ee.getAllChannelInfo(e)}},{key:"_publishVideo",value:function(e){return $.connected?ee?ee.publishVideo(e):void 0:(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"_stopPublishVideo",value:function(e){return $.connected?ee?ee.stopPublishVideo(e):void 0:(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"audioUpdate",value:function(e){Z&&Z.updaterRosterStatus(e)}},{key:"sendAudioCommandMsg",value:function(e){return $.connected?te?te.sendAudioBroadcastMsg(e):void 0:(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"_getPlayAudioPath",value:function(e){if(te)return te.getAudioPlayPath(e)}},{key:"_getPublishAudioPath",value:function(e){if(te)return te.getAudioPublishPath(e)}},{key:"_getAudioAllChannelInfo",value:function(e){if(te)return te.getAllChannelInfo(e)}},{key:"_publishAudio",value:function(e){return $.connected?te?te.publishAudio(e):void 0:(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"_stopPublishAudio",value:function(e){return $.connected?te?te.stopPublishAudio(e):void 0:(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"_sendInsertAnnotaion",value:function(e){return $.connected?void(re&&re.sendInsetAnnotaion(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendDeleteCurPageAnnotation",value:function(e){return $.connected?void(re&&re.sendDeleteCurPageAnnotation(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendDeleteAllAnnotation",value:function(e){return $.connected?void(re&&re.sendDeleteAllAnnotation(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendGotoPrev",value:function(e){re&&re.sendGotoPrev(e)}},{key:"_getDocFullAddress",value:function(e){return ne?ne.getDocFullAddress(e):(W.error("文档模块还没有创建无法获取"),{code:j.default.RETURN_FAILED,data:"文档模块还没有创建无法获取"})}},{key:"_getDocImageFullPath",value:function(e){return ne?ne.getDocImageFullPath(e):(W.error("文档模块还没有创建无法获取"),[])}},{key:"_getDocPDFFullPath",value:function(e){return ne?ne.getDocPDFFullPath(e):(W.error("文档模块还没有创建,无法获取"),[])}},{key:"_sendDocumentUpload",value:function(e){return $.connected?void(ne&&ne.documentUpload(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendDocumentSwitchDoc",value:function(e){return $.connected?void(ne&&ne.documentSwitchDoc(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendDocumentSwitchPage",value:function(e){return $.connected?void(ne&&ne.documentSwitchPage(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendDocumentSwitchAnimation",value:function(e){return $.connected?void(ne&&ne.documentSwitchAnimation(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendDocumentCommand",value:function(e){return $.connected?void(ne&&ne.documentCommand(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendDocumentDelete",value:function(e){return $.connected?void(ne&&ne.documentDelete(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_documentDeleteAll",value:function(e){return $.connected?void(ne&&ne.documentDeleteAll(e)):void W.warn(F.default.getCurrentStatus())}},{key:"docUpdateHandler",value:function(e){return $.connected||F.default.isRecordPlayBack?void(re&&re.docUpdateHandler(e)):void W.warn(F.default.getCurrentStatus())}},{key:"docDeleteHandler",value:function(e){re&&re.docDeleteHandler(e)}},{key:"docJoinChannelSuccess",value:function(){if(W.log("docJoinChannelSuccess->isHost=",F.default.isHost,"length=",F.default.docListPrepare.length),F.default.isHost&&F.default.docListPrepare.length>0)for(var e=0;e<F.default.docListPrepare.length;e++){var t=F.default.docListPrepare[e];if(t){var n={pageNum:t.pdfSize,fileName:t.name,fileType:t.type,relativeUrl:t.relativeLocation,url:t.absoluteLocation,creatUserId:t.createUserID,docId:t.id,md5:t.MD5,visible:!1};this._sendDocumentUpload(n)}}}},{key:"_initRecordPlayback",value:function(e){return null==e?(W.error("录制回放初始化失败->参数错误"),void this._emit(v.default.MCU_ERROR,v.default.ERR_INIT_RECORD_PLAY_BACK_FAILED)):null==e.classId||isNaN(e.classId)||null==e.portal||""==e.portal?(W.error("录制回放初始化失败->",e),void this._emit(v.default.MCU_ERROR,v.default.ERR_INIT_RECORD_PLAY_BACK_FAILED)):(W.log("录制回放初始化->",e),F.default.isRecordPlayBack=!0,F.default.classId=parseInt(e.classId),F.default.portal=e.portal,F.default.userRole=j.default.normal,F.default.userId=e.userId||"0",F.default.userName=e.userName||"",void(K&&K.getClassParam()))}},{key:"_startRecordPlayback",value:function(e){ie&&ie.startRecordPlayback(e)}},{key:"_stopRecordPlayback",value:function(e){ie&&ie.stopRecordPlayback(e)}},{key:"_pauseRecordPlayback",value:function(e){ie&&ie.pauseRecordPlayback(e)}},{key:"_seekRecordPlayback",value:function(e){ie&&ie.seekRecordPlayback(e)}},{key:"_recordPlaybackClearDataHandler",value:function(e){W.log("录制回放状态更新->"),ne&&ne.clearData(),re&&re.clearData()}},{key:"_joinRecordPlaybackSuccessHandler",value:function(e){W.log("加入录制回放成功."),F.default.setCurrentStatus(F.default.statusCode_2);var t={};t.isRecordPlayBack=F.default.isRecordPlayBack,t.DOCServerIP=F.default.DOCServerIP,t.DOCServerPort=F.default.DOCServerPort,t.classStatus=F.default.classStatus,t.classId=F.default.classId,t.className=F.default.className,t.h5Module=F.default.h5Module,t.isHost=F.default.isHost,t.maxAudioChannels=F.default.maxAudioChannels,t.maxVideoChannels=F.default.maxVideoChannels,t.maxMediaChannels=F.default.maxMediaChannels,t.mcuDelay=F.default.mcuDelay,t.msType=F.default.msType,t.nodeId=F.default.nodeId,t.password=F.default.password,t.passwordRequired=F.default.passwordRequired,t.role=F.default.role,t.siteId=F.default.siteId,t.topNodeID=F.default.topNodeID,t.userId=F.default.userId,t.userName=F.default.userName,t.userRole=F.default.userRole,t.userType=F.default.userType,t.siteId=F.default.siteId,t.classId=F.default.classId,t.userRole=F.default.userRole,t.userId=F.default.userId,t.passwordRequired=F.default.passwordRequired,t.classType=F.default.classType||j.default.CLASS_TYPE_INTERACT,t.country=F.default.country,t.city=F.default.city,t.province=F.default.province,t.isp=F.default.isp,t.classTimestamp=F.default.classTimestamp,t.recordTimestamp=F.default.recordTimestamp,t.recordPlaybackMaxTime=F.default.recordPlaybackMaxTime,t.fps=F.default.fps,t.gop=F.default.gop,t.videoQuality=F.default.videoQuality,W.log(t),this._emit(v.default.CLASS_JOIN_SUCCESS,t)}}]),t}(l.default),ae=oe;t.default=ae;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(W,"loger","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(Q,"_sdkInfo","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(K,"_sass","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(z,"_ipManager","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register($,"_mcu","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(Z,"_confer_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(X,"_chat_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(ee,"_video_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(te,"_audio_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(ne,"_doc_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(re,"_whiteboard_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(ie,"_recordPlayback","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(oe,"MessageEntrance","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(ae,"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(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var 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(7),l=r(u),f=n(1),d=r(f),c=n(17),h=r(c),p=n(28),_=r(p),E=n(27),g=r(E),y=d.default.getLoger("IpManager"),R=2e3,m="1935",v="7777",T="5555",C=function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this))}return a(t,e),s(t,[{key:"getUserIpInfo",value:function(e,t,n,r){var i={ret:-1},o=(0,h.default)("addr="+t+"&token=b657c3507b324353e09c1958ee956a98efceb3e3"),a=(new Date).getTime(),s="http://ipapi.ipip.net/find?addr="+t+"&sid=14&uid=5237&sig="+o+"&_="+a;y.log("获取IP信息->",s);(0,g.default)(s,{timeout:r||R}).then(function(e){return e.json()}).then(function(e){e&&(i.ret=e.ret,i.country=e.data[0],i.province=e.data[1],i.city=e.data[2],i.isp=e.data[4]),y.warn("获取IP信息->完成->",i),n&&n(i)}).catch(function(e){y.warn("获取IP信息->失败->",e.message),n&&n(i)})}},{key:"getFastestMcuServer",value:function(e,t,n){y.log("开始MCU选点-> ",e);var r={ip:""};if(null==e||e.length<1)return void(t&&t(r));for(var i=new Object,o=e.length,a=0;a<o;a++){var s=e[a];s&&s.ip&&(i[s.ip+":"+T]=s.ip+":"+T)}var u=new Array;for(var l in i)u.push(l);if(y.log("MCU选点->列表",u),null==u||u.length<1)return void(t&&t(r));try{(0,_.default)(u,function(n){if(n){y.log("MCU选点->done -> ",n);var i=n.replace(":"+T,"")||"";r.ip=i,r.port="";for(var o=e.length,a=0;a<o;a++){var s=e[a];if(s&&s.ip&&i==s.ip){r.port=s.port||v;break}}t&&t(r)}else y.warn("MCU选点-> nothing!"),t&&t(r)},n||R)}catch(e){y.log("MCU选点->失败",e.message)}}},{key:"getFastestMsServer",value:function(e,t,n){y.log("开始MS选点->",e);var r={ip:""};if(null==e||e.length<1)return void(t&&t(r));for(var i=new Object,o=e.length,a=0;a<o;a++){var s=e[a];s&&s.ip&&(i[s.ip+":"+T]=s.ip+":"+T)}var u=new Array;for(var l in i)u.push(l);if(null==u||u.length<1)return void(t&&t(r));y.log("MS选点->列表",u);try{(0,_.default)(u,function(n){if(n){y.log("MS选点->done -> ",n);var i=n.replace(":"+T,"")||"";r.ip=i,r.port="";for(var o=e.length,a=0;a<o;a++){var s=e[a];if(s&&s.ip&&i==s.ip){r.port=s.port||m;break}}t&&t(r)}else y.warn("MS选点-> nothing!"),t&&t(r)},n||R)}catch(e){y.warn("MS选点->ERROR -> ",e.message),t&&t(r)}}},{key:"getServerMcuList",value:function(e,t,n,r,i){var o=i.MCU[e];if(!o)return o=i.MCU.default||[];if("中国"!=e)return o;var a=o.isp[r];if(a)return a;var s=o.province[t];if(s)return s;var u=o.default;return u?u:[]}},{key:"getServerMsList",value:function(e,t,n,r,i){var o=i.MS[e];if(!o)return o=i.MS.default||[];if("中国"!=e)return o;var a=o.isp[r];if(a)return a;var s=o.province[t];if(s)return s;var u=o.default;return u?u:[]}}]),t}(l.default),S=C;t.default=S;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(y,"loger","D:/work/McuClient/src/IpManager.js"),__REACT_HOT_LOADER__.register(R,"TIME_OUT","D:/work/McuClient/src/IpManager.js"),__REACT_HOT_LOADER__.register(m,"MS_DEFAULT_PORT","D:/work/McuClient/src/IpManager.js"),__REACT_HOT_LOADER__.register(v,"MCU_DEFAULT_PORT","D:/work/McuClient/src/IpManager.js"),__REACT_HOT_LOADER__.register(T,"SPEED_TEST_PORT","D:/work/McuClient/src/IpManager.js"),__REACT_HOT_LOADER__.register(C,"IpManager","D:/work/McuClient/src/IpManager.js"),__REACT_HOT_LOADER__.register(S,"default","D:/work/McuClient/src/IpManager.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return l}Object.defineProperty(t,"__esModule",{value:!0}),t.MessageTypes=void 0,t.createMcuClient=i;var o=n(33),a=r(o),s=n(3),u=r(s),l=new a.default;t.MessageTypes=u.default;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(l,"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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var 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(7),l=r(u),f=n(1),d=r(f),c=n(3),h=r(c),p=n(5),_=r(p),E=n(17),g=r(E),y=n(2),R=r(y),m=n(28),v=(r(m),n(27)),T=(r(v),d.default.getLoger("Sass")),C={},S=function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this))}return a(t,e),s(t,[{key:"getJoinParams",value:function(e){var n=this,r="http://"+e.portal+"/3m/api/meeting/joinParams.do?meetingNumber="+e.classId+"&userID="+e.userId;T.log("1.初始化init获取课堂校验信息."),T.log(r),T.log(e),fetch(r,{timeout:5e3}).then(function(e){if(e.ok)return e.json();throw T.error("初始化init获取课堂校验信息-网络异常.状态码:"+e.status),n._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_INIT_NETWORK),""}).then(function(e){0===e.code?(T.log("初始化init获取课堂校验信息-完成"),n._emit(t.CLASS_INIT_SUCCESS,e)):1===e.code?n._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_INIT_FAILED_1):2===e.code?n._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_INIT_FAILED_2):3===e.code?n._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_INIT_FAILED_3):4===e.code?n._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_INIT_FAILED_4):n._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_INIT_FAILED,e)}).catch(function(e){T.error("初始化init获取课堂校验信息-异常.状态码:"+e),n._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_INIT_PROTOCOL,e)})}},{key:"passwordAndMd5Checking",value:function(e){return T.log("2.开始Sass校验"),T.log(e),C=e,"true"===C.passwordRequired||C.passwordRequired===!0?void this.sendPWDChecking():void this.sendMD5Checking()}},{key:"sendPWDChecking",value:function(){var e=this,t=0;C.userRole==R.default.host&&(t=1);var n="http://"+C.portal+"/3m/api/meeting/signIn.do?siteId="+C.siteId+"&classId="+C.classId+"&isTeacher="+t+"&password="+C.password;T.log("3.课堂密码校验",n),fetch(n,{timeout:5e3}).then(function(t){if(200===t.status)return t.text();throw T.error("课堂密码校验-网络异常.状态码:"+t.status),e._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_JOIN_NETWORK),""}).then(function(t){var n=JSON.parse(t);return"false"===n.flag||n.flag===!1?(T.error("课堂密码校验-失败."), -void e._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_PASSWORD_WRONG)):"true"===n.flag||n.flag===!0?(T.log("课堂密码校验-成功."),void e.sendMD5Checking()):(T.error("课堂密码校验-协议异常.",n),void e._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_JOIN_PROTOCOL))}).catch(function(t){T.error("课堂密码校验-异常.状态码:"+t),e._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_JOIN_FAILED)})}},{key:"sendMD5Checking",value:function(){var e=this,n="http://"+C.portal+"/3m/meeting/md5CheckMeeting.do?siteId="+C.siteId+"&meetingNumber="+C.classId+"&userId="+C.userId+"&userName="+C.userName+"&userType="+C.userType+"&nopassword="+C.passwordRequired+"&md5="+C.md5;T.log("4.MD5校验",n),fetch(n,{timeout:5e3}).then(function(t){if(200===t.status)return t.json();throw T.error("MD5校验-网络异常.状态码:"+t.status),e._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_JOIN_NETWORK),""}).then(function(n){"true"==n.flag||1==n.flag?(T.log("MD5校验完成"),T.log(n),e._emit(t.SUCCESS,n)):(T.log("MD5校验-失败."),e._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_MD5_WRONG))}).catch(function(t){T.error("MD5校验-异常.状态码:"+t),e._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_JOIN_FAILED)})}},{key:"getClassDetail",value:function(){var e=this,n="http://"+_.default.portal+"/3m/meeting/getClassH5.do?classNumber="+_.default.classId;T.log("获取Class详情.",n),fetch(n,{timeout:5e3}).then(function(t){if(t.ok)return t.json();throw T.error("获取Class详情-网络异常.状态码:"+t.status),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_CLASS_DETAIL),""}).then(function(n){0===n.errorCode?(T.log("获取Class详情完成"),e._emit(t.CLASS_GET_CLASS_DETAIL,n)):(T.warn("获取Class详情失败."),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_CLASS_DETAIL))}).catch(function(t){T.error("获取Class详情异常.状态码:"+t),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_CLASS_DETAIL)})}},{key:"getClassParam",value:function(){var e=this,n=(new Date).getTime(),r=(0,g.default)(_.default.classId+""+n),i="http://"+_.default.portal+"/3m/api/meeting/detail.do?meetingNumber="+_.default.classId+"×tamp="+n+"&authId="+r;T.log("5.获取课堂课堂的完整信息 "),T.log(i),fetch(i,{timeout:5e3}).then(function(t){if(t.ok)return t.json();throw T.error("获取课堂课堂的完整信息-网络异常.状态码:"+t.status),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_CLASS_PARAML),""}).then(function(n){0===n.code?(T.log("获取课堂课堂的完整信息完成"),e._emit(t.CLASS_GET_CLASS_PARAM,n)):(T.warn("获取课堂课堂的完整信息 失败."),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_CLASS_PARAML))}).catch(function(t){T.error("获取课堂课堂的完整信息异常.状态码:"+t),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_CLASS_PARAML)})}},{key:"sassDeleteDocument",value:function(e){var n=this;if(_.default.isRecordPlayBack)return void T.log("录制回放中,能删除文档");var r=(new Date).getTime(),i=(0,g.default)(e.docId+""+e.classId+r),o="http://"+_.default.portal+"/3m/api/document/deleteRelation.do?docId="+e.docId+"&classId="+_.default.classId+"×tamp="+r+"&authId="+i;T.log("sassDeleteDocument",o),fetch(o,{timeout:5e3}).then(function(e){if(e.ok)return e.json();throw T.error("sassDeleteDocument-网络异常.状态码:"+e.status),n._emit(h.default.MCU_ERROR,h.default.ERR_DOC_DELETE_FAILED),""}).then(function(r){0===r.code?(T.log("sassDeleteDocument 完成"),n._emit(t.DELETE_DOCUMENT_SUCCESS,e)):(T.warn("sassDeleteDocumnt 失败."),n._emit(h.default.MCU_ERROR,h.default.ERR_DOC_DELETE_FAILED))}).catch(function(e){T.error("sassDeleteDocument异常.状态码:"+e),n._emit(h.default.MCU_ERROR,h.default.ERR_DOC_DELETE_FAILED)})}},{key:"saveClassStatusInfo",value:function(e){var n=this;if(_.default.isRecordPlayBack)return void T.log("录制回放中,不需要保存课堂信息");var r=(new Date).getTime(),i=(0,g.default)(_.default.classId+""+r),o=JSON.stringify(e.classStatusInfo),a="http://"+_.default.portal+"/3m/api/meeting/saveInfo.do";T.log("saveClassStatusInfo",a),fetch(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"classId="+_.default.classId+"&info="+o+"×tamp="+r+"&authId="+i,timeout:5e3}).then(function(e){if(e.ok)return e.json();throw T.error("saveClassStatusInfo-网络异常.状态码:"+e.status),""}).then(function(r){0===r.code?(T.log("saveClassStatusInfo 完成"),n._emit(t.CLASS_SAVE_STATUS_INFO_SUCCESS,e)):1===r.code?T.log("saveClassStatusInfo 失败 课堂号为空"):2===r.code?T.log("saveClassStatusInfo 失败 无效的课堂号"):3===r.code?T.log("saveClassStatusInfo 失败 验证信息错误"):T.warn("saveClassStatusInfo 失败.",r)}).catch(function(e){T.error("saveClassStatusInfo.状态码:"+e)})}},{key:"saveClassRecordContrlInfo",value:function(e){var n=this;if(_.default.isRecordPlayBack)return void T.log("录制回放中,不需要保存");T.log("保存开始录制信息");var r="3mang123A",i=_.default.siteId,o=_.default.classId,a=_.default.userId,s=_.default.userName,u=_.default.className,l=_.default.classBeginTime,f=_.default.classEndTime,d="",c=_.default.recordFileName,h=_.default.recordFileName,p="",E=(_.default.classStatus,_.default.classTimestamp),y=(new Date).getTime(),R=(0,g.default)(r+i+o+y),m="http://"+_.default.portal+"/3m/recordingMeeting/insertRecordingMeeting.do";T.log("saveClassRecordContrlInfo",m),fetch(encodeURI(m),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"siteID="+i+"&meetingID="+o+"&userID="+a+"&userName="+s+"&meetingName="+u+"&startTime="+l+"&endTime="+f+"&playUrl="+d+"&streamName="+c+"&downloadUrl="+p+"&configFile="+h+"×tamp="+y+"&recordTimestamp="+E+"&authId="+R,timeout:5e3}).then(function(e){if(e.ok)return e.json();throw T.error("保存开始录制信息-网络异常.状态码:"+e.status),""}).then(function(r){0===r.errorCode?(T.log("保存开始录制信息 完成"),n._emit(t.CLASS_SAVE_RECORD_INFO_SUCCESS,e)):T.warn("保存开始录制信息 失败.",r)}).catch(function(e){T.error("保存开始录制信息异常.状态码:"+e)})}}]),t}(l.default);S.prototype.SUCCESS=S.SUCCESS="Sass_success",S.prototype.CLASS_INIT_SUCCESS=S.CLASS_INIT_SUCCESS="sass_class_init_success",S.prototype.CLASS_GET_CLASS_PARAM=S.CLASS_GET_CLASS_PARAM="sass_class_getClassParam.message",S.prototype.CLASS_GET_CLASS_DETAIL=S.CLASS_GET_CLASS_DETAIL="sass_class_getClassDetail_message",S.prototype.DELETE_DOCUMENT_SUCCESS=S.DELETE_DOCUMENT_SUCCESS="sass_class_deleteDocumentSuccess_message",S.prototype.CLASS_SAVE_STATUS_INFO_SUCCESS=S.CLASS_SAVE_STATUS_INFO_SUCCESS="sass_class_saveClassStatusInfoSuccess_message",S.prototype.CLASS_SAVE_RECORD_INFO_SUCCESS=S.CLASS_SAVE_RECORD_INFO_SUCCESS="sass_class_saveClassRecordInfoSuccess_message";var I=new S;t.default=I;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(T,"loger","D:/work/McuClient/src/Sass.js"),__REACT_HOT_LOADER__.register(C,"confInfo","D:/work/McuClient/src/Sass.js"),__REACT_HOT_LOADER__.register(S,"Sass","D:/work/McuClient/src/Sass.js"),__REACT_HOT_LOADER__.register(I,"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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var 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(8),l=r(u),f=n(2),d=r(f),c=n(6),h=r(c),p=n(1),_=r(p),E=n(3),g=r(E),y=n(5),R=r(y),m=n(4),v=r(m),T=n(21),C=r(T),S=_.default.getLoger("AudioApe"),I=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,d.default.AUDIO_SESSION_ID,d.default.AUDIO_SESSION_NAME,d.default.AUDIO_SESSION_TAG));return e.releaseTimeId=0,e.mediaModule=new C.default,e.mediaModule.MEDIA_OBJ_TABLE_ID=d.default.AUDIO_OBJ_TABLE_ID,e.mediaModule.mediaChannels={},e.mediaModule.mediaType=d.default.MEDIA_TYPE_AUDIO,e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(h.default.RCPDU_REG_REGISTER_TABLE,d.default.AUDIO_OBJ_TABLE_ID,d.default.AUDIO_OBJ_TABLE_NAME,d.default.AUDIO_OBJ_TABLE_TAG,0,new ArrayBuffer),e.on(h.default.RCPDU_SEND_AUDIO_DATA_REQUEST,e.receiveAudiooCommandHandler.bind(e)),e}return a(t,e),s(t,[{key:"onJoinChannelHandlerSuccess",value:function(){this.mediaModule.maxMediaChannel=R.default.maxAudioChannels}},{key:"getAudioPlayPath",value:function(e){return S.log("获取播流地址->"),this.mediaModule.getMediaPlayPath(e)}},{key:"getAudioPublishPath",value:function(e){if(S.log("获取推流地址->"),!this.mcu.connected)return S.warn(R.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};var t=this.mediaModule.getMediaPublishPath(e);return this._emit(g.default.AUDIO_GET_PUBLISH_PATH,t),t}},{key:"getAllChannelInfo",value:function(e){return S.log("获取当前所有频道信息->"),this.mediaModule.getAllMediaChannelInfo()}},{key:"publishAudio",value:function(e){if(!this.mcu.connected)return S.warn(R.default.getCurrentStatus()),this._emit(g.default.AUDIO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"已经断开连接!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"已经断开连接",mediaId:0};if(null==e||null==e.publishUrl)return S.warn("推流->参数错误",e),this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),this._emit(g.default.AUDIO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"参数错误!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"参数错误"};var t=this.mediaModule.getNeedPublishMediaChannel(e.publishUrl);if(null==t)return S.warn("推流->推流数据已经无效",e),this._emit(g.default.AUDIO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"推流数据已经无效!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"推流数据已经无效"};var n=this.mediaModule.getFreeMediaChannel();if(0==n)return S.warn("推流->不能再打开更多的设备"),this._emit(g.default.AUDIO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"不能再打开更多的设备",mediaId:0}),{code:d.default.RETURN_FAILED,data:"不能再打开更多的设备",mediaChannels:this.mediaModule.mediaChannels};if(this.mediaModule.checkChannelIsOpening(t.channelId))return t.nodeId==R.default.nodeId?(S.warn(t.channelId,"已经推送过消息,不需要再次推送!"),this._emit(g.default.AUDIO_PUBLISH_RESULT,{code:d.default.RETURN_SUCCESS,data:"已经推送过消息,不需要再次推送!",mediaId:t.channelId}),{code:d.default.RETURN_SUCCESS,data:"已经推送过消息,不需要再次推送!",mediaId:t.channelId}):(S.warn(t.channelId,"频道已经被占用"),this._emit(g.default.AUDIO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"频道已经被占用!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"频道已经被占用!"});var r=this.mediaModule.getDefaultChannelInfo();return r.owner=R.default.nodeId,r.status=d.default.CHANNEL_STATUS_OPENING,r.channelId=t.channelId,r.streamId=t.streamId,r.timestamp=t.timestamp,r.mediaType=d.default.MEDIA_TYPE_AUDIO,this.sendTableUpdateHandler(r),this._emit(g.default.AUDIO_PUBLISH_RESULT,{code:d.default.RETURN_SUCCESS,data:"推流成功!",mediaId:t.channelId}),{code:d.default.RETURN_SUCCESS,data:"推流成功!",mediaId:t.channelId}}},{key:"stopPublishAudio",value:function(e){if(S.log("停止推流 ->",e),!this.mcu.connected)return S.warn(R.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};var t=R.default.nodeId;e&&parseInt(e.nodeId)>0&&(t=parseInt(e.nodeId));var n=0;e&&parseInt(e.mediaId)>0&&(n=parseInt(e.mediaId)),n>0?this._releaseChannelForNodeId(t,n):this._releaseNodeIdAllChannel(t)}},{key:"_releaseChannelForNodeId",value:function(e,t){S.log(e,"释放占用的频道-->",t);var n=this.mediaModule.mediaChannels[t];if(n&&n.status==d.default.CHANNEL_STATUS_OPENING)if(n.fromNodeId==e){var r=this.mediaModule.getDefaultChannelInfo();r.status=d.default.CHANNEL_STATUS_RELEASED,r.channelId=t,this.sendTableUpdateHandler(r)}else S.warn(t,"不属于nodeId",e,"不能释放",n);else S.warn(e,"要释放的频道不存在或者已经释放-->channelId",n)}},{key:"_releaseNodeIdAllChannel",value:function(e){if(S.log(e,"_releaseNodeIdAllChannel",this.mcu.connected),!this.mcu.connected)return clearTimeout(this.releaseTimeId),S.warn(R.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};var t=this.mediaModule.getOpeningMediaChannel(e);if(0==t)return S.warn(e,"没有占用频道不需要处理"),{code:d.default.RETURN_FAILED,data:"没有占用channel不需要处理"};var n=this.mediaModule.getDefaultChannelInfo();n.status=d.default.CHANNEL_STATUS_RELEASED,n.channelId=t,this.sendTableUpdateHandler(n),this.releaseTimeId=setTimeout(function(){S.warn(e,"检查频道是否占用"),this._releaseNodeIdAllChannel(e)}.bind(this),800)}},{key:"sendAudioBroadcastMsg",value:function(e){if(!this.mcu.connected)return S.warn(R.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};if(null===this._classInfo||v.default.isEmptyObject(this._classInfo))return S.log("音频模块广播->失败->还未初始化数据!"),0==R.default.getCurrentStatus().code||1==R.default.getCurrentStatus().code?(this._emit(g.default.MCU_ERROR,g.default.ERR_APE_SEND_FAILED_NO_JOIN),{code:d.default.RETURN_FAILED,data:"sendAudioBroadcastMsg.McuClient还未初始化数据"}):{code:d.default.RETURN_FAILED,data:"sendAudioBroadcastMsg.McuClient还未初始化数据"};if(null==e)return S.warn("音频模块广播->失败->,参数错误",e),this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),{code:d.default.RETURN_FAILED,data:"sendAudioBroadcastMsg,参数错误"};if(S.log("音频模块广播->",e),null!=e.actionType&&e.actionType==d.default.MEDIA_ACTION_OPEN_CAMERA){var t=this.mediaModule.getFreeMediaChannel();if(0==t)return S.warn("不能再打开更多的设备",e),{code:d.default.RETURN_FAILED,data:"不能再打开更多的设备",mediaChannels:this.mediaModule.mediaChannels}}var n=new h.default.RCAudioSendDataRequestPdu;n.type=h.default.RCPDU_SEND_AUDIO_DATA_REQUEST,n.isPublic=!0,n.fromNodeId=R.default.nodeId,n.toNodeId=parseInt(e.toNodeId)||0,n.actionType=parseInt(e.actionType)||d.default.MEDIA_ACTION_DEFAULT;var r="";try{r=JSON.stringify(e.data)}catch(t){S.warn("控制消息->JSON转换失败"),r=e.data}return n.data=this._rCArrayBufferUtil.strToUint8Array("h5"+r),n.isPublic||0==n.toNodeId?this.sendChatUniform(n):this.send(n),{code:d.default.RETURN_SUCCESS,data:""}}},{key:"sendTableUpdateHandler",value:function(e){var t=this.packPdu(e,e.channelId);if(null==t)return void S.warn("音频模块更新数据-> 失败->数据无效",e);var n=new h.default.RCRegistryTableItemPdu;n.itemIdx=e.channelId,n.owner=e.owner,n.itemData=t.toArrayBuffer();var r=new h.default.RCRegistryTableUpdateItemPdu;r.type=h.default.RCPDU_REG_TABLE_UPDATE_PDU,r.items.push(n);var i=new h.default.RCRegistryUpdateObjPdu;i.objId=d.default.AUDIO_OBJ_TABLE_ID,i.subType=r.type,i.userData=r.toArrayBuffer();var o=new h.default.RCAdapterItemPdu;o.type=h.default.RCPDU_REG_UPDATE_OBJ,o.itemData=i.toArrayBuffer();var a=new h.default.RCAdapterPdu;a.type=h.default.RCPDU_REG_ADAPTER,a.item.push(o),S.log("音频模块更新数据->itemIdx="+n.itemIdx),this.sendUniform(a,!0)}},{key:"receiveAudiooCommandHandler",value:function(e){var t=h.default.RCAudioSendDataRequestPdu.decode(e);if(null==t)return void S.warn("音频消息处理,收到的消息为null,不做处理");t.data=this._rCArrayBufferUtil.uint8ArrayToStr(t.data,2);var n={};try{n=JSON.parse(t.data)}catch(e){S.warn("控制消息->JSON转换失败"),n=t.data}t.data=n,0!=t.toNodeId&&t.toNodeId!=R.default.nodeId?S.log("音频消息不处理 toNodeId=",t.toNodeId,"my nodeId=",R.default.nodeId):(S.log("音频控制消息处理 .",t),this._emit(g.default.AUDIO_BROADCAST,t))}},{key:"tableUpdateHandler",value:function(e,t,n,r){var i=this.unPackPdu(e,t,n);if(S.log("tableUpdateHandler->channel",t,"status->",i.status,"seek->",r),0==e&&(S.log("释放占用的频道,channel",t),i.status=d.default.CHANNEL_STATUS_RELEASED,i.streamId=""),this.mediaModule.mediaChannels[t]=i,i&&i.fromNodeId!=R.default.nodeId){var o={};if(o.mediaId=i.channelId,o.fromNodeId=i.fromNodeId,o.userName=i.userName||"",o.userRole=i.userRole||d.default.normal,i.status==d.default.CHANNEL_STATUS_OPENING){o.m3u8Url="",o.rtmpUrl="",o.replay="",o.seek=r||0;var a=this.mediaModule.getMediaPlayPath({type:"m3u8",streamId:i.streamId}),s=this.mediaModule.getMediaPlayPath({type:"rtmp",streamId:i.streamId}),u=this.mediaModule.getMediaRecordPlaybackPath({type:"m3u8",streamId:i.streamId});0==a.code&&(o.m3u8Url=a.playUrl),0==s.code&&(o.rtmpUrl=s.playUrl),0==u.code&&(o.replay=u.playUrl),S.log("AUDIO_PLAY->",o),this._emit(g.default.AUDIO_PLAY,o)}else S.log("AUDIO_STOP->",o),this._emit(g.default.AUDIO_STOP,o)}else S.warn("消息是自己发送的或者是消息无效,不需要处理,消息内容如下:"),S.log(i),i.status==d.default.CHANNEL_STATUS_OPENING?(R.default.openMicrophones=v.default.creatTimestamp(),R.default.openCamera=0):(R.default.openCamera=0,R.default.openMicrophones=0),this._emit(g.default.USER_DEVICE_STATUS_CHAANGE,{nodeId:R.default.nodeId,userRole:R.default.userRole,userName:R.default.userName,userId:R.default.userId,openCamera:R.default.openCamera,openMicrophones:R.default.openMicrophones});this._emit(g.default.AUDIO_UPDATE,i)}},{key:"packPdu",value:function(e,t){if(null==e||null==t)return S.warn("packPdu->失败"),this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),null;var n=new h.default.RCAudioChannelInfoPdu;return n.status=e.status||d.default.CHANNEL_STATUS_RELEASED,n.channelId=t,n.streamId=e.streamId||"",n.siteId=e.siteId||R.default.siteId,n.classId=parseInt(e.classId)||parseInt(R.default.classId),n.userId=e.userId||"0",n.mediaType=e.mediaType||d.default.MEDIA_TYPE_AUDIO,n.timestamp=e.timestamp||v.default.creatTimestamp(),n.fromNodeId=R.default.nodeId,n.userName=R.default.userName||"",n.toNodeId=0,n.userRole=R.default.userRole||d.default.normal,S.log("packPdu->",n),n}},{key:"unPackPdu",value:function(e,t,n){if(null==e||null==t||null==n)return this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),null;try{var r=h.default.RCAudioChannelInfoPdu.decode(n);return S.log("unPackPdu->",r),r}catch(e){S.log("unPackPdu error->itemIdx="+t+" err:"+e.message)}return null}}]),t}(l.default),A=I;t.default=A;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(S,"loger","D:/work/McuClient/src/apes/AudioApe.js"),__REACT_HOT_LOADER__.register(I,"AudioApe","D:/work/McuClient/src/apes/AudioApe.js"),__REACT_HOT_LOADER__.register(A,"default","D:/work/McuClient/src/apes/AudioApe.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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var 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(8),l=r(u),f=n(2),d=r(f),c=n(6),h=r(c),p=n(1),_=r(p),E=n(3),g=r(E),y=n(4),R=r(y),m=_.default.getLoger("ChatApe"),v=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,d.default.CHAT_SESSION_ID,d.default.CHAT_SESSION_NAME,d.default.CHAT_SESSION_TAG));return e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(h.default.RCPDU_REG_REGISTER_TABLE,d.default.CHAT_OBJ_TABLE_ID,d.default.CHAT_OBJ_TABLE_NAME,d.default.CHAT_OBJ_TABLE_TAG,0,new ArrayBuffer),e.on(h.default.RCPDU_SEND_CHAT_DATA_REQUEST,e.chatMsgIncomingHandler.bind(e)),e}return a(t,e),s(t,[{key:"sendChatMsg",value:function(e){if(null===this._classInfo||R.default.isEmptyObject(this._classInfo)){if(m.log("不能发送聊天消息.McuClient还未初始化数据!"),0==GlobalConfig.getCurrentStatus().code||1==GlobalConfig.getCurrentStatus().code)return void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_SEND_FAILED_NO_JOIN)}else{m.log("发送聊天消息.",e.to,e.message);var t=new h.default.RCChatSendDataRequestPdu;t.type=h.default.RCPDU_SEND_CHAT_DATA_REQUEST,t.initiator=this._classInfo.nodeId,t.peer=parseInt(e.to),t.userData=this._rCArrayBufferUtil.strToUint8Array("h5"+e.message),t.fromName=this._rCArrayBufferUtil.strToUint8Array("h5"+this._classInfo.userName),t.fromRole=this._classInfo.userRole,t.isPublic=!0,t.isPublic||0==t.peer?this.sendChatUniform(t):this.send(t)}}},{key:"chatMsgIncomingHandler",value:function(e){var t=h.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,m.log("接收聊天消息.",n),this._emit(g.default.CHAT_RECEIVE,n)}}]),t}(l.default),T=v;t.default=T;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(m,"loger","D:/work/McuClient/src/apes/ChatApe.js"),__REACT_HOT_LOADER__.register(v,"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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var 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(8),l=r(u),f=n(2),d=r(f),c=n(6),h=r(c),p=n(1),_=r(p),E=n(3),g=r(E),y=n(5),R=r(y),m=n(4),v=r(m),T=_.default.getLoger("DocApe"),C=0,S=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,d.default.DOCSHARING_SESSION_ID,d.default.DOCSHARING_SESSION_NAME,d.default.DOCSHARING_SESSION_TAG));return e.docList={},e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(h.default.RCPDU_REG_REGISTER_TABLE,d.default.DOCSHARING_OBJ_TABLE_ID,d.default.DOCSHARING_OBJ_TABLE_NAME,d.default.DOCSHARING_OBJ_TABLE_TAG,0,new ArrayBuffer),e}return a(t,e),s(t,[{key:"documentUpload",value:function(e){if(null==e||v.default.isEmptyObject(e))return T.warn("上传文档->失败->参数错误->",e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG);if(this.checkDocId(e.docId))return void T.warn("上传文档->失败->文档档的docId无效或已经存在相同的docId不需要上传");C=v.default.creatSoleNumberFromTimestamp();var t=this.packPdu(e,C);if(null==t)return T.log("上传文档->失败->数据无效"),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG);var n=new h.default.RCRegistryTableItemPdu;n.itemIdx=C,n.registerObjId=d.default.DOCSHARING_OBJ_TABLE_ID,n.owner=0,n.itemData=t.toArrayBuffer();var r=new h.default.RCRegistryTableInsertItemPdu;r.type=h.default.RCPDU_REG_TABLE_INSERT_PDU,r.items.push(n);var i=new h.default.RCRegistryUpdateObjPdu;i.objId=d.default.DOCSHARING_OBJ_TABLE_ID,i.subType=r.type,i.userData=r.toArrayBuffer();var o=new h.default.RCAdapterItemPdu;o.type=h.default.RCPDU_REG_UPDATE_OBJ,o.itemData=i.toArrayBuffer();var a=new h.default.RCAdapterPdu;a.type=h.default.RCPDU_REG_ADAPTER,a.item.push(o),T.log("上传文档->发送->itemIdx="+n.itemIdx),this.sendUniform(a,!0)}},{key:"updaterDoc",value:function(e,t){if(null==e||null==t)return this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),null;T.log("文档->updaterDoc ",e);var n=this.packPdu(e,t),r=new h.default.RCRegistryTableItemPdu;r.itemIdx=t,r.owner=0,r.itemData=n.toArrayBuffer();var i=new h.default.RCRegistryTableUpdateItemPdu;i.type=h.default.RCPDU_REG_TABLE_UPDATE_PDU,i.items.push(r);var o=new h.default.RCRegistryUpdateObjPdu;o.objId=d.default.DOCSHARING_OBJ_TABLE_ID,o.subType=i.type,o.userData=i.toArrayBuffer();var a=new h.default.RCAdapterItemPdu;a.type=h.default.RCPDU_REG_UPDATE_OBJ,a.itemData=o.toArrayBuffer();var s=new h.default.RCAdapterPdu;s.type=h.default.RCPDU_REG_ADAPTER,s.item.push(a),T.log("发送更新文档.itemIdx="+r.itemIdx),this.sendUniform(s,!0)}},{key:"getDocFullAddress",value:function(e){if(null==e||null==e.url||null==e.itemIdx)return T.warn("获取文档完整地址->传递的参数不正确->",e),{code:d.default.RETURN_FAILED,data:"获取文档时传递的参数不对"};var t="",n=1,r="",i="",o=this.docList[e.itemIdx];o?(t=o.url||"",n=o.pageNum||1,i=o.fileType||""):t=e.url,r=this._getDocType(t);var a=this._getDocPath(t),s=[],u="",l="";if("jpg"==r||"png"==r||"swf"==r||"pdf"==r||"doc"==r||"pptx"==r)for(var f=1;f<=n;f++)s.push(a+"/"+f+".jpg");return"swf"!=r&&"pdf"!=r&&"doc"!=r&&"pptx"!=r||(l=t.replace(/\.swf/g,".pdf")||""),"html"==r&&(u=t),{code:d.default.RETURN_SUCCESS,data:"",docFullAddress:{images:s,pdf:l,html:u}}}},{key:"_getDocType",value:function(e){return e?e.lastIndexOf(".jpg")>=0?"jpg":e.lastIndexOf(".png")>=0?"png":e.lastIndexOf(".swf")>=0?"swf":e.lastIndexOf(".pdf")>=0?"pdf":e.lastIndexOf(".doc")>=0?"doc":e.lastIndexOf(".html")>=0?"html":e.lastIndexOf(".pptx")>=0?"pptx":"":""}},{key:"_getDocPath",value:function(e){if(!e)return"";var t=e.lastIndexOf("/");return t>0?e.substr(0,t):e}},{key:"getDocImageFullPath",value:function(e){if(null==e||null==e.relativeUrl||""==e.relativeUrl)return T.warn("获取文档完整地址,传递的参数不对.",e),[];var t=""==R.default.DOCServerPort||null==R.default.DOCServerPort?"":":"+R.default.DOCServerPort,n=R.default.DOCServerIP+t+e.relativeUrl;n&&n.indexOf("http://")<0&&(n="http://"+n);var r="jpg";switch(e.type){case"jpg":r="jpg",n=this.replacePathType(n)+".jpg";break;case"png":r="png",n=this.replacePathType(n)+".png"}if(e.pageNum&&parseInt(e.pageNum)>1){var i=n.lastIndexOf("/");if(i>0){for(var o=n.substr(0,i),a=[],s=1;s<=e.pageNum;s++)a.push(o+"/"+s+"."+r);return a}return[n]}return[n]}},{key:"getDocPDFFullPath",value:function(e){if(null==e||null==e.relativeUrl||""==e.relativeUrl)return T.warn("获取文档完整地址,传递的参数不对.",e),[];var t=""==R.default.DOCServerPort||null==R.default.DOCServerPort?"":":"+R.default.DOCServerPort,n=R.default.DOCServerIP+t+e.relativeUrl;return n&&n.indexOf("http://")<0&&(n="http://"+n),n=this.replacePathType(n)+".pdf",[n]}},{key:"replacePathType",value:function(e){var t=e;return t=t.replace(/.jpg/g,""),t=t.replace(/.png/g,""),t=t.replace(/.swf/g,""),t=t.replace(/.pdf/g,"")}},{key:"_docPackFullInfo",value:function(e){var t=e,n=this.getDocFullAddress(e);return n.code==d.default.RETURN_SUCCESS?(t.images=n.docFullAddress.images||[],t.pdf=n.docFullAddress.pdf||"",t.html=n.docFullAddress.html||""):(t.images=[],t.pdf="",t.html=""),T.log("docPackFullInfo->",t),t}},{key:"updaterRecordStatus",value:function(e){R.default.isHost&&!R.default.isRecordPlayBack&&R.default.activeDocId>0&&(T.log("开启录制成功->更新当前的文档数据->docId:",R.default.activeDocId,"page:",R.default.activeDocCurPage),this.documentSwitchPage({itemIdx:R.default.activeDocId,curPageNo:R.default.activeDocCurPage}))}},{key:"clearData",value:function(){T.log("clearData->"),this.docList={},R.default.activeDocId=0,R.default.activeDocCurPage=1}},{key:"documentSwitchDoc",value:function(e){if(T.log("切换文档->",e),R.default.isRecordPlayBack)return void T.warn("录制回放状态不允许切换文档");if(null==e||null==e.itemIdx)return T.warn("切换文档失败,参数错误",e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG);if(e.itemIdx==R.default.activeDocId&&0!=R.default.activeDocId)return void T.warn("文档已经显示",e.itemIdx,R.default.activeDocId);var t=void 0;0!=R.default.activeDocId&&(t=this.docList[R.default.activeDocId],t&&(t.action=d.default.DOC_ACTION_NORMAL,t.visible=!1,t.animationStep=1));var n=this.docList[e.itemIdx];return null==n?(T.warn("切换文档失败,文档不存在",e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG)):(n.action=d.default.DOC_ACTION_SWITCH_DOC,n.visible=e.visible||!1,n.animationStep=1,T.log({oldDoc:t,nowDoc:n}),this.updaterDoc(n,n.itemIdx),void(t&&this.updaterDoc(t,t.itemIdx)))}},{key:"documentSwitchPage",value:function(e){T.log("文档翻页->",e);var t=this.docList[e.itemIdx];return null==t?(T.log("文档翻页->文档不存在",e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG)):(t.action=d.default.DOC_ACTION_SWITCH_PAGE,t.curPageNo=parseInt(e.curPageNo)||1,t.animationStep=1,t.curPageNo<1&&(t.curPageNo=1),void this.updaterDoc(t,t.itemIdx))}},{key:"documentSwitchAnimation",value:function(e){T.log("文档页面动画切换->",e);var t=this.docList[R.default.activeDocId];return null==t?(T.log("文档页面动画切换->文档不存在",R.default.activeDocId,e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG)):(t.action=d.default.DOC_ACTION_SWITCH_ANIMATION,t.animationStep=t.animationStep||1,e&&e.step==-1?t.animationStep--:t.animationStep++,(!t.animationStep||t.animationStep<1)&&(t.animationStep=1),void this.updaterDoc(t,t.itemIdx))}},{key:"documentSwitchShowModel",value:function(e){T.log("文档切换显示模式",e);var t=this.docList[e.itemIdx];return null==t?(T.log("文档切换显示模式->文档不存在",e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG)):(t.action=d.default.DOC_ACTION_SWITCH_PAGE,t.curPageNo=parseInt(e.curPageNo)||1,t.curPageNo<1&&(t.curPageNo=1),void this.updaterDoc(t,t.itemIdx))}},{key:"documentCommand",value:function(e){var t=this.docList[e.itemIdx];return null==t?(T.log("documentCommand失败,文档不存在",e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG)):(t.action=d.default.DOC_ACTION_COMMAND,t.showType=parseInt(e.showType)||0,void this.updaterDoc(t,t.itemIdx))}},{key:"documentDeleteAll",value:function(e){for(var t in this.docList)T.log("删除文档数据->itemIdx:"+t),this.documentDelete({itemIdx:t})}},{key:"documentDelete",value:function(e){var t=new h.default.RCRegistryTableDeleteItemPdu;t.type=h.default.RCPDU_REG_TABLE_DELETE_PDU,t.itemIdx=parseInt(e.itemIdx);var n=new h.default.RCRegistryUpdateObjPdu;n.objId=d.default.DOCSHARING_OBJ_TABLE_ID,n.subType=t.type,n.userData=t.toArrayBuffer();var r=new h.default.RCAdapterItemPdu;r.type=h.default.RCPDU_REG_UPDATE_OBJ,r.itemData=n.toArrayBuffer();var i=new h.default.RCAdapterPdu;i.type=h.default.RCPDU_REG_ADAPTER,i.item.push(r),T.log("文档发送删除数据=============>"+t.itemIdx),this.sendUniform(i,!0)}},{key:"tableInsertHandler",value:function(e,t,n){}},{key:"tableInsertApeHandler",value:function(e,t){var n=e,r=n.length;T.log("添加文档->","activeDocId->",R.default.activeDocId,"tableUpdateItemsLen->",r);for(var i=0;i<r;++i){var o=n[i],a=this.unPackPdu(o.owner,o.itemIdx,o.itemData);if(a){this.docList[o.itemIdx]=a,"true"!=a.visible&&1!=a.visible||(R.default.activeDocId=a.itemIdx,R.default.activeDocCurPage=a.curPageNo,T.log("添加文档->设置当前激活的文档id"));var s=this._docPackFullInfo(a);this._emit(g.default.DOC_UPDATE,s)}}this._showDefaultDoc()}},{key:"tableDeleteHandler",value:function(e,t){if(T.log("删除文档数据->",e,t),t&&t.itemIdx)for(var n=t.itemIdx.length,r=t.itemIdx,i=0;i<n;i++)if(this.docList[r[i]]){T.log("删除文档数据:",r[i]);var o=this.docList[r[i]];!o||"true"!=o.visible&&1!=o.visible||(R.default.activeDocId=0,R.default.activeDocCurPage=1,T.log("删除文档数据->清除当前显示的文档")),this._emit(g.default.DOC_DELETE,{itemIdx:r[i]}),delete this.docList[r[i]]}}},{key:"tableUpdateHandler",value:function(e,t,n){}},{key:"tableUpdateApeHandler",value:function(e,t){var n=e.length;T.log("更新文档->","activeDocId->",R.default.activeDocId,"更新的数量->",n);for(var r=0;r<n;++r){var i=e[r],o=this.unPackPdu(i.owner,i.itemIdx,i.itemData);if(null!=o){this.docList[i.itemIdx]=o,!o||"true"!=o.visible&&1!=o.visible||(R.default.activeDocId=o.itemIdx,R.default.activeDocCurPage=o.curPageNo,T.log("更新文档->设置当前激活的文档id->",R.default.activeDocId,"curPageNum->",R.default.activeDocCurPage));var a=this._docPackFullInfo(o);this._emit(g.default.DOC_UPDATE,a)}else T.log("更新文档-> 数据无效--> itemIdx",C)}this._showDefaultDoc()}},{key:"_showDefaultDoc",value:function(){if(!(R.default.isRecordPlayBack||!R.default.isHost||R.default.activeDocId>0)){ -var e=void 0;for(var t in this.docList)if(e=this.docList[t]){T.log("选择一个文档作为默认文档显示->",e);var n={itemIdx:e.itemIdx,visible:!0};return void this.documentSwitchDoc(n)}}}},{key:"onJoinChannelHandlerSuccess",value:function(){var e=this;T.log(this._session_name+" onJoinChannelHandlerSuccess==========================="),this._apeDelayed?setTimeout(function(){e._emit(t.DOC_JOIN_CHANNEL_SUCCESS)},R.default.mcuDelay+R.default.docDelay||12e3+R.default.docDelay):setTimeout(function(){e._emit(t.DOC_JOIN_CHANNEL_SUCCESS)},R.default.docDelay)}},{key:"checkDocId",value:function(e){if(null==e)return T.warn("查找文档->失败->参数为null"),!0;for(var t in this.docList){var n=this.docList[t];if(n&&n.docId==e)return T.log("查找文档->已经存在->",e),!0}return T.log("查找文档->没有查找到文档->",e),!1}},{key:"packPdu",value:function(e,t){if(T.log("文档->packPdu"),null==e||null==t)return this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),null;var n=new h.default.RCDocSendDataModelPdu;return n.itemIdx=t,n.owner=R.default.nodeId,n.from=R.default.nodeId,n.curPageNo=e.curPageNo||1,n.pageNum=e.pageNum||1,n.fileType=e.fileType||"",n.creatUserId=e.creatUserId||"0",n.url=e.url||"",n.relativeUrl=e.relativeUrl||"",n.curV=e.curV||0,n.curH=e.curH||0,n.scale=e.scale||100,n.visible=e.visible||!1,n.action=e.action||d.default.DOC_ACTION_NORMAL,n.docId=e.docId||"",n.md5=e.md5||"",n.fileName=e.fileName||"doc_"+t,n.dynamicTS=e.dynamicTS||"0",n.showType=e.showType||0,n.animationStep=e.animationStep||1,n}},{key:"unPackPdu",value:function(e,t,n){if(null==e||null==t||null==n)return this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),null;try{var r=h.default.RCDocSendDataModelPdu.decode(n);return T.log("文档===>unPackPdu"),r}catch(e){T.log("文档===>unPackPdu->Pdu解析错误->itemIdx="+t+"->err:"+e.message)}return null}}]),t}(l.default);S.prototype.DOC_JOIN_CHANNEL_SUCCESS=S.DOC_JOIN_CHANNEL_SUCCESS="docServer.join.channel.success";var I=S;t.default=I;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(T,"loger","D:/work/McuClient/src/apes/DocApe.js"),__REACT_HOT_LOADER__.register(C,"itemIdx","D:/work/McuClient/src/apes/DocApe.js"),__REACT_HOT_LOADER__.register(S,"DocApe","D:/work/McuClient/src/apes/DocApe.js"),__REACT_HOT_LOADER__.register(I,"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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var 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(8),l=r(u),f=n(2),d=r(f),c=n(6),h=r(c),p=n(1),_=r(p),E=n(3),g=r(E),y=n(5),R=r(y),m=n(4),v=r(m),T=n(21),C=r(T),S=_.default.getLoger("VideoApe"),I=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,d.default.VIDEO_SESSION_ID,d.default.VIDEO_SESSION_NAME,d.default.VIDEO_SESSION_TAG));return e.mediaModule=new C.default,e.mediaModule.MEDIA_OBJ_TABLE_ID=d.default.VIDEO_OBJ_TABLE_ID,e.mediaModule.mediaChannels={},e.mediaModule.mediaType=d.default.MEDIA_TYPE_VIDEO,e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(h.default.RCPDU_REG_REGISTER_TABLE,d.default.VIDEO_OBJ_TABLE_ID,d.default.VIDEO_OBJ_TABLE_NAME,d.default.VIDEO_OBJ_TABLE_TAG,0,new ArrayBuffer),e.on(h.default.RCPDU_SEND_VIDEO_DATA_REQUEST,e.receiveVideoCommandHandler.bind(e)),e}return a(t,e),s(t,[{key:"onJoinChannelHandlerSuccess",value:function(){this.mediaModule.maxMediaChannel=R.default.maxVideoChannels}},{key:"getPlayVideoPath",value:function(e){return S.log("getPlayVideoPath"),this.mediaModule.getMediaPlayPath(e)}},{key:"getPublishVideoPath",value:function(e){if(S.log("获取推流地址->"),!this.mcu.connected)return S.warn(R.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};var t=this.mediaModule.getMediaPublishPath(e);return this._emit(g.default.VIDEO_GET_PUBLISH_PATH,t),t}},{key:"getAllChannelInfo",value:function(e){return S.log("获取当前所有频道信息->"),this.mediaModule.getAllMediaChannelInfo()}},{key:"publishVideo",value:function(e){if(!this.mcu.connected)return S.warn(R.default.getCurrentStatus()),this._emit(g.default.VIDEO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"已经断开连接!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"已经断开连接"};if(null==e||null==e.publishUrl)return S.warn("推流->参数错误",e),this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),this._emit(g.default.VIDEO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"参数错误!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"参数错误"};var t=this.mediaModule.getNeedPublishMediaChannel(e.publishUrl);if(null==t)return S.warn("推流->推流数据已经无效",e),this._emit(g.default.VIDEO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"推流数据已经无效!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"推流数据已经无效"};var n=this.mediaModule.getFreeMediaChannel();if(0==n)return S.warn("推流->不能再打开更多的设备 "),this._emit(g.default.VIDEO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"不能再打开更多的设备!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"不能再打开更多的设备",mediaChannels:this.mediaModule.mediaChannels};if(this.mediaModule.checkChannelIsOpening(t.channelId))return t.nodeId==R.default.nodeId?(S.warn(t.channelId,"已经推送过消息,不需要再次推送"),this._emit(g.default.VIDEO_PUBLISH_RESULT,{code:d.default.RETURN_SUCCESS,data:"已经推送过消息,不需要再次推送!",mediaId:t.channelId}),{code:d.default.RETURN_SUCCESS,data:"已经推送过消息,不需要再次推送!",mediaId:t.channelId}):(S.warn(t.channelId,"频道已经被占用"),this._emit(g.default.VIDEO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"频道已经被占用!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"频道已经被占用!",mediaChannels:this.mediaModule.mediaChannels});var r=this.mediaModule.getDefaultChannelInfo();return r.owner=R.default.nodeId,r.status=d.default.CHANNEL_STATUS_OPENING,r.channelId=t.channelId,r.streamId=t.streamId,r.timestamp=t.timestamp,r.mediaType=d.default.MEDIA_TYPE_VIDEO,this.sendTableUpdateHandler(r),this._emit(g.default.VIDEO_PUBLISH_RESULT,{code:d.default.RETURN_SUCCESS,data:"推流成功!",mediaId:t.channelId}),{code:d.default.RETURN_SUCCESS,data:"推流成功!",mediaId:t.channelId}}},{key:"stopPublishVideo",value:function(e){if(S.log("停止推流->",e),!this.mcu.connected)return S.warn(R.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};var t=R.default.nodeId;e&&parseInt(e.nodeId)>0&&(t=parseInt(e.nodeId));var n=0;e&&parseInt(e.mediaId)>0&&(n=parseInt(e.mediaId)),n>0?this._releaseChannelForNodeId(t,n):this._releaseNodeIdAllChannel(t)}},{key:"_releaseChannelForNodeId",value:function(e,t){S.log(e,"_releaseChannelForNodeId-->channelId",t);var n=this.mediaModule.mediaChannels[t];if(n&&n.status==d.default.CHANNEL_STATUS_OPENING)if(n.fromNodeId==e){var r=this.mediaModule.getDefaultChannelInfo();r.status=d.default.CHANNEL_STATUS_RELEASED,r.channelId=t,this.sendTableUpdateHandler(r)}else S.warn(t,"不属于nodeId",e,"不能释放",n);else S.warn(e,"要释放的channel不存在或者已经释放-->channelId",n)}},{key:"_releaseNodeIdAllChannel",value:function(e){if(S.log(e,"_releaseNodeIdAllChannel",this.mcu.connected),!this.mcu.connected)return clearTimeout(this.releaseTimeId),S.warn(R.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};var t=this.mediaModule.getOpeningMediaChannel(e);if(0==t)return S.warn(e,"没有占用channel不需要处理"),{code:d.default.RETURN_FAILED,data:"没有占用channel不需要处理"};var n=this.mediaModule.getDefaultChannelInfo();n.status=d.default.CHANNEL_STATUS_RELEASED,n.channelId=t,this.sendTableUpdateHandler(n),this.releaseTimeId=setTimeout(function(){S.warn(e,"检查频道是否占用"),this._releaseNodeIdAllChannel(e)}.bind(this),800)}},{key:"sendVideoBroadcastMsg",value:function(e){if(!this.mcu.connected)return S.warn(R.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};if(null===this._classInfo||v.default.isEmptyObject(this._classInfo))return S.log("不能发送Video消息.McuClient还未初始化数据!"),0==R.default.getCurrentStatus().code||1==R.default.getCurrentStatus().code?(this._emit(g.default.MCU_ERROR,g.default.ERR_APE_SEND_FAILED_NO_JOIN),{code:1,data:"不能发送Video消息.McuClient还未初始化数据"}):{code:d.default.RETURN_FAILED,data:"不能发送Video消息.McuClient还未初始化数据"};if(null==e)return S.warn("sendVideoCommandMsg失败,参数错误",e),this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),{code:d.default.RETURN_FAILED,data:"sendVideoCommandMsg失败,参数错误"};if(S.log("发送Video消息.",e),null!=e.actionType&&e.actionType==d.default.MEDIA_ACTION_OPEN_CAMERA){var t=this.mediaModule.getFreeMediaChannel();if(0==t)return S.warn("sendVideoCommandMsg,不能再打开更多的设备",e),{code:d.default.RETURN_FAILED,data:"不能再打开更多的设备",mediaChannels:this.mediaModule.mediaChannels}}var n=new h.default.RCVideoSendDataRequestPdu;n.type=h.default.RCPDU_SEND_VIDEO_DATA_REQUEST,n.isPublic=!0,n.fromNodeId=R.default.nodeId,n.toNodeId=parseInt(e.toNodeId)||0,n.actionType=parseInt(e.actionType)||d.default.MEDIA_ACTION_DEFAULT;var r="";try{r=JSON.stringify(e.data)}catch(t){S.warn("控制消息->JSON转换失败"),r=e.data}return n.data=this._rCArrayBufferUtil.strToUint8Array("h5"+r),n.isPublic||0==n.toNodeId?this.sendChatUniform(n):this.send(n),{code:d.default.RETURN_SUCCESS,data:""}}},{key:"sendTableUpdateHandler",value:function(e){S.log("video===sendTableUpdateHandler ");var t=this.packPdu(e,e.channelId);if(null==t)return void S.warn("sendTableUpdateHandler error,updateModelPdu=null");var n=new h.default.RCRegistryTableItemPdu;n.itemIdx=e.channelId,n.owner=e.owner,n.itemData=t.toArrayBuffer();var r=new h.default.RCRegistryTableUpdateItemPdu;r.type=h.default.RCPDU_REG_TABLE_UPDATE_PDU,r.items.push(n);var i=new h.default.RCRegistryUpdateObjPdu;i.objId=d.default.VIDEO_OBJ_TABLE_ID,i.subType=r.type,i.userData=r.toArrayBuffer();var o=new h.default.RCAdapterItemPdu;o.type=h.default.RCPDU_REG_UPDATE_OBJ,o.itemData=i.toArrayBuffer();var a=new h.default.RCAdapterPdu;a.type=h.default.RCPDU_REG_ADAPTER,a.item.push(o),S.log("发送更新VIDEO.itemIdx="+n.itemIdx),this.sendUniform(a,!0)}},{key:"receiveVideoCommandHandler",value:function(e){var t=h.default.RCVideoSendDataRequestPdu.decode(e);if(null==t)return void S.warn("视频控制消息处理,收到的消息为null,不做处理");t.data=this._rCArrayBufferUtil.uint8ArrayToStr(t.data,2);var n={};try{n=JSON.parse(t.data)}catch(e){S.warn("控制消息->JSON转换失败"),n=t.data}t.data=n,0!=t.toNodeId&&t.toNodeId!=R.default.nodeId?S.log("视频消息不处理 toNodeId=",t.toNodeId,"my nodeId=",R.default.nodeId):(S.log("视频控制消息处理 .",t),this._emit(g.default.VIDEO_BROADCAST,t))}},{key:"tableUpdateHandler",value:function(e,t,n,r){var i=this.unPackPdu(e,t,n);if(S.log("tableUpdateHandler->channel",t,"status->",i.status,"seek->",r),0==e&&(S.log("释放占用的频道,channel",t),i.status=d.default.CHANNEL_STATUS_RELEASED,i.streamId=""),this.mediaModule.mediaChannels[t]=i,i&&i.fromNodeId!=R.default.nodeId){var o={};if(o.mediaId=i.channelId,o.fromNodeId=i.fromNodeId,o.userName=i.userName||"",o.userRole=i.userRole||d.default.normal,i.status==d.default.CHANNEL_STATUS_OPENING){o.m3u8Url="",o.rtmpUrl="",o.replay="",o.seek=r||0;var a=this.mediaModule.getMediaPlayPath({type:"m3u8",streamId:i.streamId}),s=this.mediaModule.getMediaPlayPath({type:"rtmp",streamId:i.streamId}),u=this.mediaModule.getMediaRecordPlaybackPath({type:"m3u8",streamId:i.streamId});0==a.code&&(o.m3u8Url=a.playUrl),0==s.code&&(o.rtmpUrl=s.playUrl),0==u.code&&(o.replay=u.playUrl),S.log("VIDEO_PLAY",o),this._emit(g.default.VIDEO_PLAY,o)}else S.log("VIDEO_STOP",o),this._emit(g.default.VIDEO_STOP,o)}else S.warn("视频消息是自己发送的或者是视频消息无效,不需要处理,消息内容如下:"),S.log(i),i.status==d.default.CHANNEL_STATUS_OPENING?(R.default.openCamera=v.default.creatTimestamp(),R.default.openMicrophones=R.default.openCamera):(R.default.openCamera=0,R.default.openMicrophones=0),this._emit(g.default.USER_DEVICE_STATUS_CHAANGE,{nodeId:R.default.nodeId,userRole:R.default.userRole,userName:R.default.userName,userId:R.default.userId,openCamera:R.default.openCamera,openMicrophones:R.default.openMicrophones});this._emit(g.default.VIDEO_UPDATE,i)}},{key:"packPdu",value:function(e,t){if(S.log("packPdu "),null==e||null==t)return this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),null;var n=new h.default.RCVideoChannelInfoPdu;return n.status=e.status||d.default.CHANNEL_STATUS_RELEASED,n.channelId=t,n.streamId=e.streamId||"",n.siteId=e.siteId||R.default.siteId,n.classId=parseInt(e.classId)||parseInt(R.default.classId),n.userId=e.userId||"0",n.mediaType=e.mediaType||d.default.MEDIA_TYPE_VIDEO,n.timestamp=e.timestamp||0,n.fromNodeId=R.default.nodeId,n.userName=R.default.userName||"",n.toNodeId=0,n.userRole=R.default.userRole||d.default.normal,S.log(n),n}},{key:"unPackPdu",value:function(e,t,n){if(S.log("unPackPdu->owner:",e,"itemIdx->",t),null==e||null==t||null==n)return this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),null;try{var r=h.default.RCVideoChannelInfoPdu.decode(n);return S.log(r),r}catch(e){S.log("unPackPdu error,itemIdx="+t+" err:"+e.message)}return null}}]),t}(l.default),A=I;t.default=A;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(S,"loger","D:/work/McuClient/src/apes/VideoApe.js"),__REACT_HOT_LOADER__.register(I,"VideoApe","D:/work/McuClient/src/apes/VideoApe.js"),__REACT_HOT_LOADER__.register(A,"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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var 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(8),l=r(u),f=n(2),d=r(f),c=n(6),h=r(c),p=n(1),_=r(p),E=n(3),g=r(E),y=(n(31),n(14)),R=(r(y),n(5)),m=r(R),v=n(4),T=r(v),C=_.default.getLoger("WhiteBoardApe"),S=0,I=0,A=1,b=2,w=3,D=4,P=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,d.default.WHITEBOARD_SESSION_ID,d.default.WHITEBOARD_SESSION_NAME,d.default.WHITEBOARD_SESSION_TAG));return e.annoInfos={},e.insertHistory=[],e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(h.default.RCPDU_REG_REGISTER_TABLE,d.default.WHITEBOARD_OBJ_TABLE_ID,d.default.WHITEBOARD_OBJ_TABLE_NAME,d.default.WHITEBOARD_OBJ_TABLE_TAG,0,new ArrayBuffer),e.on(h.default.RCPDU_SESSION_JOIN_RESPONSE,e._joinSessionHandler.bind(e)),e}return a(t,e),s(t,[{key:"_joinSessionHandler",value:function(e){C.log("RCPDU_SESSION_JOIN_RESPONSE"),this.insertHistory=[]}},{key:"clearData",value:function(){C.log("clearData->"),this.annoInfos={},this.insertHistory=[]}},{key:"updaterRecordStatus",value:function(e){if(m.default.isHost&&!m.default.isRecordPlayBack){var t={};for(var n in this.annoInfos){var r=this.annoInfos[n];r&&r.parentId==m.default.activeDocId&&r.curPageNo==m.default.activeDocCurPage&&(t[n]=r)}Object.keys(t).length>0?(C.log("开启录制成功->更新当前的标注数据->docId:",m.default.activeDocId,"page:",m.default.activeDocCurPage),this.sendUpdaterAnnotaion({itemIdxArr:t})):C.log("开启录制成功->当前没有标注数据需要更新->docId:",m.default.activeDocId,"page:",m.default.activeDocCurPage)}}},{key:"sendInsetAnnotaion",value:function(e){if(null==e||T.default.isEmptyObject(e))return C.warn("添加标注失败->参数错误->",e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG);S=T.default.creatSoleNumberFromTimestamp();var t=this.packPdu(e,S);if(null==t)return C.warn("添加标注失败-->参数错误->",e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG);this.insertHistory.push(t);var n=new h.default.RCRegistryTableItemPdu;n.itemIdx=S,n.registerObjId=d.default.WHITEBOARD_OBJ_TABLE_ID,n.owner=0,n.itemData=t.toArrayBuffer();var r=new h.default.RCRegistryTableInsertItemPdu;r.type=h.default.RCPDU_REG_TABLE_INSERT_PDU,r.items.push(n);var i=new h.default.RCRegistryUpdateObjPdu;i.objId=d.default.WHITEBOARD_OBJ_TABLE_ID,i.subType=r.type,i.userData=r.toArrayBuffer();var o=new h.default.RCAdapterItemPdu;o.type=h.default.RCPDU_REG_UPDATE_OBJ,o.itemData=i.toArrayBuffer();var a=new h.default.RCAdapterPdu;a.type=h.default.RCPDU_REG_ADAPTER,a.item.push(o),C.log("添加标注->itemIdx="+n.itemIdx),this.sendUniform(a,!0)}},{key:"sendGotoPrev",value:function(){if(C.log("撤销上一步"),null==this.insertHistory||this.insertHistory.length<1)return void C.warn("无法继续上一步操作,已经没有可以撤销的数据");var e=this.insertHistory.pop();if(e){var t={};t[e.itemIdx]=e,this.sendDeleteAnnotaion({itemIdxArr:t})}}},{key:"sendDeleteCurPageAnnotation",value:function(e){this.insertHistory=[];var t={};for(var n in this.annoInfos){var r=this.annoInfos[n];r&&r.parentId==m.default.activeDocId&&r.curPageNo==m.default.activeDocCurPage&&(t[n]=r)}this.sendDeleteAnnotaion({itemIdxArr:t})}},{key:"sendDeleteAllAnnotation",value:function(e){this.insertHistory=[],this.sendDeleteAnnotaion({itemIdxArr:this.annoInfos})}},{key:"sendDeleteAnnotaion",value:function(e){if(null==e||null==e.itemIdxArr)return void C.warn("要删除的数据不存在->",e);var t=new h.default.RCAdapterPdu;t.type=h.default.RCPDU_REG_ADAPTER;for(var n in e.itemIdxArr){var r=new h.default.RCRegistryTableDeleteItemPdu;r.type=h.default.RCPDU_REG_TABLE_DELETE_PDU,r.itemIdx=parseInt(n);var i=new h.default.RCRegistryUpdateObjPdu;i.objId=d.default.WHITEBOARD_OBJ_TABLE_ID,i.subType=r.type,i.userData=r.toArrayBuffer();var o=new h.default.RCAdapterItemPdu;o.type=h.default.RCPDU_REG_UPDATE_OBJ,o.itemData=i.toArrayBuffer(),t.item.push(o)}C.log("发送删除白板标注数据->长度:"+t.item.length),this.sendUniform(t,!0)}},{key:"sendUpdaterAnnotaion",value:function(e){if(null==e||null==e.itemIdxArr)return C.log("更新标注数据->失败->参数错误"),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG);var t=new h.default.RCAdapterPdu;t.type=h.default.RCPDU_REG_ADAPTER;for(var n in e.itemIdxArr){var r=parseInt(n),i=e.itemIdxArr[n],o=this.packPdu(i,r);if(null!=o){var a=new h.default.RCRegistryTableItemPdu;a.itemIdx=r,a.owner=0,a.registerObjId=d.default.WHITEBOARD_OBJ_TABLE_ID,a.itemData=o.toArrayBuffer();var s=new h.default.RCRegistryTableUpdateItemPdu;s.type=h.default.RCPDU_REG_TABLE_UPDATE_PDU,s.items.push(a);var u=new h.default.RCRegistryUpdateObjPdu;u.objId=d.default.WHITEBOARD_OBJ_TABLE_ID,u.subType=s.type,u.userData=s.toArrayBuffer();var l=new h.default.RCAdapterItemPdu;l.type=h.default.RCPDU_REG_UPDATE_OBJ,l.itemData=u.toArrayBuffer(),t.item.push(l)}else C.log("更新标注数据->失败->数据无效"),this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG)}var f=t.item.length;f>0?(C.log("更新标注数据->发送数量->",t.item.length),this.sendUniform(t,!0)):C.log("更新标注数据->没有可更新的数据")}},{key:"tableInsertHandler",value:function(e,t,n){var r=this.unPackPdu(e,t,n);C.log("tableInsertHandler","activeDocId->",m.default.activeDocId,"parentId->",r.parentId),C.log(r),r&&m.default.activeDocId==r.parentId&&m.default.activeDocCurPage==r.curPageNo&&this.insertAandShowAnnotaion(r)}},{key:"tableUpdateHandler",value:function(e,t,n){}},{key:"tableUpdateApeHandler",value:function(e,t){var n=e.length;C.log("白板标注更新->","activeDocId->",m.default.activeDocId,"数量->",n);for(var r=0;r<n;++r){var i=e[r];this.unPackPdu(i.owner,i.itemIdx,i.itemData)}this.updateAandShowAnnotaion()}},{key:"tableDeleteHandler",value:function(e,t){if(C.log("删除白板数据->",e,t),t&&t.itemIdx)for(var n=t.itemIdx.length,r=t.itemIdx,i=0;i<n;i++)this.annoInfos[r[i]]&&(C.log("删除白板数据:",r[i]),delete this.annoInfos[r[i]]);this.updateAandShowAnnotaion()}},{key:"docUpdateHandler",value:function(e){C.log("白板收到文档更新的消息"),e.action!=d.default.DOC_ACTION_SWITCH_DOC&&e.action!=d.default.DOC_ACTION_SWITCH_PAGE||(this.insertHistory=[]),this.updateAandShowAnnotaion()}},{key:"docDeleteHandler",value:function(e){C.log("白板收到文档删除的消息->",e);for(var t in this.annoInfos){var n=this.annoInfos[t];n&&n.parentId==e&&(C.log("文档删除->白板数据也删除,itemIdx:"+t,"_parentId:",e),this.sendDeleteAnnotaion({itemIdx:t}))}0==m.default.activeDocId&&(this.insertHistory=[],this.updateAandShowAnnotaion())}},{key:"insertAandShowAnnotaion",value:function(e){var t=[e],n={isFresh:!1,annotaionItems:t};C.log("新增一条标注数据->显示到界面"),this._emit(g.default.WHITEBOARD_ANNOTATION_UPDATE,n)}},{key:"updateAandShowAnnotaion",value:function(){var e=[];for(var t in this.annoInfos){var n=this.annoInfos[t];n&&n.parentId==m.default.activeDocId&&n.curPageNo==m.default.activeDocCurPage&&e.push(n)}var r={isFresh:!0,annotaionItems:e};C.log("清除当前显示的标注---->重绘标注数量--->",e.length,"当前文档信息--->DocId->",m.default.activeDocId,"curPageNo->",m.default.activeDocCurPage),this._emit(g.default.WHITEBOARD_ANNOTATION_UPDATE,r)}},{key:"packPdu",value:function(e,t){if(null==e.pointGroup||e.pointGroup.length<1)return this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),null;var n=new h.default.RCWhiteBoardDataModelPdu;switch(e.type){case I:break;case A:break;case b:break;case w:n.radius=parseInt(e.radius);break;case D:n.fontSize=parseInt(e.fontSize),n.fontName=e.fontName||null,n.text=e.text||null;break;default:return null}return n.type=e.type,n.itemIdx=t,n.initiator=m.default.nodeId,n.parentId=m.default.activeDocId,n.curPageNo=m.default.activeDocCurPage,n.pointGroup=T.default.arrayToJsonString(e.pointGroup),n.color=e.color||"#000000",n.thickness=e.thickness||1,n}},{key:"unPackPdu",value:function(e,t,n){try{C.log("白板标注数据->unPackPdu");var r=h.default.RCWhiteBoardDataModelPdu.decode(n),i=T.default.arrayFromJsonString(r.pointGroup);return r.pointGroup=i,this.annoInfos[t]=r,r}catch(e){C.log("白板标注数据->unPackPdu->Pdu解析错误,itemIdx="+t+" err:"+e.message)}return null}}]),t}(l.default),O=P;t.default=O;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(C,"loger","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(S,"itemIdx","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(I,"TYPE_BIGHT","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(A,"TYPE_LINE","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(b,"TYPE_RECT","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(w,"TYPE_CIRCLE","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(D,"TYPE_TEXT","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(P,"WhiteBoardApe","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(O,"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")}Object.defineProperty(t,"__esModule",{value:!0});var o=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}}(),a=n(1),s=r(a),u=n(2),l=(r(u),n(4)),f=(r(l),s.default.getLoger("Server")),d=function(){function e(){i(this,e)}return o(e,null,[{key:"serverList",get:function(){return{MS:{},MCU:{}}}}]),e}(),c=d;t.default=c;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(f,"loger","D:/work/McuClient/src/config/Server.js"),__REACT_HOT_LOADER__.register(d,"Server","D:/work/McuClient/src/config/Server.js"),__REACT_HOT_LOADER__.register(c,"default","D:/work/McuClient/src/config/Server.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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var 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(7),l=r(u),f=n(1),d=r(f),c=d.default.getLoger("EverSocket"),h=4,p=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.reConnectionCounter=0,e}return a(t,e),s(t,[{key:"begin",value:function(e,t){this._clearHistory(),c.log("开始WebSocket应用."),this._enableEverSocket=!0,this.wsURL="ws://"+e+":"+t,this._newConnection()}},{key:"end",value:function(){c.log("停止WebSocket应用."),this._clear()}},{key:"switchSocketIp",value:function(e,t){t?this.wsURL="ws://"+e+":"+t:this.wsURL="ws://"+e}},{key:"send",value:function(e){this._connected?(e?c.log("SEND MESSAGE-->byteLength->",e.byteLength):c.log("SEND MESSAGE---->"),this.websocket.send(e)):c.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(),window.clearTimeout(this.reConnectionTimeout),this.reConnectionCounter++,this.reConnectionCounter>h&&(c.warn("MCU断线重连->已经达到最大重连次数!"),this._emit(t.ERROR,t.ERR_SOCKET_RECONNECT_FAILED),this.reConnectionCounter=0),this.reConnectionTimeout=window.setTimeout(function(){c.log("MCU断线重连->",e.reConnectionCounter),window.clearTimeout(e.reConnectionTimeout),e._newConnection()},t.RECONN_INTERVAL)}},{key:"_clear",value:function(){if(c.log("WebSocket,Timers销毁"),window.clearInterval(this.pingTimer),window.clearInterval(this.pongTimer),window.clearInterval(this.reConnectionTimeout),this._setConnected(!1),this._enableEverSocket=!1,null==this.websocket)return void c.log("WebSocket,Timers已经销毁");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){c.log("ignore errors")}this.websocket=void 0}},{key:"_clearHistory",value:function(){if(c.log("WebSocket->清除记录"),window.clearInterval(this.pingTimer),window.clearInterval(this.pongTimer),window.clearInterval(this.reConnectionTimeout),this._connected=!1,this._enableEverSocket=!1,null==this.websocket)return void c.log("WebSocket->已经销毁");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){c.log("ignore errors")}this.websocket=void 0}},{key:"_onOpen",value:function(){c.log("WebSocket建立成功",this.wsURL),this.reConnectionCounter=0,this.pingTimer=window.setInterval(this._sendPingHandler.bind(this),t.PING_INTERVAL),this.pongTimer=window.setInterval(this._checkPongHandler.bind(this),t.PONG_INTERVAL),this._setConnected()}},{key:"_onClose",value:function(e){c.log("WebSocket连接断开 CODE:"+e.code+" REASON:"+e.reason+" CLEAN: "+e.wasClean,this.wsURL),this._reConnection()}},{key:"_onError",value:function(){c.log("WebSocket错误出现"),this._connected=!1,this._reConnection()}},{key:"_onMessage",value:function(e){this._lastActiveTime=Date.now();var n=e.data;c.log("RECEIVE MESSAGE-->byteLength->",n.byteLength),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||(c.warn("---服务器PINGPONG超时-----"),this._reConnection())}},{key:"connected",get:function(){return this._connected}}]),t}(l.default);p.prototype.PONG_INTERVAL=p.PONG_INTERVAL=21e3,p.prototype.PING_INTERVAL=p.PING_INTERVAL=1e4,p.prototype.RECONN_INTERVAL=p.RECONN_INTERVAL=5e3,p.prototype.ERR_SOCKET_RECONNECT_FAILED=p.ERR_SOCKET_RECONNECT_FAILED=20001,p.prototype.CONNECTING=p.CONNECTING=0,p.prototype.OPEN=p.OPEN=1,p.prototype.CLOSING=p.CLOSING=2,p.prototype.CLOSED=p.CLOSED=3,p.prototype.MESSAGE=p.MESSAGE=4,p.prototype.ERROR=p.ERROR=5;var _=new p;t.default=_;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(c,"loger","D:/work/McuClient/src/everSocket.js"),__REACT_HOT_LOADER__.register(h,"MCU_MAX_RECONNECTION","D:/work/McuClient/src/everSocket.js"),__REACT_HOT_LOADER__.register(p,"EverSocket","D:/work/McuClient/src/everSocket.js"),__REACT_HOT_LOADER__.register(_,"default","D:/work/McuClient/src/everSocket.js"))})()},function(e,t,n){var r,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(a,s){i=[n(16)],r=s,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(e.exports=o))}(void 0,function(e){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("")+l.apply(String,e):(1024<e.length+arguments.length&&(t.push(l.apply(String,e)),e.length=0),void Array.prototype.push.apply(e,arguments))}}function r(e,t,n,r,i){var o;o=8*i-r-1;var a=(1<<o)-1,s=a>>1,u=-7;i=n?i-1:0;var l=n?-1:1,f=e[t+i];for(i+=l,n=f&(1<<-u)-1,f>>=-u,u+=o;0<u;n=256*n+e[t+i],i+=l,u-=8);for(o=n&(1<<-u)-1,n>>=-u,u+=r;0<u;o=256*o+e[t+i],i+=l,u-=8);if(0===n)n=1-s;else{if(n===a)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),n-=s}return(f?-1:1)*o*Math.pow(2,n-r)}function i(e,t,n,r,i,o){var a,s=8*o-i-1,u=(1<<s)-1,l=u>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0;o=r?0:o-1;var d=r?1:-1,c=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(t=isNaN(t)?1:0,r=u):(r=Math.floor(Math.log(t)/Math.LN2),1>t*(a=Math.pow(2,-r))&&(r--,a*=2),t=1<=r+l?t+f/a:t+f*Math.pow(2,1-l),2<=t*a&&(r++,a/=2),r+l>=u?(t=0,r=u):1<=r+l?(t=(t*a-1)*Math.pow(2,i),r+=l):(t=t*Math.pow(2,l-1)*Math.pow(2,i),r=0));8<=i;e[n+o]=255&t,o+=d,t/=256,i-=8);for(r=r<<i|t,s+=i;0<s;e[n+o]=255&r,o+=d,r/=256,s-=8);e[n+o-d]|=128*c}var o=function e(t,n,r){if("undefined"==typeof t&&(t=e.DEFAULT_CAPACITY),"undefined"==typeof n&&(n=e.DEFAULT_ENDIAN),"undefined"==typeof r&&(r=e.DEFAULT_NOASSERT),!r){if(t|=0,0>t)throw RangeError("Illegal capacity");n=!!n,r=!!r}this.buffer=0===t?u:new ArrayBuffer(t),this.view=0===t?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=t,this.littleEndian=n,this.noAssert=r};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;Object.defineProperty(s,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var u=new ArrayBuffer(0),l=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,a=0,s=0,u=e.length;s<u;++s)o.isByteBuffer(e[s])||(e[s]=o.wrap(e[s],t)),i=e[s].limit-e[s].offset,0<i&&(a+=i);if(0===a)return new o(0,n,r);for(t=new o(a,n,r),s=0;s<u;)n=e[s++],i=n.limit-n.offset,0>=i||(t.view.set(n.view.subarray(n.offset,n.limit),t.offset),t.offset+=i);return t.limit=t.offset,t.offset=0,t},o.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},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"!==("undefined"==typeof e?"undefined":a(e)))throw TypeError("Illegal buffer");if(o.isByteBuffer(e))return t=s.clone.call(e),t.markedOffset=-1,t;if(e instanceof Uint8Array)t=new o(0,n,r),0<e.length&&(t.buffer=e.buffer,t.offset=e.byteOffset,t.limit=e.byteOffset+e.byteLength,t.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)t=new o(0,n,r),0<e.byteLength&&(t.buffer=e,t.offset=0,t.limit=e.byteLength,t.view=0<e.byteLength?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");for(t=new o(e.length,n,r),t.limit=e.length,n=0;n<e.length;++n)t.view[n]=e[n]}return t},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||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,i=t,o=e.length,a=o>>3,s=0;for(t+=this.writeVarint32(o,t);a--;)r=1&!!e[s++]|(1&!!e[s++])<<1|(1&!!e[s++])<<2|(1&!!e[s++])<<3|(1&!!e[s++])<<4|(1&!!e[s++])<<5|(1&!!e[s++])<<6|(1&!!e[s++])<<7,this.writeByte(r,t++);if(s<o){for(r=a=0;s<o;)r|=(1&!!e[s++])<<a++;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=this.readVarint32(e),r=n.value,i=r>>3,o=0,a=[];for(e+=n.length;i--;)n=this.readByte(e++),a[o++]=!!(1&n),a[o++]=!!(2&n),a[o++]=!!(4&n),a[o++]=!!(8&n),a[o++]=!!(16&n),a[o++]=!!(32&n),a[o++]=!!(64&n),a[o++]=!!(128&n);if(o<r)for(i=0,n=this.readByte(e++);o<r;)a[o++]=!!(n>>i++&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||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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||0!==e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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),this.view[t-1]=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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return e=this.view[e],128===(128&e)&&(e=-(255-e+1)),t&&(this.offset+=1),e},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||0!==e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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),this.view[t-1]=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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return e=this.view[e],t&&(this.offset+=1),e},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||0!==e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||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||0!==e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||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||0!==e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||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),0|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||0!==e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||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||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||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 i=t.low,o=t.high;return 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,n+=4,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):(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,n+=4,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),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||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=0,i=0;return 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),t=new e(r,i,!1),n&&(this.offset+=8),t},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||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||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 i=t.low,o=t.high;return 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,n+=4,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):(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,n+=4,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),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||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=0,i=0;return 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),t=new e(r,i,!0),n&&(this.offset+=8),t},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||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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),i(this.view,e,t-4,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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return e=r(this.view,e,this.littleEndian,23,4),t&&(this.offset+=4),e},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||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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),i(this.view,e,t-8,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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}return e=r(this.view,e,this.littleEndian,52,8),t&&(this.offset+=8),e},s.readDouble=s.readFloat64,o.MAX_VARINT32_BYTES=5,o.calculateVarint32=function(e){return e>>>=0,128>e?1:16384>e?2:2097152>e?3:268435456>e?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||0!==e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,i=o.calculateVarint32(e);for(t+=i,r=this.buffer.byteLength,t>r&&this.resize((r*=2)>t?r:t),t-=i,e>>>=0;128<=e;)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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||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)throw e=Error("Truncated"),e.truncated=!0,e;n=this.view[e++],5>r&&(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){return e=this.readVarint32(e),"object"===("undefined"==typeof e?"undefined":a(e))?e.value=o.zigZagDecode32(e.value):e=o.zigZagDecode32(e),e},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;return t=t.shiftRightUnsigned(56).toInt()>>>0,0==t?0==r?16384>n?128>n?1:2:2097152>n?3:4:16384>r?128>r?5:6:2097152>r?7:8:128>t?9:10},o.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(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):!1!==t.unsigned&&(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||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||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):!1!==t.unsigned&&(t=t.toSigned());var i=o.calculateVarint64(t),a=t.toInt()>>>0,s=t.shiftRightUnsigned(28).toInt()>>>0,u=t.shiftRightUnsigned(56).toInt()>>>0;n+=i;var l=this.buffer.byteLength;switch(n>l&&this.resize((l*=2)>n?l: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?s>>>21|128:s>>>21&127;case 7:this.view[n+6]=7!==i?s>>>14|128:s>>>14&127;case 6:this.view[n+5]=6!==i?s>>>7|128:s>>>7&127;case 5:this.view[n+4]=5!==i?128|s:127&s;case 4:this.view[n+3]=4!==i?a>>>21|128:a>>>21&127;case 3:this.view[n+2]=3!==i?a>>>14|128:a>>>14&127;case 2:this.view[n+1]=2!==i?a>>>7|128:a>>>7&127;case 1:this.view[n]=1!==i?128|a:127&a}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||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r=t,i=0,o=0,a=0,s=0,s=this.view[t++],i=127&s;if(128&s&&(s=this.view[t++],i|=(127&s)<<7,128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],i|=(127&s)<<14,128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],i|=(127&s)<<21,128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],o=127&s,128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],o|=(127&s)<<7,128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],o|=(127&s)<<14,128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],o|=(127&s)<<21,128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],a=127&s,128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],a|=(127&s)<<7,128&s||this.noAssert&&"undefined"==typeof s))throw Error("Buffer overrun");return i=e.fromBits(i|o<<28,o>>>4|a<<24,!1),n?(this.offset=t,i):{value:i,length:t-r}},s.readVarint64ZigZag=function(t){return(t=this.readVarint64(t))&&t.value instanceof e?t.value=o.zigZagDecode64(t.value):t=o.zigZagDecode64(t),t}),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||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return o=d.calculateUTF16asUTF8(t(e))[1],n+=o+1,i=this.buffer.byteLength,n>i&&this.resize((i*=2)>n?i:n),n-=o+1,d.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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,i=e,o=-1;return d.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||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,o=n;i=d.calculateUTF16asUTF8(t(e),this.noAssert)[1],n+=4+i;var a=this.buffer.byteLength;if(n>a&&this.resize((a*=2)>n?a: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,d.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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=e,r=this.readUint32(e),r=this.readUTF8String(r,o.METRICS_BYTES,e+=4);return e+=r.length,t?(this.offset=e,r.string):{string:r.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||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,o=n;i=d.calculateUTF16asUTF8(t(e))[1],n+=i;var a=this.buffer.byteLength;return n>a&&this.resize((a*=2)>n?a:n),n-=i,d.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 d.calculateUTF16asUTF8(t(e))[0]},o.calculateUTF8Bytes=function(e){return d.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||0!==e%1)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||0!==r%1)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,0>r||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var a,s=0,u=r;if(t===o.METRICS_CHARS){if(a=n(),d.decodeUTF8(function(){return s<e&&r<this.limit?this.view[r++]:null}.bind(this),function(e){++s,d.UTF8toUTF16(e,a)}),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return i?(this.offset=r,a()):{string:a(),length:r-u}}if(t===o.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||0!==r%1)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,0>r||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}var l=r+e;if(d.decodeUTF8toUTF16(function(){return r<l?this.view[r++]:null}.bind(this),a=n(),this.noAssert),r!==l)throw RangeError("Illegal range: Truncated data, "+r+" == "+l);return i?(this.offset=r,a()):{string:a(),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||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,a,s=n;i=d.calculateUTF16asUTF8(t(e),this.noAssert)[1],a=o.calculateVarint32(i),n+=a+i;var u=this.buffer.byteLength;if(n>u&&this.resize((u*=2)>n?u:n),n-=a+i,n+=this.writeVarint32(i,n),d.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==s+i+a)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+i+a));return r?(this.offset=n,this):n-s},s.readVString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=e,r=this.readVarint32(e),r=this.readUTF8String(r.value,o.METRICS_BYTES,e+=r.length);return e+=r.length,t?(this.offset=e,r.string):{string:r.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||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(e instanceof o||(e=o.wrap(e,t)),t=e.limit-e.offset,0>=t)return this;n+=t;var i=this.buffer.byteLength;return n>i&&this.resize((i*=2)>n?i:n),n-=t,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=t,r&&(this.offset+=t),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||0!==e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||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=u,this.view=null,0<=this.markedOffset&&(this.markedOffset-=e),this.limit=this.offset=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,0<=this.markedOffset&&(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||0!==e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||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,0<=r.markedOffset&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},s.copyTo=function(e,t,n,r){var i,a;if(!this.noAssert&&!o.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(a="undefined"==typeof t)?e.offset:0|t,n=(i="undefined"==typeof n)?this.offset:0|n,r="undefined"==typeof r?this.limit:0|r,0>t||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(0>n||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);var s=r-n;return 0===s?e:(e.ensureCapacity(t+s),e.view.set(this.view.subarray(n,r),t),i&&(this.offset+=s),a&&(e.offset+=s),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&&0<e.length&&(e=e.charCodeAt(0)),"undefined"==typeof t&&(t=this.offset),"undefined"==typeof n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||0!==e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||0!==n%1)throw TypeError("Illegal end: Not an integer");if(n>>>=0,0>t||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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||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||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(e instanceof o||(e=o.wrap(e,t)),t=e.limit-e.offset,0>=t)return this;var i=t-n;if(0<i){var a=new ArrayBuffer(this.buffer.byteLength+i),s=new Uint8Array(a);s.set(this.view.subarray(n,this.buffer.byteLength),t),this.buffer=a,this.view=s,this.offset+=i,0<=this.markedOffset&&(this.markedOffset+=i),this.limit+=i,n+=i}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),n-t),e.offset=e.limit, -r&&(this.offset-=t),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 0<=this.markedOffset?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},s.resize=function(e){if(!this.noAssert){if("number"!=typeof e||0!==e%1)throw TypeError("Illegal capacity: "+e+" (not an integer)");if(e|=0,0>e)throw RangeError("Illegal capacity: 0 <= "+e)}if(this.buffer.byteLength<e){e=new ArrayBuffer(e);var t=new Uint8Array(e);t.set(this.view),this.buffer=e,this.view=t}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||0!==e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||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||0!==e%1)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(0>t||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||0!==e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||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||0!==t%1)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof n||0!==n%1)throw TypeError("Illegal limit: Not an integer");if(n>>>=0,0>t||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}return e||0!==t||n!==this.buffer.byteLength?t===n?u:(e=new ArrayBuffer(n-t),new Uint8Array(e).set(new Uint8Array(this.buffer).subarray(t,n),0),e):this.buffer},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&&(n=t=e="utf8"),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,a;null!==(i=e());)if(o=n[i],"undefined"==typeof o&&r(i),null!==(i=e())&&(a=n[i],"undefined"==typeof a&&r(i),t(o<<2>>>0|(48&a)>>4),null!==(i=e()))){if(o=n[i],"undefined"==typeof o){if(61===i)break;r(i)}if(t((15&a)<<4>>>0|(60&o)>>2),null!==(i=e())){if(a=n[i],"undefined"==typeof a){if(61===i)break;r(i)}t((3&o)<<6>>>0|a)}}},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,0>e||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,0>e||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var n=[],r=[];e<t;)n.push(this.view[e++]),1024<=n.length&&(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,a=new o(i,t);r<i;){if(n=e.charCodeAt(r),255<n)throw RangeError("illegal char code: "+n);a.view[r++]=n}return a.limit=i,a},s.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",o="",a="";n<r;){if(-1!==n&&(t=this.view[n],i=16>t?i+("0"+t.toString(16).toUpperCase()):i+t.toString(16).toUpperCase(),e&&(o+=32<t&&127>t?String.fromCharCode(t):".")),++n,e&&0<n&&0===n%16&&n!==r){for(;51>i.length;)i+=" ";a+=i+o+"\n",i=o=""}i=n===this.offset&&n===this.limit?i+(n===this.markedOffset?"!":"|"):n===this.offset?i+(n===this.markedOffset?"[":"<"):n===this.limit?i+(n===this.markedOffset?"]":">"):i+(n===this.markedOffset?"'":e||0!==n&&n!==r?" ":"")}if(e&&" "!==i){for(;51>i.length;)i+=" ";a+=i+o+"\n"}return e?a:i},o.fromDebug=function(e,t,n){var r=e.length;t=new o((r+1)/3|0,t,n);for(var i,a=0,s=0,u=!1,l=!1,f=!1,d=!1,c=!1;a<r;){switch(i=e.charAt(a++)){case"!":if(!n){if(l||f||d){c=!0;break}l=f=d=!0}t.offset=t.markedOffset=t.limit=s,u=!1;break;case"|":if(!n){if(l||d){c=!0;break}l=d=!0}t.offset=t.limit=s,u=!1;break;case"[":if(!n){if(l||f){c=!0;break}l=f=!0}t.offset=t.markedOffset=s,u=!1;break;case"<":if(!n){if(l){c=!0;break}l=!0}t.offset=s,u=!1;break;case"]":if(!n){if(d||f){c=!0;break}d=f=!0}t.limit=t.markedOffset=s,u=!1;break;case">":if(!n){if(d){c=!0;break}d=!0}t.limit=s,u=!1;break;case"'":if(!n){if(f){c=!0;break}f=!0}t.markedOffset=s,u=!1;break;case" ":u=!1;break;default:if(!n&&u){c=!0;break}if(i=parseInt(i+e.charAt(a++),16),!n&&(isNaN(i)||0>i||255<i))throw TypeError("Illegal str: Not a debug encoded string");t.view[s++]=i,u=!0}if(c)throw TypeError("Illegal str: Invalid symbol at "+a)}if(!n){if(!l||!d)throw TypeError("Illegal str: Missing offset or limit");if(s<t.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+s+" < "+r)}return t},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||0!==e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var n,r=Array(t-e);e<t;)n=this.view[e++],16>n?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(0!==e.length%2)throw TypeError("Illegal str: Length not a multiple of 2")}var r=e.length;t=new o(r/2|0,t);for(var i,a=0,s=0;a<r;a+=2){if(i=parseInt(e.substring(a,a+2),16),!n&&(!isFinite(i)||0>i||255<i))throw TypeError("Illegal str: Contains non-hex characters");t.view[s++]=i}return t.limit=s,t};var d=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)128>n?t(127&n):(2048>n?t(n>>6&31|192):(65536>n?t(n>>12&15|224):(t(n>>18&7|240),t(n>>12&63|128)),t(n>>6&63|128)),t(63&n|128)),n=null},decodeUTF8:function(e,t){for(var n,r,i,o,a=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())&&a([n,r]),t((31&n)<<6|63&r);else if(224===(240&n))null!==(r=e())&&null!==(i=e())||a([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())||a([n,r,i,o]),t((7&n)<<18|(63&r)<<12|(63&i)<<6|63&o)}},UTF16toUTF8:function(e,t){for(var n,r=null;null!==(n=null!==r?r:e());)55296<=n&&57343>=n&&null!==(r=e())&&56320<=r&&57343>=r?(t(1024*(n-55296)+r-56320+65536),r=null):t(n);null!==r&&t(r)},UTF8toUTF16:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)65535>=n?t(n):(n-=65536,t((n>>10)+55296),t(n%1024+56320)),n=null},encodeUTF16toUTF8:function(t,n){e.UTF16toUTF8(t,function(t){e.encodeUTF8(t,n)})},decodeUTF8toUTF16:function(t,n){e.decodeUTF8(t,function(t){e.UTF8toUTF16(t,n)})},calculateCodePoint:function(e){return 128>e?1:2048>e?2:65536>e?3:4},calculateUTF8:function(e){for(var t,n=0;null!==(t=e());)n+=128>t?1:2048>t?2:65536>t?3:4;return n},calculateUTF16asUTF8:function(t){var n=0,r=0;return e.UTF16toUTF8(t,function(e){++n,r+=128>e?1:2048>e?2:65536>e?3:4}),[n,r]}};return 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||0!==e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;try{d.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(d.calculateUTF16asUTF8(t(e),!0)[1],n,r),a=0;return d.encodeUTF16toUTF8(t(e),function(e){i.view[a++]=e}),i.limit=a,i},o});(function(){"undefined"==typeof __REACT_HOT_LOADER__})()},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 RCPDU_CONFERENCE_RECORD_REQUEST = 270;\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\n\n\n //new data\n RCPDU_SEND_CONFERENCE_DATA_REQUEST =500;\n RCPDU_SEND_VIDEO_DATA_REQUEST = 501;\n RCPDU_SEND_AUDIO_DATA_REQUEST = 502;\n RCPDU_SEND_GIFT_DATA_REQUEST = 503;\n RCPDU_SEND_CHAT_DATA_REQUEST = 504;\n RCPDU_THIRD_BROADCAST_DATA_REQUEST = 505;\n RCPDU_SEND_DOC_BROADCAST_DATA_REQUEST = 506;\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 string name = 2;\n optional bytes description = 3;\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 optional uint32 register_obj_id=4;\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}\nmessage RCRegistryWBItemPdu {\n required uint32 node_id = 1;\n required bytes node_data = 2;\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 class_description = 4;//conf_desc\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 class_description = 4;\n}\n\nmessage RCConferenceInviteRequestPdu {\n optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_INVITE_REQUEST];\n required uint32 initiator = 2;\n required RCConferenceDescriptorPdu class_description = 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 optional uint32 action_type = 5;//消息的指令类型\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 string from_role = 5;\n required bytes from_name = 6;\n}\n\nmessage RCDocSendDataModelPdu {\n required uint32 item_idx=1;//唯一标识\n required uint32 owner=2;\n optional uint32 from=3;\n optional uint32 cur_page_no=4;\n optional uint32 page_num =5;\n optional string file_type=6;\n optional string creat_user_id=7;//创建文档userid\n optional string relative_url=8;//文档相对地址\n optional string url =9;//文档地址\n optional uint32 cur_V=10;\n optional uint32 cur_H=11;\n optional uint32 scale=12;\n optional bool visible=13;\n optional uint32 action=14;//0,无操作, 1翻页、2.显示/隐藏\n optional string doc_id=15;//文档在服务器数据库中的唯一id\n optional string file_name=16;//文档的名字\n optional string dynamic_TS=17;//"dynamicTransferStatic": "0"\n optional string md5=18;//md5\n optional uint32 show_type=19;//文档显示模式\n optional uint32 animation_step=20 [default =1];//当前页码的动画步数\n\n}\n\nmessage RCDocBroadcastDataRequestPdu {\n optional uint32 from_node_id = 1;//发起人\n optional uint32 to_node_id = 2;//接收人,如果是0就是所有人都接收\n optional uint32 actionType = 3;//消息指令类型;\n optional bytes data = 4;//其他数据,这个根据actionType来确定数据的结构\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 RCAudioSendDataRequestPdu1 {\n optional uint32 initiator = 1;\n required bytes user_data = 2;\n}\nmessage RCAudioSendDataRequestPdu {\n required uint32 from_node_id = 1;//发起人\n optional uint32 to_node_id = 2;//接收人,如果是0就是所有人都接收\n optional uint32 actionType = 3;//消息指令类型;\n optional bytes data = 4;//其他数据,这个根据actionType来确定数据的结构\n}\n\nmessage RCVideoSendDataRequestPdu {\n required uint32 from_node_id = 1;//发起人\n optional uint32 to_node_id = 2;//接收人,如果是0就是所有人都接收\n optional uint32 actionType = 3;//消息指令类型;\n optional bytes data = 4;//其他数据,这个根据actionType来确定数据的结构\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}\nmessage RCAudioChannelInfoPdu {\n optional uint32 status = 1;//开启的状态\n optional uint32 channel_id = 2;//唯一的频道id\n optional uint32 timestamp = 3;//更新的时间戳\n optional uint32 from_node_id = 4;//发起者的id\n optional uint32 to_node_id = 5;//接收者的id,(如果是0,所有人都接收)\n optional uint32 media_type = 6;//媒体类型:视频(包含音频)或音频\n optional uint32 class_id = 7;//课堂号\n optional string site_id = 8;//站点号\n optional string user_id = 9;//用户的userId\n optional string stream_id = 10;//流名称\n optional string user_name = 11;//用户的名字\n optional string user_role = 12;//用户的身份\n}\n\nmessage RCVideoChannelInfoPdu {\n optional uint32 status = 1;//开启的状态\n optional uint32 channel_id = 2;//唯一的频道id\n optional uint32 timestamp = 3;//更新的时间戳\n optional uint32 from_node_id = 4;//发起者的id\n optional uint32 to_node_id = 5;//接收者的id,(如果是0,所有人都接收)\n optional uint32 media_type = 6;//媒体类型:视频(包含音频)或音频\n optional uint32 class_id = 7;//课堂号\n optional string site_id = 8;//站点号\n optional string user_id = 9;//用户的userId\n optional string stream_id = 10;//流名称\n optional string user_name = 11;//用户的名字\n optional string user_role = 12;//用户的身份\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 repeated string microphones = 13;\n repeated string cameras = 14;\n optional uint32 openCamera=15;\n optional uint32 openMicrophones=16;\n optional uint32 videoQuality=17;//设置分辨率的\n optional string userIp=18;\n optional uint32 curVideoQuality=19;\n optional uint32 micGain=20;\n optional uint32 speakerVolume=21;\n optional uint32 micCode=22;\n optional string curCamera=23;\n optional string curMicrophone=24;\n optional string country=25;\n optional string city=26;\n optional string province=27;\n optional string isp=28;\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 device = 1;//设备名称\n optional bool has_camera = 2;//是否有摄像头可用\n optional bool has_microphone = 3;//麦克风是否可用\n optional string browser = 4;//浏览器\n optional string qq = 5;//qq\n optional string skype = 6;//skype\n}\n\nmessage RCTabUpdateDataRequestPdu {\n optional uint32 id = 1;\n optional bytes action = 2;\n optional uint32 uncomprLen =3;\n}\n\nmessage RCWhiteBoardDataModelPdu {\n required uint32 type= 1;//白板类型\n required uint32 itemIdx= 2;//itemIdx 每一次绘制的唯一标识\n required uint32 initiator=3; //绘制来自谁\n required uint32 parentId=4; //父级的id\n required uint32 cur_page_no= 5;//页码\n optional string pointGroup=6; //坐标点集数组的JSON字符串\n optional string color=7 [default = "#000000"]; //颜色\n optional uint32 thickness= 8 ;//线条粗细\n optional uint32 radius= 9;//园的半径\n optional uint32 fontSize= 10;//字体大小\n optional string fontName= 11;//字体名称\n optional string text= 12;//文本内容\n optional bytes data = 13;//暂时预留的参数\n}\nmessage RCClassSendDataModelPdu {\n optional uint32 item_idx=1;\n optional uint32 from=2;\n optional uint32 owner=3;\n optional uint32 action_type=4;//状态改变的类型\n optional RCClassStatusInfoPdu class_status_info=5;//当前课堂状态的信息\n}\nmessage RCClassStatusInfoPdu {\n optional uint32 node_id=1;//mcu中的唯一ID\n optional string user_id=2;\n optional string user_name=3;\n optional string site_id=4;//站点号\n optional uint32 class_id=5;\n optional string class_name=6;\n required uint32 class_type=7;//课堂类型\n required uint32 class_status=9;//课堂的状态\n optional string class_startTime=10;//课堂点击开始时间\n optional string class_stopTime=11;//最后一次停止的时间(点暂停或结束),每次发送数据都获取当前时间戳\n optional uint32 class_timestamp=12;//相对于点开始课堂的时间戳\n optional string class_beginTime=13;//课堂创建的时间,这个是Sass返回的\n optional string class_endTime=14;//课堂结束的时间,这个是Sass返回的\n optional bool record_status=15;//当前录制状态\n optional uint32 record_timestamp=16;//相对于首次开始录制的时间戳\n optional string record_fileName=17;//录制的文件名\n optional string record_downloadUrl=18;//下载地址\n optional uint32 server_timestamp=19;//当前的系统时间戳\n optional uint32 active_doc_id=20;//当前激活的文档id\n optional uint32 active_doc_cur_page=21;//当前激活的文档的当前页\n}\n\nmessage RCConferenceRecordRequestPdu {\n \toptional uint32 initiator = 1;\t// 发起录像指令的node id\n\t\toptional bool record = 2;\t\t// 录像指令 true:开始录像, false:停止录像\n \toptional uint32 class_time = 3;\t// 课堂进行时间(秒)\n\t\toptional string filename = 4;\t// 录像文件名称,filename中增加目录部分\n}\n\n//end\n'; -t.default=n;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&__REACT_HOT_LOADER__.register(n,"default","D:/work/McuClient/src/pdus/pro.js")})()},function(e,t){!function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],r=0;r<e.length;r+=3)for(var i=e[r]<<16|e[r+1]<<8|e[r+2],o=0;o<4;o++)8*r+6*o<=8*e.length?n.push(t.charAt(i>>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r<e.length;i=++r%4)0!=i&&n.push((t.indexOf(e.charAt(r-1))&Math.pow(2,-2*i+8)-1)<<2*i|t.indexOf(e.charAt(r))>>>6-2*i);return n}};e.exports=n}()},function(e,t,n){var r;(function(e,i,o){(function(){"use strict";function a(e){return"function"==typeof e||"object"==typeof e&&null!==e}function s(e){return"function"==typeof e}function u(e){z=e}function l(e){ee=e}function f(){return function(){e.nextTick(_)}}function d(){return function(){K(_)}}function c(){var e=0,t=new re(_),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function h(){var e=new MessageChannel;return e.port1.onmessage=_,function(){e.port2.postMessage(0)}}function p(){return function(){setTimeout(_,1)}}function _(){for(var e=0;e<X;e+=2){var t=ae[e],n=ae[e+1];t(n),ae[e]=void 0,ae[e+1]=void 0}X=0}function E(){try{var e=n(53);return K=e.runOnLoop||e.runOnContext,d()}catch(e){return p()}}function g(e,t){var n=this,r=new this.constructor(R);void 0===r[le]&&B(r);var i=n._state;if(i){var o=arguments[i-1];ee(function(){k(i,r,o,n._result)})}else O(n,r,e,t);return r}function y(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(R);return b(n,e),n}function R(){}function m(){return new TypeError("You cannot resolve a promise with itself")}function v(){return new TypeError("A promises callback cannot return that same promise.")}function T(e){try{return e.then}catch(e){return he.error=e,he}}function C(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}function S(e,t,n){ee(function(e){var r=!1,i=C(n,t,function(n){r||(r=!0,t!==n?b(e,n):D(e,n))},function(t){r||(r=!0,P(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&i&&(r=!0,P(e,i))},e)}function I(e,t){t._state===de?D(e,t._result):t._state===ce?P(e,t._result):O(t,void 0,function(t){b(e,t)},function(t){P(e,t)})}function A(e,t,n){t.constructor===e.constructor&&n===se&&constructor.resolve===ue?I(e,t):n===he?P(e,he.error):void 0===n?D(e,t):s(n)?S(e,t,n):D(e,t)}function b(e,t){e===t?P(e,m()):a(t)?A(e,t,T(t)):D(e,t)}function w(e){e._onerror&&e._onerror(e._result),N(e)}function D(e,t){e._state===fe&&(e._result=t,e._state=de,0!==e._subscribers.length&&ee(N,e))}function P(e,t){e._state===fe&&(e._state=ce,e._result=t,ee(w,e))}function O(e,t,n,r){var i=e._subscribers,o=i.length;e._onerror=null,i[o]=t,i[o+de]=n,i[o+ce]=r,0===o&&e._state&&ee(N,e)}function N(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r,i,o=e._result,a=0;a<t.length;a+=3)r=t[a],i=t[a+n],r?k(n,r,i,o):i(o);e._subscribers.length=0}}function U(){this.error=null}function L(e,t){try{return e(t)}catch(e){return pe.error=e,pe}}function k(e,t,n,r){var i,o,a,u,l=s(n);if(l){if(i=L(n,r),i===pe?(u=!0,o=i.error,i=null):a=!0,t===i)return void P(t,v())}else i=r,a=!0;t._state!==fe||(l&&a?b(t,i):u?P(t,o):e===de?D(t,i):e===ce&&P(t,i))}function M(e,t){try{t(function(t){b(e,t)},function(t){P(e,t)})}catch(t){P(e,t)}}function x(){return _e++}function B(e){e[le]=_e++,e._state=void 0,e._result=void 0,e._subscribers=[]}function F(e){return new me(this,e).promise}function H(e){var t=this;return new t(Z(e)?function(n,r){for(var i=e.length,o=0;o<i;o++)t.resolve(e[o]).then(n,r)}:function(e,t){t(new TypeError("You must pass an array to race."))})}function j(e){var t=this,n=new t(R);return P(n,e),n}function G(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function q(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function V(e){this[le]=x(),this._result=this._state=void 0,this._subscribers=[],R!==e&&("function"!=typeof e&&G(),this instanceof V?M(this,e):q())}function Y(e,t){this._instanceConstructor=e,this.promise=new e(R),this.promise[le]||B(this.promise),Z(t)?(this._input=t,this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?D(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&D(this.promise,this._result))):P(this.promise,J())}function J(){return new Error("Array Methods must be provided an Array")}function W(){var e;if("undefined"!=typeof i)e=i;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;t&&"[object Promise]"===Object.prototype.toString.call(t.resolve())&&!t.cast||(e.Promise=Re)}var Q;Q=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var K,z,$,Z=Q,X=0,ee=function(e,t){ae[X]=e,ae[X+1]=t,X+=2,2===X&&(z?z(_):$())},te="undefined"!=typeof window?window:void 0,ne=te||{},re=ne.MutationObserver||ne.WebKitMutationObserver,ie="undefined"==typeof self&&"undefined"!=typeof e&&"[object process]"==={}.toString.call(e),oe="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,ae=new Array(1e3);$=ie?f():re?c():oe?h():void 0===te?E():p();var se=g,ue=y,le=Math.random().toString(36).substring(16),fe=void 0,de=1,ce=2,he=new U,pe=new U,_e=0,Ee=F,ge=H,ye=j,Re=V;V.all=Ee,V.race=ge,V.resolve=ue,V.reject=ye,V._setScheduler=u,V._setAsap=l,V._asap=ee,V.prototype={constructor:V,then:se,catch:function(e){return this.then(null,e)}};var me=Y;Y.prototype._enumerate=function(){for(var e=this.length,t=this._input,n=0;this._state===fe&&n<e;n++)this._eachEntry(t[n],n)},Y.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===ue){var i=T(e);if(i===se&&e._state!==fe)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(n===Re){var o=new n(R);A(o,e,i),this._willSettleAt(o,t)}else this._willSettleAt(new n(function(t){t(e)}),t)}else this._willSettleAt(r(e),t)},Y.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===fe&&(this._remaining--,e===ce?P(r,n):this._result[t]=n),0===this._remaining&&D(r,this._result)},Y.prototype._willSettleAt=function(e,t){var n=this;O(e,void 0,function(e){n._settledAt(de,t,e)},function(e){n._settledAt(ce,t,e)})};var ve=W,Te={Promise:Re,polyfill:ve};n(12).amd?(r=function(){return Te}.call(t,n,t,o),!(void 0!==r&&(o.exports=r))):"undefined"!=typeof o&&o.exports?o.exports=Te:"undefined"!=typeof this&&(this.ES6Promise=Te),ve()}).call(this)}).call(t,n(23),function(){return this}(),n(9)(e))},function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function r(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}e.exports=function(e){return null!=e&&(n(e)||r(e)||!!e._isBuffer)}},function(e,t,n){var r,i,o;!function(a){n(24)&&n(24).jQuery?(i=[n(29)],r=a,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(e.exports=o))):a("undefined"!=typeof e&&e.exports?n(29):jQuery)}(function(e){function t(t){return!t||void 0!==t.allowPageScroll||void 0===t.swipe&&void 0===t.swipeStatus||(t.allowPageScroll=f),void 0!==t.click&&void 0===t.tap&&(t.tap=t.click),t||(t={}),t=e.extend({},e.fn.swipe.defaults,t),this.each(function(){var r=e(this),i=r.data(w);i||(i=new n(this,t),r.data(w,i))})}function n(t,n){function r(t){if(!(le()||e(t.target).closest(n.excludedElements,Ve).length>0)){var r,i=t.originalEvent?t.originalEvent:t,o=i.touches,a=o?o[0]:i;return Ye=v,o?Je=o.length:n.preventDefaultEvents!==!1&&t.preventDefault(),Le=0,ke=null,Me=null,Ge=null,xe=0,Be=0,Fe=0,He=1,je=0,qe=Ee(),se(),de(0,a),!o||Je===n.fingers||n.fingers===R||q()?(Qe=Ie(),2==Je&&(de(1,o[1]),Be=Fe=Re(We[0].start,We[1].start)),(n.swipeStatus||n.pinchStatus)&&(r=k(i,Ye))):r=!1,r===!1?(Ye=S,k(i,Ye),r):(n.hold&&(et=setTimeout(e.proxy(function(){Ve.trigger("hold",[i.target]),n.hold&&(r=n.hold.call(Ve,i,i.target))},this),n.longTapThreshold)),fe(!0),null)}}function D(e){var t=e.originalEvent?e.originalEvent:e;if(Ye!==C&&Ye!==S&&!ue()){var r,i=t.touches,o=i?i[0]:t,a=ce(o);if(Ke=Ie(),i&&(Je=i.length),n.hold&&clearTimeout(et),Ye=T,2==Je&&(0==Be?(de(1,i[1]),Be=Fe=Re(We[0].start,We[1].start)):(ce(i[1]),Fe=Re(We[0].end,We[1].end),Ge=ve(We[0].end,We[1].end)),He=me(Be,Fe),je=Math.abs(Be-Fe)),Je===n.fingers||n.fingers===R||!i||q()){if(ke=Se(a.start,a.end),Me=Se(a.last,a.end),j(e,Me),Le=Te(a.start,a.end),xe=ye(),pe(ke,Le),r=k(t,Ye),!n.triggerOnTouchEnd||n.triggerOnTouchLeave){var s=!0;if(n.triggerOnTouchLeave){var u=Ae(this);s=be(a.end,u)}!n.triggerOnTouchEnd&&s?Ye=L(T):n.triggerOnTouchLeave&&!s&&(Ye=L(C)),Ye!=S&&Ye!=C||k(t,Ye)}}else Ye=S,k(t,Ye);r===!1&&(Ye=S,k(t,Ye))}}function P(e){var t=e.originalEvent?e.originalEvent:e,r=t.touches;if(r){if(r.length&&!ue())return ae(t),!0;if(r.length&&ue())return!0}return ue()&&(Je=$e),Ke=Ie(),xe=ye(),B()||!x()?(Ye=S,k(t,Ye)):n.triggerOnTouchEnd||0==n.triggerOnTouchEnd&&Ye===T?(n.preventDefaultEvents!==!1&&e.preventDefault(),Ye=C,k(t,Ye)):!n.triggerOnTouchEnd&&z()?(Ye=C,M(t,Ye,p)):Ye===T&&(Ye=S,k(t,Ye)),fe(!1),null}function O(){Je=0,Ke=0,Qe=0,Be=0,Fe=0,He=1,se(),fe(!1)}function N(e){var t=e.originalEvent?e.originalEvent:e;n.triggerOnTouchLeave&&(Ye=L(C),k(t,Ye))}function U(){Ve.unbind(De,r),Ve.unbind(Ue,O),Ve.unbind(Pe,D),Ve.unbind(Oe,P),Ne&&Ve.unbind(Ne,N),fe(!1)}function L(e){var t=e,r=H(),i=x(),o=B();return!r||o?t=S:!i||e!=T||n.triggerOnTouchEnd&&!n.triggerOnTouchLeave?!i&&e==C&&n.triggerOnTouchLeave&&(t=S):t=C,t}function k(e,t){var n,r=e.touches;return(W()||J())&&(n=M(e,t,c)),(V()||q())&&n!==!1&&(n=M(e,t,h)),ie()&&n!==!1?n=M(e,t,_):oe()&&n!==!1?n=M(e,t,E):re()&&n!==!1&&(n=M(e,t,p)),t===S&&(J()&&(n=M(e,t,c)),q()&&(n=M(e,t,h)),O(e)),t===C&&(r?r.length||O(e):O(e)),n}function M(t,r,f){var d;if(f==c){if(Ve.trigger("swipeStatus",[r,ke||null,Le||0,xe||0,Je,We,Me]),n.swipeStatus&&(d=n.swipeStatus.call(Ve,t,r,ke||null,Le||0,xe||0,Je,We,Me),d===!1))return!1;if(r==C&&Y()){if(clearTimeout(Xe),clearTimeout(et),Ve.trigger("swipe",[ke,Le,xe,Je,We,Me]),n.swipe&&(d=n.swipe.call(Ve,t,ke,Le,xe,Je,We,Me),d===!1))return!1;switch(ke){case i:Ve.trigger("swipeLeft",[ke,Le,xe,Je,We,Me]),n.swipeLeft&&(d=n.swipeLeft.call(Ve,t,ke,Le,xe,Je,We,Me));break;case o:Ve.trigger("swipeRight",[ke,Le,xe,Je,We,Me]),n.swipeRight&&(d=n.swipeRight.call(Ve,t,ke,Le,xe,Je,We,Me));break;case a:Ve.trigger("swipeUp",[ke,Le,xe,Je,We,Me]),n.swipeUp&&(d=n.swipeUp.call(Ve,t,ke,Le,xe,Je,We,Me));break;case s:Ve.trigger("swipeDown",[ke,Le,xe,Je,We,Me]),n.swipeDown&&(d=n.swipeDown.call(Ve,t,ke,Le,xe,Je,We,Me))}}}if(f==h){if(Ve.trigger("pinchStatus",[r,Ge||null,je||0,xe||0,Je,He,We]),n.pinchStatus&&(d=n.pinchStatus.call(Ve,t,r,Ge||null,je||0,xe||0,Je,He,We),d===!1))return!1;if(r==C&&G())switch(Ge){case u:Ve.trigger("pinchIn",[Ge||null,je||0,xe||0,Je,He,We]),n.pinchIn&&(d=n.pinchIn.call(Ve,t,Ge||null,je||0,xe||0,Je,He,We));break;case l:Ve.trigger("pinchOut",[Ge||null,je||0,xe||0,Je,He,We]),n.pinchOut&&(d=n.pinchOut.call(Ve,t,Ge||null,je||0,xe||0,Je,He,We))}}return f==p?r!==S&&r!==C||(clearTimeout(Xe),clearTimeout(et),$()&&!ee()?(Ze=Ie(),Xe=setTimeout(e.proxy(function(){Ze=null,Ve.trigger("tap",[t.target]),n.tap&&(d=n.tap.call(Ve,t,t.target))},this),n.doubleTapThreshold)):(Ze=null,Ve.trigger("tap",[t.target]),n.tap&&(d=n.tap.call(Ve,t,t.target)))):f==_?r!==S&&r!==C||(clearTimeout(Xe),clearTimeout(et),Ze=null,Ve.trigger("doubletap",[t.target]),n.doubleTap&&(d=n.doubleTap.call(Ve,t,t.target))):f==E&&(r!==S&&r!==C||(clearTimeout(Xe),Ze=null,Ve.trigger("longtap",[t.target]),n.longTap&&(d=n.longTap.call(Ve,t,t.target)))),d}function x(){var e=!0;return null!==n.threshold&&(e=Le>=n.threshold),e}function B(){var e=!1;return null!==n.cancelThreshold&&null!==ke&&(e=_e(ke)-Le>=n.cancelThreshold),e}function F(){return null===n.pinchThreshold||je>=n.pinchThreshold}function H(){var e;return e=!n.maxTimeThreshold||!(xe>=n.maxTimeThreshold)}function j(e,t){if(n.preventDefaultEvents!==!1)if(n.allowPageScroll===f)e.preventDefault();else{var r=n.allowPageScroll===d;switch(t){case i:(n.swipeLeft&&r||!r&&n.allowPageScroll!=g)&&e.preventDefault();break;case o:(n.swipeRight&&r||!r&&n.allowPageScroll!=g)&&e.preventDefault();break;case a:(n.swipeUp&&r||!r&&n.allowPageScroll!=y)&&e.preventDefault();break;case s:(n.swipeDown&&r||!r&&n.allowPageScroll!=y)&&e.preventDefault()}}}function G(){var e=Q(),t=K(),n=F();return e&&t&&n}function q(){return!!(n.pinchStatus||n.pinchIn||n.pinchOut)}function V(){return!(!G()||!q())}function Y(){var e=H(),t=x(),n=Q(),r=K(),i=B(),o=!i&&r&&n&&t&&e;return o}function J(){return!!(n.swipe||n.swipeStatus||n.swipeLeft||n.swipeRight||n.swipeUp||n.swipeDown)}function W(){return!(!Y()||!J())}function Q(){return Je===n.fingers||n.fingers===R||!I}function K(){return 0!==We[0].end.x}function z(){return!!n.tap}function $(){return!!n.doubleTap}function Z(){return!!n.longTap}function X(){if(null==Ze)return!1;var e=Ie();return $()&&e-Ze<=n.doubleTapThreshold}function ee(){return X()}function te(){return(1===Je||!I)&&(isNaN(Le)||Le<n.threshold)}function ne(){return xe>n.longTapThreshold&&Le<m}function re(){return!(!te()||!z())}function ie(){return!(!X()||!$())}function oe(){return!(!ne()||!Z())}function ae(e){ze=Ie(),$e=e.touches.length+1}function se(){ze=0,$e=0}function ue(){var e=!1;if(ze){var t=Ie()-ze;t<=n.fingerReleaseThreshold&&(e=!0)}return e}function le(){return!(Ve.data(w+"_intouch")!==!0)}function fe(e){Ve&&(e===!0?(Ve.bind(Pe,D),Ve.bind(Oe,P),Ne&&Ve.bind(Ne,N)):(Ve.unbind(Pe,D,!1),Ve.unbind(Oe,P,!1),Ne&&Ve.unbind(Ne,N,!1)),Ve.data(w+"_intouch",e===!0))}function de(e,t){var n={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return n.start.x=n.last.x=n.end.x=t.pageX||t.clientX,n.start.y=n.last.y=n.end.y=t.pageY||t.clientY,We[e]=n,n}function ce(e){var t=void 0!==e.identifier?e.identifier:0,n=he(t);return null===n&&(n=de(t,e)),n.last.x=n.end.x,n.last.y=n.end.y,n.end.x=e.pageX||e.clientX,n.end.y=e.pageY||e.clientY,n}function he(e){return We[e]||null}function pe(e,t){t=Math.max(t,_e(e)),qe[e].distance=t}function _e(e){if(qe[e])return qe[e].distance}function Ee(){var e={};return e[i]=ge(i),e[o]=ge(o),e[a]=ge(a),e[s]=ge(s),e}function ge(e){return{direction:e,distance:0}}function ye(){return Ke-Qe}function Re(e,t){var n=Math.abs(e.x-t.x),r=Math.abs(e.y-t.y);return Math.round(Math.sqrt(n*n+r*r))}function me(e,t){var n=t/e*1;return n.toFixed(2)}function ve(){return He<1?l:u}function Te(e,t){return Math.round(Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)))}function Ce(e,t){var n=e.x-t.x,r=t.y-e.y,i=Math.atan2(r,n),o=Math.round(180*i/Math.PI);return o<0&&(o=360-Math.abs(o)),o}function Se(e,t){var n=Ce(e,t);return n<=45&&n>=0?i:n<=360&&n>=315?i:n>=135&&n<=225?o:n>45&&n<135?s:a}function Ie(){var e=new Date;return e.getTime()}function Ae(t){t=e(t);var n=t.offset(),r={left:n.left,right:n.left+t.outerWidth(),top:n.top,bottom:n.top+t.outerHeight()};return r}function be(e,t){return e.x>t.left&&e.x<t.right&&e.y>t.top&&e.y<t.bottom}var n=e.extend({},n),we=I||b||!n.fallbackToMouseEvents,De=we?b?A?"MSPointerDown":"pointerdown":"touchstart":"mousedown",Pe=we?b?A?"MSPointerMove":"pointermove":"touchmove":"mousemove",Oe=we?b?A?"MSPointerUp":"pointerup":"touchend":"mouseup",Ne=we?b?"mouseleave":null:"mouseleave",Ue=b?A?"MSPointerCancel":"pointercancel":"touchcancel",Le=0,ke=null,Me=null,xe=0,Be=0,Fe=0,He=1,je=0,Ge=0,qe=null,Ve=e(t),Ye="start",Je=0,We={},Qe=0,Ke=0,ze=0,$e=0,Ze=0,Xe=null,et=null;try{Ve.bind(De,r),Ve.bind(Ue,O)}catch(t){e.error("events not supported "+De+","+Ue+" on jQuery.swipe")}this.enable=function(){return Ve.bind(De,r),Ve.bind(Ue,O),Ve},this.disable=function(){return U(),Ve},this.destroy=function(){U(),Ve.data(w,null),Ve=null},this.option=function(t,r){if("object"==typeof t)n=e.extend(n,t);else if(void 0!==n[t]){if(void 0===r)return n[t];n[t]=r}else{if(!t)return n;e.error("Option "+t+" does not exist on jQuery.swipe.options")}return null}}var r="1.6.15",i="left",o="right",a="up",s="down",u="in",l="out",f="none",d="auto",c="swipe",h="pinch",p="tap",_="doubletap",E="longtap",g="horizontal",y="vertical",R="all",m=10,v="start",T="move",C="end",S="cancel",I="ontouchstart"in window,A=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled&&!I,b=(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&!I,w="TouchSwipe",D={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:"auto",fallbackToMouseEvents:!0,excludedElements:"label, button, input, select, textarea, a, .noSwipe",preventDefaultEvents:!0};e.fn.swipe=function(n){var r=e(this),i=r.data(w);if(i&&"string"==typeof n){if(i[n])return i[n].apply(this,Array.prototype.slice.call(arguments,1));e.error("Method "+n+" does not exist on jQuery.swipe")}else if(i&&"object"==typeof n)i.option.apply(this,arguments);else if(!(i||"object"!=typeof n&&n))return t.apply(this,arguments);return r},e.fn.swipe.version=r,e.fn.swipe.defaults=D,e.fn.swipe.phases={PHASE_START:v,PHASE_MOVE:T,PHASE_END:C,PHASE_CANCEL:S},e.fn.swipe.directions={LEFT:i,RIGHT:o,UP:a,DOWN:s,IN:u,OUT:l},e.fn.swipe.pageScroll={NONE:f,HORIZONTAL:g,VERTICAL:y,AUTO:d},e.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:R}})},function(e,t,n){var r,i,o;(function(e,a){!function(e,s){n(12).amd?(i=[n(25)],r=s,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(a.exports=o))):"object"==typeof a&&a&&a.exports?a.exports=s(n(25),!0):(e.dcodeIO=e.dcodeIO||{}).ProtoBuf=s(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(54);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={},a=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},s=a.prototype;s._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]},s.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 a=this.source.substring(this.index,this.index=i);return'"'!==a&&"'"!==a||(this._stringOpen=a),a},s.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},s.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},s.omit=function(e){return this.peek()===e&&(this.next(),!0)},s.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},o.Tokenizer=a;var u=function(e){this.tn=new a(e),this.proto3=!1},l=u.prototype;return l.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()},l._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},l._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)},l._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(";")},l._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)}},l._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)},l._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},l._parseMessage=function(e,r){var i=!!r,o=this.tn.next(),a={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(o))throw Error("illegal "+(i?"group":"message")+" name: "+o);for(a.name=o,i&&(this.tn.skip("="),r.id=n(this.tn.next()),a.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(a,o);else if("oneof"===o)this._parseMessageOneOf(a);else if("enum"===o)this._parseEnum(a);else if("message"===o)this._parseMessage(a);else if("option"===o)this._parseOption(a);else if("service"===o)this._parseService(a);else if("extensions"===o)a.extensions=this._parseExtensionRanges();else if("reserved"===o)this._parseIgnored();else if("extend"===o)this._parseExtend(a);else{if(!t.TYPEREF.test(o))throw Error("illegal message token: "+o);if(!this.proto3)throw Error("illegal field rule: "+o);this._parseMessageField(a,"optional",o)}return this.tn.omit(";"),e.messages.push(a),a},l._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},l._parseMessageField=function(e,r,i){if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);var o,a={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(a.keytype=o,this.tn.skip(","),o=this.tn.next(),!t.TYPE.test(o)&&!t.TYPEREF.test(o))throw Error("illegal message field: "+o);if(a.type=o,this.tn.skip(">"),o=this.tn.next(),!t.NAME.test(o))throw Error("illegal message field name: "+o);a.name=o,this.tn.skip("="),a.id=n(this.tn.next()),o=this.tn.peek(),"["===o&&this._parseFieldOptions(a),this.tn.skip(";")}else if(i="undefined"!=typeof i?i:this.tn.next(),"group"===i){var s=this._parseMessage(e,a);if(!/^[A-Z]/.test(s.name))throw Error("illegal group name: "+s.name);a.type=s.name,a.name=s.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(a.type=i,o=this.tn.next(),!t.NAME.test(o))throw Error("illegal message field name: "+o);a.name=o,this.tn.skip("="),a.id=n(this.tn.next()),o=this.tn.peek(),"["===o&&this._parseFieldOptions(a),this.tn.skip(";")}return e.fields.push(a),a},l._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},l._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()},l._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)},l._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},l._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},l.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,a=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(a,n);break;case e.WIRE_TYPES.ENDGROUP:if(a===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+a+" ("+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={},a=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},s=a.prototype;s.fqn=function(){for(var e=this.name,t=this;;){if(t=t.parent,null==t)break;e=t.name+"."+e}return e},s.toString=function(e){return(e?this.className+" ":"")+this.fqn()},s.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},o.T=a;var u=function(e,t,n,r,i){a.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=i||"proto2"},l=u.prototype=Object.create(a.prototype);l.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},l.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof c.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof c.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)},l.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},l.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 a;do{do{if(!(r instanceof o.Namespace)){r=null;break}if(a=r.getChild(n[i]),!a||!(a instanceof o.T)||t&&!(a instanceof o.Namespace)){r=null;break}r=a,i++}while(i<n.length);if(null!=r)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=r);return r},l.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()},l.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},l.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},l.getOption=function(e){return"undefined"==typeof e?this.options:"undefined"!=typeof this.options[e]?this.options[e]:null},o.Namespace=u;var f=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)},d=f.prototype;f.defaultFieldValue=n,d.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 a=this.resolvedType.getChildren(e.Reflect.Enum.Value);for(u=0;u<a.length;u++){if(a[u].name==n)return a[u].id;if(a[u].id==n)return a[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 s={};for(var u in n)n.hasOwnProperty(u)&&(s[u]=n[u]);n=s}return new this.resolvedType.clazz(n)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+n+" (undefined type "+this.type+")")},d.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)")},d.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 a=(new t).LE();this.resolvedType.encode(r,a),i.writeVarint32(a.offset),i.append(a.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},d.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")},d.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)}},d.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=f;var c=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},h=c.prototype=Object.create(u.prototype);h.build=function(n){if(this.clazz&&!n)return this.clazz;var r=function(e,n){function r(n,i,o,a){if(null===n||"object"!=typeof n){if(a&&a instanceof e.Reflect.Enum){var s=e.Reflect.Enum.getName(a.object,n);if(null!==s)return s}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,a)}),u;if(u={},n instanceof e.Map){for(var l=n.entries(),f=l.next();!f.done;f=l.next())u[n.keyElem.valueToString(f.value[0])]=r(f.value[1],i,o,n.valueElem.resolvedType);return u}var d=n.$type,c=void 0;for(var h in n)n.hasOwnProperty(h)&&(d&&(c=d.getChild(h))?u[h]=r(n[h],i,o,c.resolvedType):u[h]=r(n[h],i,o));return u}var i=n.getChildren(e.Reflect.Message.Field),o=n.getChildren(e.Reflect.Message.OneOf),a=function(r,s){e.Builder.Message.call(this);for(var u=0,l=o.length;u<l;++u)this[o[u].name]=null;for(u=0,l=i.length;u<l;++u){var f=i[u];this[f.name]=f.repeated?[]:f.map?new e.Map(f):null,!f.required&&"proto3"!==n.syntax||null===f.defaultValue||(this[f.name]=f.defaultValue)}if(arguments.length>0){var d;if(1!==arguments.length||null===r||"object"!=typeof r||!("function"!=typeof r.encode||r instanceof a)||Array.isArray(r)||r instanceof e.Map||t.isByteBuffer(r)||r instanceof ArrayBuffer||e.Long&&r instanceof e.Long)for(u=0,l=arguments.length;u<l;++u)"undefined"!=typeof(d=arguments[u])&&this.$set(i[u].name,d);else this.$set(r)}},s=a.prototype=Object.create(e.Builder.Message.prototype);s.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},s.$add=s.add,s.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 a=n._fieldsByName[t];if(i)this[t]=r;else{if(!a)throw Error(this+"#"+t+" is not a field: undefined");if(!(a instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+a.toString(!0));this[a.name]=r=a.verifyValue(r)}if(a&&a.oneof){var s=this[a.oneof.name];null!==r?(null!==s&&s!==a.name&&(this[s]=null),this[a.oneof.name]=a.name):s===t&&(this[a.oneof.name]=null)}return this},s.$set=s.set,s.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]},s.$get=s.get;for(var u=0;u<i.length;u++){var l=i[u];l 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)&&(s["set"+t]=i),null===n.getChild("set_"+r)&&(s["set_"+r]=i),null===n.getChild("get"+t)&&(s["get"+t]=o),null===n.getChild("get_"+r)&&(s["get_"+r]=o)}(l)}s.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}},a.encode=function(e,t,n){return new a(e).encode(t,n)},s.calculate=function(){return n.calculate(this)},s.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},s.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},s.toArrayBuffer=s.encodeAB,s.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},s.toBuffer=s.encodeNB,s.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},s.toBase64=s.encode64,s.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},s.toHex=s.encodeHex,s.toRaw=function(e,t){return r(this,!!e,!!t,this.$type)},s.encodeJSON=function(){return JSON.stringify(r(this,!0,!0,this.$type))},a.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 a=n.decode(e.LE());return e.LE(o),a}catch(t){throw e.LE(o),t}},a.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 a=n.decode(e.slice(e.offset,e.offset+o).LE());return e.offset+=o,a}catch(t){throw e.offset+=o,t}},a.decode64=function(e){return a.decode(e,"base64")},a.decodeHex=function(e){return a.decode(e,"hex")},a.decodeJSON=function(e){return new a(JSON.parse(e))},s.toString=function(){return n.toString()};return Object.defineProperty&&(Object.defineProperty(a,"$options",{value:n.buildOpt()}),Object.defineProperty(s,"$options",{value:a.$options}),Object.defineProperty(a,"$type",{value:n}),Object.defineProperty(s,"$type",{value:n})),a}(e,this);this._fields=[],this._fieldsById={},this._fieldsByName={};for(var i,o=0,a=this.children.length;o<a;o++)if(i=this.children[o],i instanceof y||i instanceof c||i instanceof T){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 c.Field)i.build(),this._fields.push(i),this._fieldsById[i.id]=i,this._fieldsByName[i.name]=i;else if(!(i instanceof c.OneOf||i instanceof v))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[o].toString(!0));return this.clazz=r},h.encode=function(e,t,n){for(var r,i,o=null,a=0,s=this._fields.length;a<s;++a)r=this._fields[a],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},h.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},h.decode=function(t,n,r){n="number"==typeof n?n:-1;for(var o,a,s,u,l=t.offset,f=new this.clazz;t.offset<l+n||n===-1&&t.remaining()>0;){if(o=t.readVarint32(),a=7&o,s=o>>>3,a===e.WIRE_TYPES.ENDGROUP){if(s!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+s+" ("+(r?r+" expected":"not a group")+")");break}if(u=this._fieldsById[s]){if(u.repeated&&!u.options.packed)f[u.name].push(u.decode(a,t));else if(u.map){var d=u.decode(a,t);f[u.name].set(d[0],d[1])}else if(f[u.name]=u.decode(a,t),u.oneof){var c=f[u.oneof.name];null!==c&&c!==u.name&&(f[c]=null),f[u.oneof.name]=u.name}}else switch(a){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 h=t.readVarint32();t.offset+=h;break;case e.WIRE_TYPES.STARTGROUP:for(;i(s,t););break;default:throw Error("Illegal wire type for unknown field "+s+" in "+this.toString(!0)+"#decode: "+a)}}for(var p=0,_=this._fields.length;p<_;++p)if(u=this._fields[p],null===f[u.name])if("proto3"===this.syntax)f[u.name]=u.defaultValue;else{if(u.required){var E=Error("Missing at least one required field for "+this.toString(!0)+": "+u.name);throw E.decoded=f,E}e.populateDefaults&&null!==u.defaultValue&&(f[u.name]=u.defaultValue)}return f},o.Message=c;var p=function(t,n,r,i,o,s,u,l,f,d){a.call(this,t,n,s),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=l||{},this.defaultValue=null,this.oneof=f||null,this.syntax=d||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof c.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},_=p.prototype=Object.create(a.prototype);_.build=function(){this.element=new f(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new f(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=f.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 a=[];for(o=0;o<t.length;o++)a.push(this.element.verifyValue(t[o]));return a}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 a=r.offset;for(o=0;o<n.length;o++)this.element.encodeValue(this.id,n[o],r);var s=r.offset-a,u=t.calculateVarint32(s);if(u>1){var l=r.slice(a,r.offset);a+=u-1,r.offset=a,r.append(l)}r.writeVarint32(s,a-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 a=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(a),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,a;if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(i+=t.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),a=0,o=0;o<n.length;o++)a+=this.element.calculateLength(this.id,n[o]);i+=t.calculateVarint32(a),i+=a}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 a=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(a),i+=a},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,a=!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(!a)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 s=[];n.offset<o;)s.push(this.decode(this.type.wireType,n,!0));return s}if(this.map){var u=f.defaultFieldValue(this.keyType);if(i=f.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 l=n.clone();for(l.limit=l.offset+o,n.offset+=o;l.remaining()>0;){var d=l.readVarint32();t=7&d;var c=d>>>3;if(1===c)u=this.keyElement.decode(l,t,c);else{if(2!==c)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(l,t,c)}}return[u,i]}return this.element.decode(n,t,this.id)},o.Message.Field=p;var E=function(e,t,n,r,i,o,a){p.call(this,e,t,n,null,r,i,o,a),this.extension};E.prototype=Object.create(p.prototype),o.Message.ExtensionField=E;var g=function(e,t,n){a.call(this,e,t,n),this.fields=[]};o.Message.OneOf=g;var y=function(e,t,n,r,i){u.call(this,e,t,n,r,i),this.className="Enum",this.object=null};y.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 R=y.prototype=Object.create(u.prototype);R.build=function(t){if(this.object&&!t)return this.object;for(var n=new e.Builder.Enum,r=this.getChildren(y.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=y;var m=function(e,t,n,r){a.call(this,e,t,n),this.className="Enum.Value",this.id=r};m.prototype=Object.create(a.prototype),o.Enum.Value=m;var v=function(e,t,n,r){a.call(this,e,t,n),this.field=r};v.prototype=Object.create(a.prototype),o.Extension=v;var T=function(e,t,n,r){u.call(this,e,t,n,r),this.className="Service",this.clazz=null},C=T.prototype=Object.create(u.prototype);C.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),a=0;a<o.length;a++)!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[a]);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=T;var S=function(e,t,n,r){a.call(this,e,t,n),this.className="Service.Method",this.options=r||{}},I=S.prototype=Object.create(a.prototype);I.buildOpt=l.buildOpt,o.Service.Method=S;var A=function(e,t,n,r,i,o,a,s){S.call(this,e,t,n,s),this.className="Service.RPCMethod",this.requestName=r,this.responseName=i,this.requestStream=o,this.responseStream=a,this.resolvedRequestType=null,this.resolvedResponseType=null};return A.prototype=Object.create(S.prototype),o.Service.RPCMethod=A,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||{}},a=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},a.reset=function(){return this.ptr=this.ns,this},a.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},a.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 a=new r.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax),s={};i.oneofs&&Object.keys(i.oneofs).forEach(function(e){a.addChild(s[e]=new r.Message.OneOf(this,a,e))},this),i.fields&&i.fields.forEach(function(e){if(null!==a.getChild(0|e.id))throw Error("duplicate or invalid field id in "+a.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+a.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=s[e.oneof]))throw Error("illegal oneof in "+a.name+"#"+e.name+": "+e.oneof);e=new r.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),t&&t.fields.push(e),a.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]?a.extensions=[i.extensions]:a.extensions=i.extensions),this.ptr.addChild(a),u.length>0){n.push(t),t=u,u=null,this.ptr=a,a=null;continue}u=null}else if(o.isEnum(i))a=new r.Enum(this,this.ptr,i.name,i.options,i.syntax),i.values.forEach(function(e){a.addChild(new r.Enum.Value(this,a,e.name,e.id))},this),this.ptr.addChild(a);else if(o.isService(i))a=new r.Service(this,this.ptr,i.name,i.options),Object.keys(i.rpc).forEach(function(e){var t=i.rpc[e];a.addChild(new r.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))},this),this.ptr.addChild(a);else{if(!o.isExtend(i))throw Error("not a valid definition: "+JSON.stringify(i));if(a=this.ptr.resolve(i.ref,!0))i.fields.forEach(function(t){if(null!==a.getChild(0|t.id))throw Error("duplicate extended field id in "+a.name+": "+t.id);if(a.extensions){var n=!1;if(a.extensions.forEach(function(e){t.id>=e[0]&&t.id<=e[1]&&(n=!0)}),!n)throw Error("illegal extended field id in "+a.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,a,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),s=new r.Extension(this,this.ptr,t.name,o);o.extension=s,this.ptr.addChild(s),a.addChild(o)},this);else if(!/\.?google\.protobuf\./.test(i.ref))throw Error("extended message "+i.ref+" is not defined"); -}i=null,a=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},a.import=function(t,r){var o="/";if("string"==typeof r){if(e.Util.IS_NODE&&(r=n(32).resolve(r)),this.files[r]===!0)return this.reset();this.files[r]=!0}else if("object"==typeof r){var a=r.root;e.Util.IS_NODE&&(a=n(32).resolve(a)),(a.indexOf("\\")>=0||r.file.indexOf("\\")>=0)&&(o="\\");var s=a+o+r.file;if(this.files[s]===!0)return this.reset();this.files[s]=!0}if(t.imports&&t.imports.length>0){var u,l=!1;"object"==typeof r?(this.importRoot=r.root,l=!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 f=0;f<t.imports.length;f++)if("string"==typeof t.imports[f]){if(!u)throw Error("cannot determine import root");var d=t.imports[f];if("google/protobuf/descriptor.proto"===d)continue;if(d=u+o+d,this.files[d]===!0)continue;/\.proto$/i.test(d)&&!e.DotProto&&(d=d.replace(/\.proto$/,".json"));var c=e.Util.fetch(d);if(null===c)throw Error("failed to import '"+d+"' in '"+r+"': file not found");/\.json$/i.test(d)?this.import(JSON.parse(c+""),d):this.import(e.DotProto.Parser.parse(c),d)}else r?/\.(\w+)$/.test(r)?this.import(t.imports[f],r.replace(/^(.+)\.(\w+)$/,function(e,t,n){return t+"_import"+f+"."+n})):this.import(t.imports[f],r+"_import"+f):this.import(t.imports[f]);l&&(this.importRoot=null)}t.package&&this.define(t.package),t.syntax&&i(t);var h=this.ptr;return t.options&&Object.keys(t.options).forEach(function(e){h.options[e]=t.options[e]}),t.messages&&(this.create(t.messages),this.ptr=h),t.enums&&(this.create(t.enums),this.ptr=h),t.services&&(this.create(t.services),this.ptr=h),t.extends&&this.create(t.extends),this.reset()},a.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()},a.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},a.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},a.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]),a=this.valueElem.verifyValue(n[r[i]]);this.map[this.keyElem.valueToString(o)]={key:o,value:a}}},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(23),n(9)(e))},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}()},function(e,t){!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function r(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return _.iterable&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(e,t){this.append(t,e)},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function o(e){return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function a(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function s(e){var t=new FileReader;return t.readAsArrayBuffer(e),a(t)}function u(e){var t=new FileReader;return t.readAsText(e),a(t)}function l(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,"string"==typeof e)this._bodyText=e;else if(_.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(_.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(_.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(e){if(!_.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e))throw new Error("unsupported BodyInit type")}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):_.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},_.blob?(this.blob=function(){var e=o(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(s)},this.text=function(){var e=o(this);if(e)return e;if(this._bodyBlob)return u(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var e=o(this);return e?e:Promise.resolve(this._bodyText)},_.formData&&(this.formData=function(){return this.text().then(c)}),this.json=function(){return this.text().then(JSON.parse)},this}function f(e){var t=e.toUpperCase();return E.indexOf(t)>-1?t:e}function d(e,t){t=t||{};var n=t.body;if(d.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,n||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=e;if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new i(t.headers)),this.method=f(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function c(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function h(e){var t=new i,n=(e.getAllResponseHeaders()||"").trim().split("\n");return n.forEach(function(e){var n=e.trim().split(":"),r=n.shift().trim(),i=n.join(":").trim();t.append(r,i)}),t}function p(e,t){t||(t={}),this.type="default",this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof i?t.headers:new i(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var _={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};i.prototype.append=function(e,r){e=t(e),r=n(r);var i=this.map[e];i||(i=[],this.map[e]=i),i.push(r)},i.prototype.delete=function(e){delete this.map[t(e)]},i.prototype.get=function(e){var n=this.map[t(e)];return n?n[0]:null},i.prototype.getAll=function(e){return this.map[t(e)]||[]},i.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},i.prototype.set=function(e,r){this.map[t(e)]=[n(r)]},i.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach(function(n){this.map[n].forEach(function(r){e.call(t,r,n,this)},this)},this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),r(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),r(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),r(e)},_.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);var E=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];d.prototype.clone=function(){return new d(this)},l.call(d.prototype),l.call(p.prototype),p.prototype.clone=function(){return new p(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},p.error=function(){var e=new p(null,{status:0,statusText:""});return e.type="error",e};var g=[301,302,303,307,308];p.redirect=function(e,t){if(g.indexOf(t)===-1)throw new RangeError("Invalid status code");return new p(null,{status:t,headers:{location:e}})},e.Headers=i,e.Request=d,e.Response=p,e.fetch=function(e,t){return new Promise(function(n,r){function i(){return"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0}var o;o=d.prototype.isPrototypeOf(e)&&!t?e:new d(e,t);var a=new XMLHttpRequest;a.onload=function(){var e={status:a.status,statusText:a.statusText,headers:h(a),url:i()},t="response"in a?a.response:a.responseText;n(new p(t,e))},a.onerror=function(){r(new TypeError("Network request failed"))},a.ontimeout=function(){r(new TypeError("Network request failed"))},a.open(o.method,o.url,!0),"include"===o.credentials&&(a.withCredentials=!0),"responseType"in a&&_.blob&&(a.responseType="blob"),o.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),a.send("undefined"==typeof o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},32,32]))}); \ 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(35)},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.sdkInfo=t||"",this.id=this.initId()}return r(e,[{key:"initId",value:function(){if(!this.sdkInfo)return console.log("this.sdkInfo无效-->",this.sdkInfo),"";var e=Object.prototype.toString.call(this.sdkInfo);return"[object String]"===e?this.sdkInfo:"[object Object]"===e?this.sdkInfo.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:"data",value:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];this._log(e.DATA,n)}},{key:"_log",value:function(t,n){if(e.IS_DEBUG){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);break;case e.DATA:console.log(r)}}}}]),e}();i.IS_DEBUG=!0,i.LOG=0,i.WARN=1,i.ERROR=2,i.NO=1/0,i.logLevel=i.LOG,i.DATA=5;var a={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,DATA:i.DATA};t.default=a;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"Loger","D:/work/McuClient/src/Loger.js"),__REACT_HOT_LOADER__.register(a,"default","D:/work/McuClient/src/Loger.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.CLASS_STATUS_WAIT=0,n.CLASS_STATUS_STARTED=1,n.CLASS_STATUS_PAUSE=2,n.CLASS_STATUS_CLOSE=3,n.CLASS_STATUS_UPTATE=4,n.CLASS_WAIT_START="class.wait.start",n.CLASS_STARTING="class.started",n.CLASS_PAUSING="class.pause",n.CLASS_PAUSING="class.closed",n.CLASS_PAUSING="class.update",n.CLASS_ACTION_CLOSE_ALL=1,n.CLASS_TYPE_INTERACT=1,n.CLASS_TYPE_LIVE=2,n.NR_NORMAL=1,n.NR_ADMIN=2,n.NR_HOST=4,n.NR_PRESENTER=8,n.NR_ASSISTANT=16,n.NR_INVISIBLE=32,n.host="host",n.presenter="presenter",n.assistant="assistant",n.normal="normal",n.record="record",n.invisible="invisible",n.userTypes={},n.userTypes[n.NR_NORMAL]=n.normal,n.userTypes[n.NR_ADMIN]=n.record,n.userTypes[n.NR_HOST]=n.host,n.userTypes[n.NR_PRESENTER]=n.presenter,n.userTypes[n.NR_ASSISTANT]=n.assistant,n.userTypes[n.NR_INVISIBLE]=n.invisible,n.userTypesToId={},n.userTypesToId[n.normal]=n.NR_NORMAL,n.userTypesToId[n.record]=n.NR_ADMIN,n.userTypesToId[n.host]=n.NR_HOST,n.userTypesToId[n.presenter]=n.NR_PRESENTER,n.userTypesToId[n.assistant]=n.NR_ASSISTANT,n.userTypesToId[n.invisible]=n.NR_INVISIBLE,n.MS_TYPE_DEFAULT=0,n.MS_TYPE_FMS=1,n.USER_HAND_UP=32,n.USER_MIC_OPEN=64,n.USER_CAMERA_OPEN=128,n.MEDIA_ACTION_DEFAULT=0,n.MEDIA_ACTION_OPEN_CAMERA=1,n.MEDIA_ACTION_CLOSE_CAMERA=2,n.MEDIA_ACTION_OPEN_MIC=21,n.MEDIA_ACTION_CLOSE_MIC=22,n.MEDIA_ACTION_SETING=31,n.CHANNEL_STATUS_RELEASED=0,n.CHANNEL_STATUS_OPENING=1,n.MEDIA_TYPE_DEFAULT=0,n.MEDIA_TYPE_VIDEO=1,n.MEDIA_TYPE_AUDIO=2,n.RETURN_SUCCESS=0,n.RETURN_FAILED=1,n.INVALIDATE_CHANNEL_ID=-1,n.INVALIDATE_NODE_ID=-1,n.DOC_ACTION_NORMAL=0,n.DOC_ACTION_SWITCH_DOC=1,n.DOC_ACTION_SWITCH_PAGE=2,n.DOC_ACTION_COMMAND=3,n.DOC_ACTION_SWITCH_ANIMATION=4,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){"use strict";function n(){}Object.defineProperty(t,"__esModule",{value:!0}),n.CLASS_INIT_SUCCESS="class_init_success",n.CLASS_JOIN_MCU_SUCCESS="class_join_mcu_success",n.CLASS_GET_INFO_SUCCESS="class_get_info_success",n.CLASS_JOIN_SUCCESS="class_join_success",n.CLASS_UPDATE_ROSTER_NUM="class_update_roster_num",n.CLASS_INSERT_ROSTER="class_insert_roster",n.CLASS_UPDATE_ROSTER="class_update_roster",n.CLASS_DELETE_ROSTER="class_delete_roster",n.CLASS_NONENTITY_ROSTER="class_nonenetity_roster",n.CLASS_RUN_EXIT="class_run_exit",n.CLASS_EXIT="class_exit",n.CLASS_UPTATE_STATUS="class_update_status",n.CLASS_STATUS_INFO_CHANGE="class_status_info_change",n.CLASS_UPDATE_TIMER="class_update_timer",n.CLASS_RECORD_START="class_record_start",n.CLASS_RECORD_SUCCESS="class_record_success",n.CHAT_RECEIVE="chat_receive_message",n.USER_DEVICE_STATUS_CHAANGE="user_device_status_change",n.VIDEO_PLAY="video_play",n.VIDEO_STOP="video_stop",n.VIDEO_UPDATE="video_update",n.VIDEO_BROADCAST="video_broadcast",n.VIDEO_GET_PUBLISH_PATH="video_get_publish_path",n.VIDEO_PUBLISH_RESULT="video_publish_result",n.AUDIO_PLAY="audio_play",n.AUDIO_STOP="audio_stop",n.AUDIO_UPDATE="audio_update",n.AUDIO_BROADCAST="audio_broadcast",n.AUDIO_GET_PUBLISH_PATH="audio_get_publish_path",n.AUDIO_PUBLISH_RESULT="audio_publish_result",n.DOC_DELETE="document_delete",n.DOC_UPDATE="document_update",n.DOC_BROADCAST="doc_broadcast",n.WHITEBOARD_ANNOTATION_UPDATE="whiteboard_annotation_update",n.SWITCH_MCU_IP="switch_mcu_ip",n.SWITCH_MS_IP="switch_ms_ip",n.RECORD_PLAYBACK_UPDATE="record_playback_update",n.MCU_ERROR="mcu_error",n.ERROR_EVENT="error_event",n.ERR_CLASS_INIT_PARAM=100,n.ERR_CLASS_INIT_NETWORK=101,n.ERR_CLASS_INIT_PROTOCOL=102,n.ERR_CLASS_INIT_FAILED=103,n.ERR_CLASS_INIT_FAILED_1=104,n.ERR_CLASS_INIT_FAILED_2=105,n.ERR_CLASS_INIT_FAILED_3=106,n.ERR_CLASS_INIT_FAILED_4=107,n.ERR_CLASS_JOIN_NETWORK=200,n.ERR_CLASS_JOIN_PROTOCOL=201,n.ERR_CLASS_JOIN_FAILED=202,n.ERR_CLASS_JOIN_PARAM=203,n.ERR_CLASS_JOIN_FULL=204,n.ERR_CLASS_MD5_WRONG=205,n.ERR_CLASS_PASSWORD_WRONG=206,n.ERR_CLASS_JOIN_CONFILICT=207,n.ERR_CLASS_KICK_OUT=208,n.ERR_CLASS_REMOTE_LANDING=209,n.ERR_GET_CLASS_DETAIL=300,n.ERR_GET_CLASS_PARAML=301,n.ERR_APE_SEND_FAILED_NO_JOIN=500,n.ERR_APE_INTERFACE_PARAM_WRONG=501,n.ERR_DOC_DELETE_FAILED=600,n.ERR_DOC_DELETE_FAILED_PARAM=601,n.ERR_SDK_FAILED=700,n.ERR_INTERFACE_NONE=701,n.ERR_INTERFACE_PARAMS_ERROR=702,n.ERR_INIT_RECORD_PLAY_BACK_FAILED=910,n.ERR_GET_RECORD_PLAY_BACK_DATA_FAILED=911,n.ERR_NETWORK=1e4,n.ERR_UNKNOWN=10001,n.ERR_SOCKET_DISCONNECT=2e4,n.ERR_SOCKET_RECONNECT_FAILED=20001,n.ErrorReson={},n.ErrorReson[n.ERR_CLASS_INIT_PARAM]="初始化参数错误",n.ErrorReson[n.ERR_CLASS_INIT_NETWORK]="初始化网络错误",n.ErrorReson[n.ERR_CLASS_INIT_PROTOCOL]="初始化协议错误",n.ErrorReson[n.ERR_CLASS_INIT_FAILED]="初始化验证失败",n.ErrorReson[n.ERR_CLASS_INIT_FAILED_1]="初始化验证失败,课堂号必填",n.ErrorReson[n.ERR_CLASS_INIT_FAILED_2]="初始化验证失败,无效的课堂号",n.ErrorReson[n.ERR_CLASS_INIT_FAILED_3]="初始化验证失败,没有对应的站点",n.ErrorReson[n.ERR_CLASS_INIT_FAILED_4]="初始化验证失败,站点已过期",n.ErrorReson[n.ERR_CLASS_JOIN_NETWORK]="加入课堂网络错误",n.ErrorReson[n.ERR_CLASS_JOIN_PROTOCOL]="加入课堂化协议错误",n.ErrorReson[n.ERR_CLASS_JOIN_FAILED]="加入课堂化异常错误",n.ErrorReson[n.ERR_CLASS_JOIN_PARAM]="加入课堂参数错误",n.ErrorReson[n.ERR_CLASS_JOIN_FULL]="人数已满",n.ErrorReson[n.ERR_CLASS_MD5_WRONG]="MD5验证失败",n.ErrorReson[n.ERR_CLASS_PASSWORD_WRONG]="密码错误",n.ErrorReson[n.ERR_CLASS_JOIN_CONFILICT]="已经在其它地方登陆",n.ErrorReson[n.ERR_CLASS_KICK_OUT]="有相同身份的人员加入课堂,自己被踢出课堂",n.ErrorReson[n.ERR_CLASS_REMOTE_LANDING]="有相同的userId异地登陆",n.ErrorReson[n.ERR_GET_CLASS_DETAIL]="获取课堂基本信息失败",n.ErrorReson[n.ERR_GET_CLASS_PARAML]="获取课堂详细信息失败",n.ErrorReson[n.ERR_APE_SEND_FAILED_NO_JOIN]="APE在sdk为初始化或未加入课堂之前调用发送数据接口",n.ErrorReson[n.ERR_APE_INTERFACE_PARAM_WRONG]="APE在接口调用时参数错误",n.ErrorReson[n.ERR_DOC_DELETE_FAILED]="删除文档失败",n.ErrorReson[n.ERR_DOC_DELETE_FAILED_PARAM]="删除文档失败,参数错误",n.ErrorReson[n.ERR_SDK_FAILED]="sdk还没初始化",n.ErrorReson[n.ERR_INTERFACE_NONE]="调用的接口不存在",n.ErrorReson[n.ERR_INTERFACE_PARAMS_ERROR]="调用的接口,传递的参数不正确",n.ErrorReson[n.ERR_INIT_RECORD_PLAY_BACK_FAILED]="初始化录制回放失败",n.ErrorReson[n.ERR_GET_RECORD_PLAY_BACK_DATA_FAILED]="获取录制回放数据失败",n.ErrorReson[n.ERR_NETWORK]="网络错误",n.ErrorReson[n.ERR_UNKNOWN]="未知错误",n.ErrorReson[n.ERR_SOCKET_DISCONNECT]="MCU断开连接,已经离开课堂",n.ErrorReson[n.ERR_SOCKET_RECONNECT_FAILED]="MCU自动重连失败,已经达到最大重连次数";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,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")}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}}(),o=n(13),s=r(o),u=n(14),l=r(u),f=function(){function e(){i(this,e)}return a(e,null,[{key:"isEmptyObject",value:function(e){for(var t in e)return!1;return!0}},{key:"arrayToJsonString",value:function(e){try{return JSON.stringify(e)}catch(e){console.log("arrayToJsonString error:"+e.message)}return null}},{key:"arrayFromJsonString",value:function(e){try{return JSON.parse(e)}catch(e){console.log("arrayFromJsonString error:"+e.message)}return null}},{key:"creatSoleNumberFromTimestamp",value:function(){var e=(new Date).getTime(),t=e%1e9;return t}},{key:"creatTimestamp",value:function(){var e=parseInt((new Date).getTime()/1e3);return e}},{key:"creatTimestampStr",value:function(){var e=new Date,t=""+e.getFullYear()+"-";return t+=e.getMonth()+1+"-",t+=e.getDate()+"-",t+=e.getHours()+"-",t+=e.getMinutes()+"-",t+=e.getSeconds()}},{key:"creatTimestampYMD",value:function(){var e=new Date,t=""+e.getFullYear(),n=""+(e.getMonth()+1),r=""+e.getDate();return n.length<2&&(n="0"+n),r.length<2&&(r="0"+r),t+n+r}},{key:"objectToBase64",value:function(e){try{var t=JSON.stringify(e),n=l.default.setBytesFromString(t),r=s.default.fromByteArray(n);return r}catch(e){return console.log("objectToBase64 err:"+e.message),""}return""}},{key:"objectFromBase64",value:function(e){try{var t=s.default.toByteArray(e),n=l.default.getStringFromBytes(t),r=JSON.parse(n);return r}catch(e){return console.log("objectFromBase64 err:"+e.message),null}return null}}]),e}(),d=f;t.default=d;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(f,"EngineUtils","D:/work/McuClient/src/EngineUtils.js"),__REACT_HOT_LOADER__.register(d,"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")}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}}(),o=n(1),s=r(o),u=n(2),l=r(u),f=n(4),d=r(f),c=s.default.getLoger("GlobalConfig"),h=function(){function e(){i(this,e),this._currentStatus=null}return a(e,null,[{key:"getCurrentStatus",value:function(){return null==this._currentStatus&&(this._currentStatus=this.statusCode_0),this._currentStatus}},{key:"setCurrentStatus",value:function(e){this._currentStatus=e}},{key:"getClassDetail",value:function(){return this.classDetail}},{key:"setClassDetail",value:function(e){this.classDetail=e}},{key:"getClassInfo",value:function(){var e={};return e.siteId=this.siteId,e.classId=this.classId,e.className=this.className,e.h5Module=this.h5Module,e.nodeId=this.nodeId,e.topNodeID=this.topNodeID,e.userRole=this.userRole,e.role=this.role,e.isHost=this.isHost,e.userId=this.userId,e.userName=this.userName,e.password=this.password,e.userType=this.userType,e.passwordRequired=this.passwordRequired,e.md5=this.md5,e.msType=this.msType,e.portal=this.portal,e.mcuDelay=this.mcuDelay,e.MCUServerIP=this.MCUServerIP,e.MCUServerPort=this.MCUServerPort,e.maxVideoChannels=this.maxVideoChannels,e.maxAudioChannels=this.maxAudioChannels,e.maxMediaChannels=this.maxMediaChannels,e.fps=this.fps,e.gop=this.gop,e.videoQuality=this.videoQuality,e}},{key:"setClassStatusInfo",value:function(e){if(c.log("setClassStatusInfo"),null==e)return void c.warn("classStatusInfo error,_data:",e);var t=e;this.siteId=t.siteId||this.siteId,this.classId=t.classId||this.classId,this.className=t.className||this.className,this.classType=t.classType||this.classType,this.classStatus=t.classStatus||this.classStatus,this.classStartTime=t.classStartTime||this.classStartTime,this.classStopTime=t.classStopTime||this.classStopTime,this.classTimestamp=t.classTimestamp||this.classTimestamp,this.classBeginTime=t.classBeginTime||this.classBeginTime,this.classEndTime=t.classEndTime||this.classEndTime,this.recordStatus=t.recordStatus||this.recordStatus,this.recordTimestamp=t.recordTimestamp||this.recordTimestamp,this.recordFileName=t.recordFileName||this.recordFileName,this.recordDownloadUrl=t.recordDownloadUrl||this.recordDownloadUrl}},{key:"setDocListPrepare",value:function(e){null!=e&&(this.docListPrepare=e)}},{key:"getDocListPrepare",value:function(){return this.docListPrepare}},{key:"setRecordList",value:function(e){null!=e&&(this.recordList=e)}},{key:"getRecordList",value:function(){return this.recordList}},{key:"setDocList",value:function(e){null!=e&&(this.docList=e)}},{key:"getDocList",value:function(){return this.docList}},{key:"setMsList",value:function(t){if(null!=t)if(e.siteId==e.siteId_letv){this.msList=[],this.pullRtmpList=[],this.hlsList=[];for(var n=t.length,r=0;r<n;r++){var i=t[r];i&&i.ip&&(i.ip.indexOf("pull.")>=0?this.pullRtmpList.push(i):i.ip.indexOf("lehls.")>=0?this.hlsList.push(i):this.msList.push(i))}c.log("msListAll->",t),c.log("msList->",this.msList),c.log("pullList->",this.pullRtmpList),c.log("hlsList->",this.hlsList)}else this.msList=t}},{key:"getMsList",value:function(){return this.msList}},{key:"setMcuList",value:function(e){null!=e&&(this.mcuList=e)}},{key:"getMcuList",value:function(){return this.mcuList}},{key:"setMusicList",value:function(e){null!=e&&(this.musicList=e)}},{key:"getMusicList",value:function(){return this.musicList}},{key:"setMusicListPrepare",value:function(e){null!=e&&(this.musicListPrepare=e)}},{key:"getMusicListPrepare",value:function(){return this.musicListPrepare}},{key:"setRsList",value:function(e){null!=e&&(this.rsList=e)}},{key:"getRsList",value:function(){return this.rsList}},{key:"classStatusInfo",get:function(){var e={};return e.siteId=this.siteId,e.classId=this.classId,e.className=this.className,e.classType=this.classType,e.classStatus=this.classStatus,e.classStartTime=this.classStartTime,e.classStopTime=this.classStopTime,e.classTimestamp=this.classTimestamp,e.recordPlaybackMaxTime=this.recordPlaybackMaxTime,e.classBeginTime=this.classBeginTime,e.classEndTime=this.classEndTime,e.recordStatus=this.recordStatus,e.recordTimestamp=this.recordTimestamp,e.recordFileName=this.recordFileName,e.recordDownloadUrl=this.recordDownloadUrl,e.serverTimestamp=this.serverTimestamp,e.activeDocId=this.activeDocId,e.activeDocCurPage=this.activeDocCurPage,e}},{key:"isHost",get:function(){return this.userRole==l.default.host}},{key:"isAssistant",get:function(){return this.userRole==l.default.assistant}},{key:"isPresenter",get:function(){return this.userRole==l.default.presenter}},{key:"isNormal",get:function(){return this.userRole==l.default.normal}},{key:"isInvisible",get:function(){return this.userRole==l.default.invisible}},{key:"serverTimestamp",get:function(){return d.default.creatTimestamp()}}]),e}();h.statusCode_0={code:0,message:"SDK 未初始化"},h.statusCode_1={code:1,message:"未加入课堂"},h.statusCode_2={code:2,message:"已经加入课堂"},h.statusCode_3={code:3,message:"已经离开课堂"},h.statusCode_4={code:4,message:"未知状态"},h.md5="",h.msType=1,h.messageDelay=!1,h.mcuDelay=0,h.docDelay=1600,h.portal="112.126.80.182:80",h.MCUServerIP="",h.MCUServerPort="",h.MS_PUBLISH_IP="",h.MS_PUBLISH_PORT="",h.MS_PLAY_RTMP_IP="",h.MS_PLAY_RTMP_PORT="",h.MS_PLAY_HLS_IP="",h.MS_PLAY_HLS_PORT="",h.RS_RECORD_PLAY_IP="",h.RS_RECORD_PLAY_PORT="",h.DOCServerIP="",h.DOCServerPort="",h.RecordServerIP="",h.RecordServerPort="",h.maxVideoChannels=0,h.maxAudioChannels=0,h.maxMediaChannels=0,h.hasCamera=!1,h.hasMicrophone=!1,h.deviceType=0,h.userIp="",h.userId=0,h.userName="",h.handUpTime=0,h.level=0,h.openCamera=0,h.openMicrophones=0,h.fps=15,h.gop=3,h.videoQuality=2,h.cameras=[],h.microphones=[],h.curCamera="",h.curMicrophone="",h.curVideoQuality=0,h.micGain=50,h.speakerVolume=50,h.micCode=0,h.audioRecords=[],h.videoRecords=[],h.status=0,h.mobileDirection=0,h.nodeId=0,h.passwordRequired=!1,h.password="",h.userType=8,h.userRole=l.default.normal,h.role=l.default.NR_NORMAL,h.h5Module=1,h.topNodeID=101,h.siteId="",h.className="",h.classId=0,h.classType=l.default.CLASS_TYPE_INTERACT,h.classStatus=l.default.CLASS_STATUS_WAIT,h.classStartTime="",h.classStopTime="",h.classBeginTime="",h.classEndTime="",h.classTimestamp=0,h.recordPlaybackMaxTime=0,h.recordStatus=!1,h.recordTimestamp=0,h.recordFileName="",h.recordDownloadUrl="",h.recordReplaytickValues={},h.isAutoStartClass=0,h.updateClassInfoDelay=30,h.msDynamicChooseIpDelay=15,h.activeDocId=0,h.activeDocCurPage=1,h.classAllParam={},h.classDetail={},h.docListPrepare=[],h.recordList=[],h.docList=[],h.mcuList=[],h.msList=[],h.musicList=[],h.musicListPrepare=[],h.rsList=[],h.pullRtmpList=[],h.hlsList=[],h.mcuListFromServer=[],h.msListFromServer=[],h.country="",h.city="",h.province="",h.isp="",h.mcuListAll=[],h.msListAll=[],h.isRecordPlayBack=!1,h.allowRecordMaxTime=14400,h.siteId_letv="shchuanbao";var p=h;t.default=p;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(c,"loger","D:/work/McuClient/src/GlobalConfig.js"),__REACT_HOT_LOADER__.register(h,"GlobalConfig","D:/work/McuClient/src/GlobalConfig.js"),__REACT_HOT_LOADER__.register(p,"default","D:/work/McuClient/src/GlobalConfig.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n,r,i,a,o,s,u,l,f){var d=new _.RCSendDataPdu;return d.set("type",e),d.set("subType",t),d.set("initiator",n),d.set("confId",r),d.set("sessionId",i),d.set("channelId",a),d.set("upward",o),d.set("reliability",s),d.set("priority",u),d.set("peer",l),d.set("seg",f),d}Object.defineProperty(t,"__esModule",{value:!0});var a=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},o=n(50),s=r(o),u=n(45),l=r(u),f=n(15),d=r(f),c=n(11),h=r(c),p=s.default.newBuilder({convertFieldsToCamelCase:!0});s.default.loadProto(l.default,p);var _=p.build();_.decode_pdu=function(e){return _.RCSendDataPdu.decode(e)},_.create_join_class_request_pdu=function(e,t,n,r,a,o,s,u,l){return i(d.default.RCPDU_CONNECT_PROVIDER_REQUEST,e,t,n,r,a,!0,o,s,u,l)},_.create_uniform_pdu=function(e,t,n,r,a,o,s,u,l){return i(d.default.RCPDU_UNIFORM_SEND_DATA_REQUEST,e,t,n,r,a,!0,o,s,u,l)},_.create_normal_pdu=function(e,t,n,r,a,o,s,u,l,f){return i(d.default.RCPDU_SEND_DATA_REQUEST,e,t,n,r,a,o,s,u,l,f)},_.id2type=function(e){for(var t in d.default)if(d.default[t]===e)return t},_=a({},_,d.default,h.default);var E=_;t.default=E;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(p,"builder","D:/work/McuClient/src/pdus/index.js"),__REACT_HOT_LOADER__.register(_,"pdu","D:/work/McuClient/src/pdus/index.js"),__REACT_HOT_LOADER__.register(i,"create_pdu","D:/work/McuClient/src/pdus/index.js"),__REACT_HOT_LOADER__.register(E,"default","D:/work/McuClient/src/pdus/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,n){if(e){var r=this.MAPS["*"];r&&r.length&&r.forEach(function(r){r(e,t,n)});var i=this.MAPS[e];i&&i.length&&i.forEach(function(e){e(t,n)})}}}]),e}(),a=i;t.default=a;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"Emiter","D:/work/McuClient/src/Emiter.js"),__REACT_HOT_LOADER__.register(a,"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 a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=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),l=r(u),f=n(7),d=r(f),c=n(22),h=r(c),p=n(1),_=r(p),E=n(3),g=r(E),y=n(2),R=r(y),m=n(10),v=r(m),T=n(11),C=r(T),S=n(5),I=r(S),A=n(18),b=r(A),w=_.default.getLoger("Ape"),D=function(e){function t(e,n,r){i(this,t);var o=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o._session_id=e,o._channel_id=e,o._session_name=n,o._session_tag=r,o._session_channels={},o._adapter_pdu=new l.default.RCAdapterPdu,o._classInfo=null,o._rCArrayBufferUtil=v.default,o._apeDelayed=!0,o._apeDelayedMsgs=[],o._apeDelayedTimer=0,o.on(l.default.RCPDU_SESSION_JOIN_RESPONSE,o._joinSessionHandler.bind(o)),o.on(l.default.RCPDU_CHANNEL_JOIN_RESPONSE,o._joinChannelHandler.bind(o)),o.on(l.default.RCPDU_REG_ADAPTER,o._pduMessageHandler.bind(o)),o.mcu=h.default,o.mcu.on(g.default.CLASS_JOIN_MCU_SUCCESS,o._mcuConferenceJoinSuccessHandler.bind(o)),o.mcu.registerApe(o),o.recordPlayBackParse=b.default,o.recordPlayBackParse.on(b.default.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS,o._joinRecordPlaybackSuccessHandler.bind(o)),o.recordPlayBackParse.registerApe(o),o}return o(t,e),s(t,[{key:"regResponsePduHandler",value:function(){}},{key:"stopApe",value:function(){w.log("stopApe==============================")}},{key:"_pduMessageHandler",value:function(e,t){var n=t||0;this._pduRegAdapterHandler(e,n)}},{key:"_pduRegAdapterHandler",value:function(e,t){for(var n=l.default.RCAdapterPdu.decode(e),r=n.item,i=r.length,a=0;a<i;++a){var o=r[a],s=o.type,u=o.itemData;if(l.default.RCPDU_REG_UPDATE_OBJ===s){var f=l.default.RCRegistryUpdateObjPdu.decode(u),d=f.subType,c=f.objId,h=f.userData;switch(w.log("REG OBJECT EVENT ->",l.default.id2type(d)),d){case l.default.RCPDU_REG_ROSTER_INSERT_PDU:w.log("RCPDU_REG_ROSTER_INSERT_PDU---->"),console.log(h);for(var p=l.default.RCRegistryRosterInsertItemPdu.decode(h),_=p.items,E=_.length,g=0;g<E;++g){var y=_[g],R=y.item_id,m=l.default.RCNodeInfoRecordPdu.decode(y.item_data);this.rosterInsertHandler(R,m)}break;case l.default.RCPDU_REG_ROSTER_DELETE_PDU:var v=l.default.RCRegistryRosterDeleteItemPdu.decode(h);this.rosterDelHandler(v.nodeId);break;case l.default.RCPDU_REG_ROSTER_UPDATE_PDU:for(var T=l.default.RCRegistryRosterUpdateItemPdu.decode(h),C=T.items,S=C.length,I=0;I<S;++I){var A=C[I],b=A.nodeId,D=l.default.RCNodeInfoRecordPdu.decode(A.nodeData);this.rosterUpdateHandler(b,D)}break;case l.default.RCPDU_REG_TABLE_INSERT_PDU:for(var P=l.default.RCRegistryTableInsertItemPdu.decode(h),O=P.items,N=O.length,U=0;U<N;++U){var L=O[U];this.tableInsertHandler(L.owner,L.itemIdx,L.itemData)}this.tableInsertApeHandler(O);break;case l.default.RCPDU_REG_TABLE_DELETE_PDU:var k=l.default.RCRegistryTableDeleteItemPdu.decode(h);this.tableDeleteHandler(c,k);break;case l.default.RCPDU_REG_TABLE_UPDATE_PDU:for(var M=l.default.RCRegistryTableUpdateItemPdu.decode(h),x=M.items,B=x.length,F=0;F<B;++F){var H=x[F];this.tableUpdateHandler(H.owner,H.itemIdx,H.itemData,t)}this.tableUpdateApeHandler(x);break;case l.default.RCPDU_REG_QUEUE_UPDATE_PDU:case l.default.RCPDU_REG_QUEUE_DELETE_PDU:case l.default.RCPDU_REG_QUEUE_INSERT_PDU:w.warn("REG QUEUE ARE IGNORED")}}else if(l.default.RCPDU_REG_RESPONSE_OBJ==s){var j=l.default.RCRegistryResponseObjPdu.decode(u);this.regResponsePduHandler(j)}}}},{key:"rosterInsertHandler",value:function(e,t){}},{key:"rosterUpdateHandler",value:function(e,t){}},{key:"rosterDelHandler",value:function(e){}},{key:"tableInsertHandler",value:function(e,t){}},{key:"tableUpdateHandler",value:function(e,t,n,r){}},{key:"tableUpdateApeHandler",value:function(e,t){}},{key:"tableInsertApeHandler",value:function(e,t){}},{key:"tableDeleteHandler",value:function(e,t){}},{key:"onJoinChannelHandlerSuccess",value:function(){}},{key:"onJoinSessionHandlerSuccess",value:function(){}},{key:"_joinSessionHandler",value:function(e){this.onJoinSessionHandlerSuccess()}},{key:"_joinChannelHandler",value:function(e){var t=l.default.RCChannelJoinResponsePdu.decode(e);t.result===l.default.RET_SUCCESS?(w.log(this._session_name," -> 加入Channel成功. ChannelId",t.requestedChannelId),this._session_channels[t.requestedChannelId]=R.default.CJS_JOINNED,this.onJoinChannelHandlerSuccess()):w.log(this._session_name," -> 加入Channel失败.",t)}},{key:"_mcuConferenceJoinSuccessHandler",value:function(e){w.log("创建Ape->","SessionId",this._session_id,"SessionName",this._session_name,"SessionTag",this._session_tag),this._classInfo=I.default.getClassInfo();var t=new l.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 l.default.RCChannelJoinRequestPdu;n.initiator=this.mcu.classInfo.nodeId,n.channelId=this._session_id,this.send(n)}},{key:"_joinRecordPlaybackSuccessHandler",value:function(e){w.log("录制回放->Ape已经创建完毕->","SessionId",this._session_id,"SessionName",this._session_name,"SessionTag",this._session_tag)}},{key:"registerKey",value:function(e,t,n,r){var i=new l.default.RCAdapterItemPdu;i.type=l.default.RCPDU_REG_REGISTER_KEY;var a=new l.default.RCRegistryRegisterKeyPdu;a.id=e,a.name=t,a.tag=n,r.length&&(a.userData=r),i.itemData=a.toArrayBuffer(),this._adapter_pdu.item.push(i)}},{key:"registerObj",value:function(e,t,n,r,i,a){var o=new l.default.RCAdapterItemPdu;o.type=l.default.RCPDU_REG_REGISTER_OBJ;var s=new l.default.RCRegistryRegisterObjPdu;s.type=e,s.objId=t,s.name=n,s.tag=r,i&&(s.owner=i),a.length&&(s.userData=a),o.itemData=s.toArrayBuffer(),this._adapter_pdu.item.push(o)}},{key:"send",value:function(e){if(w.log("Ape发送数据NORMAL PDU"),0==I.default.getCurrentStatus().code||1==I.default.getCurrentStatus().code)return void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_SEND_FAILED_NO_JOIN);var t=l.default.create_normal_pdu(e.type,this._classInfo.nodeId,this._classInfo.classId,this._session_id,this._channel_id,!0,!0,C.default.DP_TOP,this._classInfo.topNodeID,C.default.SEG_ONCE); +t.data=e.toArrayBuffer(),this.mcu.send(t)}},{key:"sendUniform",value:function(e,t){if(w.log("Ape发送数据UNIFORM PDU"),0==I.default.getCurrentStatus().code||1==I.default.getCurrentStatus().code)return void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_SEND_FAILED_NO_JOIN);var n=l.default.create_uniform_pdu(e.type,this._classInfo.nodeId,this._classInfo.classId,this._session_id,t?R.default.BROADCAST_CHANNEL_ID:this._channel_id,!0,C.default.DP_TOP,t?this._classInfo.topNodeID:e.peer||0,C.default.SEG_ONCE);n.data=e.toArrayBuffer(),this.mcu.send(n)}},{key:"sendChatUniform",value:function(e,t){if(0==I.default.getCurrentStatus().code||1==I.default.getCurrentStatus().code)return void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_SEND_FAILED_NO_JOIN);var n=l.default.create_uniform_pdu(e.type,this._classInfo.nodeId,this._classInfo.classId,this._session_id,t?R.default.BROADCAST_CHANNEL_ID:this._channel_id,!0,C.default.DP_TOP,0,C.default.SEG_ONCE);n.data=e.toArrayBuffer(),w.log("Ape发送数据UNIFORM PDU",n),this.mcu.send(n)}}]),t}(d.default),P=D;t.default=P;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(w,"loger","D:/work/McuClient/src/apes/Ape.js"),__REACT_HOT_LOADER__.register(D,"Ape","D:/work/McuClient/src/apes/Ape.js"),__REACT_HOT_LOADER__.register(P,"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(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 a=[];for(n=0;n<r;n++)i=e.charCodeAt(n),i>=1&&i<=127?a.push(i):i>2047?(a.push(224|i>>12&15),a.push(128|i>>6&63),a.push(128|i>>0&63)):(a.push(192|i>>6&31),a.push(128|i>>0&63));return new Uint8Array(a)}},{key:"uint8ArrayToStr",value:function(e,t){var n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0;for(n="",i=e.buffer.byteLength,r=e.offset+t;r<e.limit;)switch(a=e.view[r++],a>>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:o=e.view[r++],n+=String.fromCharCode((31&a)<<6|63&o);break;case 14:o=e.view[r++],s=e.view[r++],n+=String.fromCharCode((15&a)<<12|(63&o)<<6|(63&s)<<0)}return n}}]),e}(),a=i;t.default=a;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"ArrayBufferUtil","D:/work/McuClient/src/libs/ArrayBufferUtil.js"),__REACT_HOT_LOADER__.register(a,"default","D:/work/McuClient/src/libs/ArrayBufferUtil.js"))})()},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/pdus/PduConsts.js")})()},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},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,a,o,s,u=e.length;o=n(e),s=new f(3*u/4-o),i=o>0?u-4:u;var d=0;for(t=0,r=0;t<i;t+=4,r+=3)a=l[e.charCodeAt(t)]<<18|l[e.charCodeAt(t+1)]<<12|l[e.charCodeAt(t+2)]<<6|l[e.charCodeAt(t+3)],s[d++]=a>>16&255,s[d++]=a>>8&255,s[d++]=255&a;return 2===o?(a=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,s[d++]=255&a):1===o&&(a=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,s[d++]=a>>8&255,s[d++]=255&a),s}function a(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function o(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(a(r));return i.join("")}function s(e){for(var t,n=e.length,r=n%3,i="",a=[],s=16383,l=0,f=n-r;l<f;l+=s)a.push(o(e,l,l+s>f?f:l+s));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+="="),a.push(i),a.join("")}t.byteLength=r,t.toByteArray=i,t.fromByteArray=s;for(var u=[],l=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,h=d.length;c<h;++c)u[c]=d[c],l[d.charCodeAt(c)]=c;l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},function(e,t,n){(function(e){e.require&&(n(30),n(51));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,a="";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(a="00000000".slice(0,r)+1+"00000000".slice(r+1),e[n]&parseInt(a,2))throw Error("Index "+n+": A "+r+" bytes encoded char cannot encode the "+(r+1)+"th rank bit to 1.");for(a="0000".slice(0,r+1)+"11111111".slice(r+1),i+=(e[n]&parseInt(a,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 a,o=[];for(n|=0,r="number"==typeof r?r:e.byteLength||e.length;n<r;n++){if(a=t.getCharLength(e[n]),n+a>r){if(i)throw Error("Index "+n+": Found a "+a+" bytes encoded char declaration but only "+(r-n)+" bytes are available.")}else o.push(String.fromCodePoint(t.getCharCode(e,n,a,i)));n+=a-1}return o.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,a){e=e||"",n=n||[],r|=0,i="number"==typeof i?i:n.byteLength||1/0;for(var o=0,s=e.length;o<s;o++){var u=t.getBytesForCharCode(e[o].codePointAt(0));if(a&&r+u>i)throw new Error('Not enought bytes to encode the char "'+e[o]+'" at the offset "'+r+'".');t.setBytesFromCharCode(e[o].codePointAt(0),n,r,u,a),r+=u}return n}};e.exports=t}).call(t,n(9)(e))},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_UNIFORM_SEND_DATA_REQUEST=125,n.RCPDU_SEND_DATA_REQUEST=120,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_INDICATION=121,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_CONFERENCE_RECORD_REQUEST=270,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,n.RCPDU_SEND_CONFERENCE_DATA_REQUEST=500,n.RCPDU_SEND_VIDEO_DATA_REQUEST=501,n.RCPDU_SEND_AUDIO_DATA_REQUEST=502,n.RCPDU_SEND_GIFT_DATA_REQUEST=503,n.RCPDU_SEND_CHAT_DATA_REQUEST=504,n.RCPDU_THIRD_BROADCAST_DATA_REQUEST=505,n.RCPDU_SEND_DOC_BROADCAST_DATA_REQUEST=506;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&__REACT_HOT_LOADER__.register(n,"RCPduPackage","D:/work/McuClient/src/pdus/PduType.js")})()},function(e,t,n){var r,i,a;(function(e){!function(o,s){n(12).amd?(i=[],r=s,a="function"==typeof r?r.apply(t,i):r,!(void 0!==a&&(e.exports=a))):"object"==typeof e&&e&&e.exports?e.exports=s():(o.dcodeIO=o.dcodeIO||{}).Long=s()}(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,a;return t?(e>>>=0,(a=0<=e&&e<256)&&(r=u[e])?r:(n=i(e,(0|e)<0?-1:0,!0),a&&(u[e]=n),n)):(e|=0,(a=-128<=e&&e<128)&&(r=s[e])?r:(n=i(e,e<0?-1:0,!1),a&&(s[e]=n),n))}function r(e,t){if(isNaN(e)||!isFinite(e))return t?E:_;if(t){if(e<0)return E;if(e>=c)return v}else{if(e<=-h)return T;if(e+1>=h)return m}return e<0?r(-e,t).neg():i(e%d|0,e/d|0,t)}function i(t,n,r){return new e(t,n,r)}function a(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 a(e.substring(1),t,n).neg();for(var o=r(l(n,8)),s=_,u=0;u<e.length;u+=8){var f=Math.min(8,e.length-u),d=parseInt(e.substring(u,u+f),n);if(f<8){var c=r(l(n,f));s=s.mul(c).add(r(d))}else s=s.mul(o),s=s.add(r(d))}return s.unsigned=t,s}function o(t){return t instanceof e?t:"number"==typeof t?r(t):"string"==typeof t?a(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 s={},u={};e.fromInt=n,e.fromNumber=r,e.fromBits=i;var l=Math.pow;e.fromString=a,e.fromValue=o;var f=1<<24,d=4294967296,c=0x10000000000000000,h=c/2,p=n(f),_=n(0);e.ZERO=_;var E=n(0,!0);e.UZERO=E;var g=n(1);e.ONE=g;var y=n(1,!0);e.UONE=y;var R=n(-1);e.NEG_ONE=R;var m=i(-1,2147483647,!1);e.MAX_VALUE=m;var v=i(-1,-1,!0);e.MAX_UNSIGNED_VALUE=v;var T=i(0,-2147483648,!1);e.MIN_VALUE=T;var C=e.prototype;return C.toInt=function(){return this.unsigned?this.low>>>0:this.low},C.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},C.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(T)){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 a=r(l(e,6),this.unsigned),o=this,s="";;){var u=o.div(a),f=o.sub(u.mul(a)).toInt()>>>0,d=f.toString(e);if(o=u,o.isZero())return d+s;for(;d.length<6;)d="0"+d;s=""+d+s}},C.getHighBits=function(){return this.high},C.getHighBitsUnsigned=function(){return this.high>>>0},C.getLowBits=function(){return this.low},C.getLowBitsUnsigned=function(){return this.low>>>0},C.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?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},C.isZero=function(){return 0===this.high&&0===this.low},C.isNegative=function(){return!this.unsigned&&this.high<0},C.isPositive=function(){return this.unsigned||this.high>=0},C.isOdd=function(){return 1===(1&this.low)},C.isEven=function(){return 0===(1&this.low)},C.equals=function(e){return t(e)||(e=o(e)),(this.unsigned===e.unsigned||this.high>>>31!==1||e.high>>>31!==1)&&(this.high===e.high&&this.low===e.low)},C.eq=C.equals,C.notEquals=function(e){return!this.eq(e)},C.neq=C.notEquals,C.lessThan=function(e){return this.comp(e)<0},C.lt=C.lessThan,C.lessThanOrEqual=function(e){return this.comp(e)<=0},C.lte=C.lessThanOrEqual,C.greaterThan=function(e){return this.comp(e)>0},C.gt=C.greaterThan,C.greaterThanOrEqual=function(e){return this.comp(e)>=0},C.gte=C.greaterThanOrEqual,C.compare=function(e){if(t(e)||(e=o(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},C.comp=C.compare,C.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(g)},C.neg=C.negate,C.add=function(e){t(e)||(e=o(e));var n=this.high>>>16,r=65535&this.high,a=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,f=e.low>>>16,d=65535&e.low,c=0,h=0,p=0,_=0;return _+=s+d,p+=_>>>16,_&=65535,p+=a+f,h+=p>>>16,p&=65535,h+=r+l,c+=h>>>16,h&=65535,c+=n+u,c&=65535,i(p<<16|_,c<<16|h,this.unsigned)},C.subtract=function(e){return t(e)||(e=o(e)),this.add(e.neg())},C.sub=C.subtract,C.multiply=function(e){if(this.isZero())return _;if(t(e)||(e=o(e)),e.isZero())return _;if(this.eq(T))return e.isOdd()?T:_;if(e.eq(T))return this.isOdd()?T:_;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(p)&&e.lt(p))return r(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,a=65535&this.high,s=this.low>>>16,u=65535&this.low,l=e.high>>>16,f=65535&e.high,d=e.low>>>16,c=65535&e.low,h=0,E=0,g=0,y=0;return y+=u*c,g+=y>>>16,y&=65535,g+=s*c,E+=g>>>16,g&=65535,g+=u*d,E+=g>>>16,g&=65535,E+=a*c,h+=E>>>16,E&=65535,E+=s*d,h+=E>>>16,E&=65535,E+=u*f,h+=E>>>16,E&=65535,h+=n*c+a*d+s*f+u*l,h&=65535,i(g<<16|y,h<<16|E,this.unsigned)},C.mul=C.multiply,C.divide=function(e){if(t(e)||(e=o(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?E:_;var n,i,a;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return E;if(e.gt(this.shru(1)))return y;a=E}else{if(this.eq(T)){if(e.eq(g)||e.eq(R))return T;if(e.eq(T))return g;var s=this.shr(1);return n=s.div(e).shl(1),n.eq(_)?e.isNegative()?g:R:(i=this.sub(e.mul(n)),a=n.add(i.div(e)))}if(e.eq(T))return this.unsigned?E:_;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();a=_}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),f=u<=48?1:l(2,u-48),d=r(n),c=d.mul(e);c.isNegative()||c.gt(i);)n-=f,d=r(n,this.unsigned),c=d.mul(e);d.isZero()&&(d=g),a=a.add(d),i=i.sub(c)}return a},C.div=C.divide,C.modulo=function(e){return t(e)||(e=o(e)),this.sub(this.div(e).mul(e))},C.mod=C.modulo,C.not=function(){return i(~this.low,~this.high,this.unsigned)},C.and=function(e){return t(e)||(e=o(e)),i(this.low&e.low,this.high&e.high,this.unsigned)},C.or=function(e){return t(e)||(e=o(e)),i(this.low|e.low,this.high|e.high,this.unsigned)},C.xor=function(e){return t(e)||(e=o(e)),i(this.low^e.low,this.high^e.high,this.unsigned)},C.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)},C.shl=C.shiftLeft,C.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)},C.shr=C.shiftRight,C.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)},C.shru=C.shiftRightUnsigned,C.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},C.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},C.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},C.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]},C.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(9)(e))},function(e,t,n){!function(){var t=n(46),r=n(26).utf8,i=n(48),a=n(26).bin,o=function(e,n){e.constructor==String?e=n&&"binary"===n.encoding?a.stringToBytes(e):r.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());for(var s=t.bytesToWords(e),u=8*e.length,l=1732584193,f=-271733879,d=-1732584194,c=271733878,h=0;h<s.length;h++)s[h]=16711935&(s[h]<<8|s[h]>>>24)|4278255360&(s[h]<<24|s[h]>>>8);s[u>>>5]|=128<<u%32,s[(u+64>>>9<<4)+14]=u;for(var p=o._ff,_=o._gg,E=o._hh,g=o._ii,h=0;h<s.length;h+=16){var y=l,R=f,m=d,v=c;l=p(l,f,d,c,s[h+0],7,-680876936),c=p(c,l,f,d,s[h+1],12,-389564586),d=p(d,c,l,f,s[h+2],17,606105819),f=p(f,d,c,l,s[h+3],22,-1044525330),l=p(l,f,d,c,s[h+4],7,-176418897),c=p(c,l,f,d,s[h+5],12,1200080426),d=p(d,c,l,f,s[h+6],17,-1473231341),f=p(f,d,c,l,s[h+7],22,-45705983),l=p(l,f,d,c,s[h+8],7,1770035416),c=p(c,l,f,d,s[h+9],12,-1958414417),d=p(d,c,l,f,s[h+10],17,-42063),f=p(f,d,c,l,s[h+11],22,-1990404162),l=p(l,f,d,c,s[h+12],7,1804603682),c=p(c,l,f,d,s[h+13],12,-40341101),d=p(d,c,l,f,s[h+14],17,-1502002290),f=p(f,d,c,l,s[h+15],22,1236535329),l=_(l,f,d,c,s[h+1],5,-165796510),c=_(c,l,f,d,s[h+6],9,-1069501632),d=_(d,c,l,f,s[h+11],14,643717713),f=_(f,d,c,l,s[h+0],20,-373897302),l=_(l,f,d,c,s[h+5],5,-701558691),c=_(c,l,f,d,s[h+10],9,38016083),d=_(d,c,l,f,s[h+15],14,-660478335),f=_(f,d,c,l,s[h+4],20,-405537848),l=_(l,f,d,c,s[h+9],5,568446438),c=_(c,l,f,d,s[h+14],9,-1019803690),d=_(d,c,l,f,s[h+3],14,-187363961),f=_(f,d,c,l,s[h+8],20,1163531501),l=_(l,f,d,c,s[h+13],5,-1444681467),c=_(c,l,f,d,s[h+2],9,-51403784),d=_(d,c,l,f,s[h+7],14,1735328473),f=_(f,d,c,l,s[h+12],20,-1926607734),l=E(l,f,d,c,s[h+5],4,-378558),c=E(c,l,f,d,s[h+8],11,-2022574463),d=E(d,c,l,f,s[h+11],16,1839030562),f=E(f,d,c,l,s[h+14],23,-35309556),l=E(l,f,d,c,s[h+1],4,-1530992060),c=E(c,l,f,d,s[h+4],11,1272893353),d=E(d,c,l,f,s[h+7],16,-155497632),f=E(f,d,c,l,s[h+10],23,-1094730640),l=E(l,f,d,c,s[h+13],4,681279174),c=E(c,l,f,d,s[h+0],11,-358537222),d=E(d,c,l,f,s[h+3],16,-722521979),f=E(f,d,c,l,s[h+6],23,76029189),l=E(l,f,d,c,s[h+9],4,-640364487),c=E(c,l,f,d,s[h+12],11,-421815835),d=E(d,c,l,f,s[h+15],16,530742520),f=E(f,d,c,l,s[h+2],23,-995338651),l=g(l,f,d,c,s[h+0],6,-198630844),c=g(c,l,f,d,s[h+7],10,1126891415),d=g(d,c,l,f,s[h+14],15,-1416354905),f=g(f,d,c,l,s[h+5],21,-57434055),l=g(l,f,d,c,s[h+12],6,1700485571),c=g(c,l,f,d,s[h+3],10,-1894986606),d=g(d,c,l,f,s[h+10],15,-1051523),f=g(f,d,c,l,s[h+1],21,-2054922799),l=g(l,f,d,c,s[h+8],6,1873313359),c=g(c,l,f,d,s[h+15],10,-30611744),d=g(d,c,l,f,s[h+6],15,-1560198380),f=g(f,d,c,l,s[h+13],21,1309151649),l=g(l,f,d,c,s[h+4],6,-145523070),c=g(c,l,f,d,s[h+11],10,-1120210379),d=g(d,c,l,f,s[h+2],15,718787259),f=g(f,d,c,l,s[h+9],21,-343485551),l=l+y>>>0,f=f+R>>>0,d=d+m>>>0,c=c+v>>>0}return t.endian([l,f,d,c])};o._ff=function(e,t,n,r,i,a,o){var s=e+(t&n|~t&r)+(i>>>0)+o;return(s<<a|s>>>32-a)+t},o._gg=function(e,t,n,r,i,a,o){var s=e+(t&r|n&~r)+(i>>>0)+o;return(s<<a|s>>>32-a)+t},o._hh=function(e,t,n,r,i,a,o){var s=e+(t^n^r)+(i>>>0)+o;return(s<<a|s>>>32-a)+t},o._ii=function(e,t,n,r,i,a,o){var s=e+(n^(t|~r))+(i>>>0)+o;return(s<<a|s>>>32-a)+t},o._blocksize=16,o._digestsize=16,e.exports=function(e,n){if(void 0===e||null===e)throw new Error("Illegal argument "+e);var r=t.wordsToBytes(o(e,n));return n&&n.asBytes?r:n&&n.asString?a.bytesToString(r):t.bytesToHex(r)}}()},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 a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=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(44),l=r(u),f=n(7),d=r(f),c=n(3),h=r(c),p=n(1),_=r(p),E=n(6),g=r(E),y=n(15),R=r(y),m=n(11),v=r(m),T=n(2),C=r(T),S=n(10),I=(r(S),n(13)),A=(r(I),n(5)),b=r(A),w=n(4),D=(r(w),n(19)),P=r(D),O=void 0,N=_.default.getLoger("RecordPlayBackParse"),U=0,L=1,k=2,M=3,x=4,B=function(e){function t(){i(this,t);var e=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return O=new l.default(l.default.DEFAULT_CAPACITY,l.default.LITTLE_ENDIAN),O.clear(),e._recordPlaybackTimestamp=0,e._recordPlaybackMaxTime=0,e._isReady=!1,e._apes={},e._conferApeMssages={},e._chatApeMssages={},e._videoApeMssages={},e._audioApeMssages={},e._docApeMssages={},e._whiteApeMssages={},e._timerCounter=new P.default,e._timerCounter.addTimerCallBack(e._timerCounterUptate.bind(e),1),e}return o(t,e),s(t,[{key:"registerApe",value:function(e){this._apes[e._session_id]=e}},{key:"initReplay",value:function(){this._stopTimerCounter(),this._recordPlaybackTimestamp=0,this._recordPlaybackMaxTime=0,this._isReady=!1,this._conferApeMssages={},this._chatApeMssages={},this._videoApeMssages={},this._audioApeMssages={},this._docApeMssages={},this._whiteApeMssages={}}},{key:"_everSocketMsgReceivedHandler",value:function(e,t){var n=g.default.decode_pdu(e),r=n.get("type"),i=n.get("data");switch(r==R.default.RCPDU_UNIFORM_SEND_DATA_REQUEST&&(n.type=R.default.RCPDU_SEND_DATA_REQUEST,r=R.default.RCPDU_SEND_DATA_REQUEST),N.log("_everSocketMsgReceivedHandler->pduType",r,"seekTime->",t),r){case R.default.RCPDU_CONNECT_PROVIDER_RESPONSE:var a=g.default.RCConferenceJoinResponsePdu.decode(i),o=a.result;switch(N.warn("RCPDU_CONNECT_PROVIDER_RESPONSE ->pduResultCode:"+o),o){case v.default.RET_SUCCESS:this._emit(h.default.CLASS_JOIN_MCU_SUCCESS,this.classInfo);break;case v.default.RET_FULL_CAPACITY:this._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_JOIN_FULL);break;default:N.warn("JoinConfPdu-未知类型-等待处理.",o)}break;case R.default.RCPDU_SEND_DATA_REQUEST:var s=this._apes[n.sessionId],u=(0,C.default)(n.sessionId);if(s){g.default.id2type(n.subType);s._emit(n.subType,n.data,t)}else N.warn(u+"尚未注册");break;default:N.warn("PDU-未知类型-等待处理.",r)}}},{key:"_parseSaveSocketMsgReceivedHandler",value:function(e,t){var n=g.default.decode_pdu(e),r=n.get("type"),i=n.get("data");switch(r==R.default.RCPDU_UNIFORM_SEND_DATA_REQUEST&&(n.type=R.default.RCPDU_SEND_DATA_REQUEST,r=R.default.RCPDU_SEND_DATA_REQUEST),r){case R.default.RCPDU_CONNECT_PROVIDER_RESPONSE:var a=g.default.RCConferenceJoinResponsePdu.decode(i),o=a.result;switch(N.warn("RCPDU_CONNECT_PROVIDER_RESPONSE ->pduResultCode:"+o),o){case v.default.RET_SUCCESS:this._emit(h.default.CLASS_JOIN_MCU_SUCCESS,this.classInfo);break;case v.default.RET_FULL_CAPACITY:this._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_JOIN_FULL);break;default:N.warn("JoinConfPdu-未知类型-等待处理.",o)}break;case R.default.RCPDU_SEND_DATA_REQUEST:this._apes[n.sessionId],(0,C.default)(n.sessionId);switch(n.sessionId){case C.default.CONFERENCE_SESSION_ID:this.saveParseData(e,t,this._conferApeMssages);break;case C.default.CHAT_SESSION_ID:this.saveParseData(e,t,this._chatApeMssages);break;case C.default.DOCSHARING_SESSION_ID:this.saveParseData(e,t,this._docApeMssages);break;case C.default.WHITEBOARD_SESSION_ID:this.saveParseData(e,t,this._whiteApeMssages);break;case C.default.VIDEO_SESSION_ID:this.saveParseData(e,t,this._videoApeMssages);break;case C.default.AUDIO_SESSION_ID:this.saveParseData(e,t,this._audioApeMssages)}break;default:N.warn("PDU-未知类型-等待处理.",r)}}},{key:"saveParseData",value:function(e,t,n){var r=n[t];r||(n[t]=[],r=n[t]),r.push({timestamp:t,byteData:e})}},{key:"_startTimerCounter",value:function(){this._timerCounter&&this._timerCounter.startTimer()}},{key:"_stopTimerCounter",value:function(){this._timerCounter&&this._timerCounter.stopTimer()}},{key:"_timerCounterUptate",value:function(){return this._recordPlaybackTimestamp=this._recordPlaybackTimestamp+1,N.log("录制回放中...",this._recordPlaybackTimestamp),this._emit(h.default.CLASS_UPDATE_TIMER,{classTimestamp:this._recordPlaybackTimestamp}),this._recordPlaybackTimestamp>=this._recordPlaybackMaxTime?(N.log("录制回放结束...当前时间->",this._recordPlaybackTimestamp," 总时间->",this._recordPlaybackMaxTime),void this.stopRecordPlayback()):(this._searchMessageFromTime(this._recordPlaybackTimestamp,this._conferApeMssages,"conferApe"),this._searchMessageFromTime(this._recordPlaybackTimestamp,this._chatApeMssages,"chatApe"),this._searchMessageFromTime(this._recordPlaybackTimestamp,this._docApeMssages,"docApe"),this._searchMessageFromTime(this._recordPlaybackTimestamp,this._whiteApeMssages,"whiteApe"),this._searchMessageFromTime(this._recordPlaybackTimestamp,this._videoApeMssages,"videoAp"),void this._searchMessageFromTime(this._recordPlaybackTimestamp,this._audioApeMssages,"audioApe"))}},{key:"readyRecordPlay",value:function(){var e=this;this.initReplay(),N.log("读取回放数据");var t="http://"+b.default.RecordServerIP+":"+b.default.RecordServerPort+"/"+b.default.recordFileName;N.log(t),fetch(t,{timeout:18e4}).then(function(t){if(t.ok)return t.arrayBuffer();throw N.error("读取回放数据-网络异常.状态码:"+t.status),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_RECORD_PLAY_BACK_DATA_FAILED),""}).then(function(t){t?(N.log("读取回放数据-完成"),e._loadRecordDataSuccess(t)):(N.warn("读取回放数据-失败."),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_RECORD_PLAY_BACK_DATA_FAILED))}).catch(function(t){N.error("读取回放数据.状态码:"+t),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_RECORD_PLAY_BACK_DATA_FAILED)})}},{key:"_loadRecordDataSuccess",value:function(e){N.log("获取录制回放数据的长度",e.byteLength),O&&(O.clear(),O.append(e),this.parseArrayBuf())}},{key:"parseArrayBuf",value:function(){var e=O.offset;O.byteOffset=0;for(var n=0;n<e;){var r=O.readUInt32(n);n+=4;var i=O.readUInt32(n);n+=4;var a=O.buffer.slice(n,n+i);n+=i,this._parseSaveSocketMsgReceivedHandler(a,r),this._recordPlaybackMaxTime=r}this._recordPlaybackTimestamp=0,this._isReady=!0,this._stopTimerCounter(),this._recordPlaybackMaxTime<b.default.recordTimestamp&&(this._recordPlaybackMaxTime=b.default.recordTimestamp),b.default.recordPlaybackMaxTime=this._recordPlaybackMaxTime,N.log("录制回放数据解析完成,录制回放的总时间长为->",this._recordPlaybackMaxTime),this._emit(t.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS,{recordPlaybackMaxTime:this._recordPlaybackMaxTime})}},{key:"_searchMessageFromTime",value:function(e,t,n){var r=t[e];if(r){N.log(n,"回放数据->",r.length);for(var i=0;i<r.length;i++)this._everSocketMsgReceivedHandler(r[i].byteData,0)}else;}},{key:"startRecordPlayback",value:function(e){return this._isReady?(N.log("classStatusInfo",b.default.classStatusInfo),this._startTimerCounter(),void this._emit(h.default.RECORD_PLAYBACK_UPDATE,{status:L})):{code:C.default.RETURN_FAILED,data:"录制回放还未准备完成"}}},{key:"stopRecordPlayback",value:function(e){this._stopTimerCounter(),this._recordPlaybackTimestamp=0,b.default.activeDocId=0,b.default.activeDocCurPage=1,this._emit(t.RECORD_PLAYBACK_CLEAR_DATA),this._emit(h.default.RECORD_PLAYBACK_UPDATE,{status:x})}},{key:"pauseRecordPlayback",value:function(e){this._stopTimerCounter(),this._emit(h.default.RECORD_PLAYBACK_UPDATE,{status:k})}},{key:"seekRecordPlayback",value:function(e){return this._isReady?e&&e.time?(this._stopTimerCounter(),this._recordPlaybackTimestamp=e.time||0,b.default.activeDocId=0,b.default.activeDocCurPage=1,this._emit(t.RECORD_PLAYBACK_CLEAR_DATA),void this._searchKeyfram()):{code:C.default.RETURN_FAILED,data:"参数不正确"}:{code:C.default.RETURN_FAILED,data:"录制回放还未准备完成"}}},{key:"_searchKeyfram",value:function(){this._searchApeMessageKeyfram(this._conferApeMssages,C.default.CONFERENCE_SESSION_ID),this._searchApeMessageKeyfram(this._docApeMssages,C.default.DOCSHARING_SESSION_ID),this._searchApeMessageKeyfram(this._videoApeMssages,C.default.VIDEO_SESSION_ID),this._searchApeMessageKeyfram(this._audioApeMssages,C.default.AUDIO_SESSION_ID),this._searchChatHistoryMessageKeyfram(this._chatApeMssages,C.default.CHAT_SESSION_ID),this._searchWhiteboradHistoryMessageKeyfram(this._whiteApeMssages,C.default.WHITEBOARD_SESSION_ID),this._startTimerCounter()}},{key:"_searchApeMessageKeyfram",value:function(e,t){for(var n=void 0,r=0,i=this._recordPlaybackTimestamp;i>0;i--)if(n=e[i]){r=this._recordPlaybackTimestamp-i,N.log("SEEK->APE",(0,C.default)(t),this._recordPlaybackTimestamp,"查找到相连的timestamp->",i,"需要seek->",r,"秒");for(var a=0;a<n.length;a++)this._everSocketMsgReceivedHandler(n[a].byteData,r);return void(t!=C.default.AUDIO_SESSION_ID&&t!=C.default.VIDEO_SESSION_ID||this._emit(h.default.RECORD_PLAYBACK_UPDATE,{status:M,keyFrameSeekTime:r}))}N.log("SEEK->APE",(0,C.default)(t),this._recordPlaybackTimestamp,"没有查找到相连的数据")}},{key:"_searchChatHistoryMessageKeyfram",value:function(e){for(var t=0,n=void 0,r=[],i=this._recordPlaybackTimestamp;i>0;i--)if(n=e[i])for(var a=0;a<n.length;a++)if(r.push(n[a].byteData),t++,t>30){N.warn("SEEK->最多处理历史消息30条");break}var o=r.length;if(o>0)for(var s=o-1;s>=0;s--)this._everSocketMsgReceivedHandler(r[s],0)}},{key:"_searchWhiteboradHistoryMessageKeyfram",value:function(e){for(var t=0,n=void 0,r=this._recordPlaybackTimestamp;r>0;r--)if(n=e[r])for(var i=0;i<n.length;i++)if(this._everSocketMsgReceivedHandler(n[i].byteData,0), +t++,t>30)return void N.warn("SEEK->最多处理历史消息30条")}}]),t}(d.default);B.prototype.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS=B.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS="class_join_recordPlayback_success",B.prototype.RECORD_PLAYBACK_CLEAR_DATA=B.RECORD_PLAYBACK_CLEAR_DATA="record_playback_clear_data";var F=new B;t.default=F;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(O,"parseBuffer","D:/work/McuClient/src/RecordPlayBackParse.js"),__REACT_HOT_LOADER__.register(N,"loger","D:/work/McuClient/src/RecordPlayBackParse.js"),__REACT_HOT_LOADER__.register(U,"Default","D:/work/McuClient/src/RecordPlayBackParse.js"),__REACT_HOT_LOADER__.register(L,"PLAY","D:/work/McuClient/src/RecordPlayBackParse.js"),__REACT_HOT_LOADER__.register(k,"PAUSE","D:/work/McuClient/src/RecordPlayBackParse.js"),__REACT_HOT_LOADER__.register(M,"SEEK","D:/work/McuClient/src/RecordPlayBackParse.js"),__REACT_HOT_LOADER__.register(x,"STOP","D:/work/McuClient/src/RecordPlayBackParse.js"),__REACT_HOT_LOADER__.register(B,"RecordPlayBackParse","D:/work/McuClient/src/RecordPlayBackParse.js"),__REACT_HOT_LOADER__.register(F,"default","D:/work/McuClient/src/RecordPlayBackParse.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.timer=0,this.delay=1e3,this.counter=0,this.callBackDelay=1,this.callBackFun=null,this.isStart=!1}return r(e,[{key:"addTimerCallBack",value:function(e,t){this.callBackFun=e,this.callBackDelay=t}},{key:"startTimer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.isStart||(this.isStart=!0,e&&parseInt(e)>0?this.counter=e:this.counter=0,console.log("startTimer",this.counter),this.timerClear(),this.timerStart())}},{key:"stopTimer",value:function(){this.isStart&&(console.log("stopTimer",this.counter),this.isStart=!1,this.timerClear())}},{key:"updateCounter",value:function(){this.counter++,null!=this.callBackFun&&this.counter%this.callBackDelay==0&&this.callBackFun()}},{key:"timerStart",value:function(){this.timer=setInterval(this.updateCounter.bind(this),this.delay)}},{key:"timerClear",value:function(){clearInterval(this.timer)}}]),e}(),a=i;t.default=a;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"TimerCounter","D:/work/McuClient/src/TimerCounter.js"),__REACT_HOT_LOADER__.register(a,"default","D:/work/McuClient/src/TimerCounter.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 a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=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(8),l=r(u),f=n(2),d=r(f),c=n(3),h=r(c),p=n(6),_=r(p),E=(n(31),n(14)),g=(r(E),n(1)),y=r(g),R=n(5),m=r(R),v=n(4),T=r(v),C=n(19),S=r(C),I=y.default.getLoger("ConferApe"),A=0,b=function(e){function t(){i(this,t);var e=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,d.default.CONFERENCE_SESSION_ID,d.default.CONFERENCE_SESSION_NAME,d.default.CONFERENCE_SESSION_TAG));return e.rosters={},e.timerCounter=new S.default,e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(_.default.RCPDU_REG_REGISTER_ROSTER,d.default.CONFERENCE_OBJ_ROSTER_ID,d.default.CONFERENCE_OBJ_ROSTER_NAME,d.default.CONFERENCE_OBJ_ROSTER_TAG,0,new ArrayBuffer),e.registerObj(_.default.RCPDU_REG_REGISTER_QUEUE,d.default.CONFERENCE_OBJ_QUEUE_ID,d.default.CONFERENCE_OBJ_QUEUE_NAME,d.default.CONFERENCE_OBJ_QUEUE_TAG,0,new ArrayBuffer),e.registerObj(_.default.RCPDU_REG_REGISTER_TABLE,d.default.CONFERENCE_OBJ_TABLE_ID,d.default.CONFERENCE_OBJ_TABLE_NAME,d.default.CONFERENCE_OBJ_TABLE_TAG,0,new ArrayBuffer),e.registerObj(_.default.RCPDU_REG_REGISTER_COUNTER,d.default.CONFERENCE_OBJ_COUNTER_ID,d.default.CONFERENCE_OBJ_COUNTER_NAME,d.default.CONFERENCE_OBJ_COUNTER_TAG,0,new ArrayBuffer),e.on(_.default.RCPDU_SESSION_JOIN_RESPONSE,e._joinSessionHandler.bind(e)),e.on(_.default.RCPDU_SEND_CONFERENCE_DATA_REQUEST,e.conferMsgComingHandler.bind(e)),e.on(_.default.RCPDU_CONFERENCE_RECORD_REQUEST,e.onSendConferRecordRequestHandler.bind(e)),e}return o(t,e),s(t,[{key:"_joinSessionHandler",value:function(e){var t=this.getNodeInfo(),n=new _.default.RCNodeInfoUserDataPdu;n.qq="",n.skype="",t.userData=n.toArrayBuffer(),t.deviceType=m.default.deviceType,I.log("开始加入->",t);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 a=new _.default.RCRegistryUpdateObjPdu;a.objId=d.default.CONFERENCE_OBJ_ROSTER_ID,a.subType=i.type,a.userData=i.toArrayBuffer();var o=new _.default.RCAdapterItemPdu;o.type=_.default.RCPDU_REG_UPDATE_OBJ,o.itemData=a.toArrayBuffer();var s=new _.default.RCAdapterPdu;s.type=_.default.RCPDU_REG_ADAPTER,s.item.push(o),this.sendUniform(s,!0)}},{key:"getNodeInfo",value:function(){var e=new _.default.RCNodeInfoRecordPdu;return e.nodeId=m.default.nodeId,e.name=m.default.userName,e.role=d.default.userTypesToId[m.default.userRole]||1,e.level=m.default.level,e.userData=m.default.userData,e.userId=m.default.userId,e.handUpTime=m.default.handUpTime,e.microphones=m.default.microphones,e.cameras=m.default.cameras,e.openCamera=m.default.openCamera,e.openMicrophones=m.default.openMicrophones,e.videoQuality=m.default.videoQuality,e.userIp=m.default.userIp,e.curVideoQuality=m.default.curVideoQuality,e.micGain=m.default.micGain,e.speakerVolume=m.default.speakerVolume,e.micCode=m.default.micCode,e.curCamera=m.default.curCamera,e.curMicrophone=m.default.curMicrophone,e.country=m.default.country,e.city=m.default.city,e.province=m.default.province,e.isp=m.default.isp,e}},{key:"updateUserInfo",value:function(){var e=this.getNodeInfo();I.log("更新用户信息->",e);var t=new _.default.RCNodeInfoUserDataPdu;t.qq="",t.skype="",e.userData=t.toArrayBuffer(),e.deviceType=m.default.deviceType;var n=new _.default.RCRegistryRosterItemPdu;n.nodeId=e.nodeId,n.nodeData=e.toArrayBuffer();var r=new _.default.RCRegistryRosterUpdateItemPdu;r.type=_.default.RCPDU_REG_ROSTER_UPDATE_PDU,r.items.push(n);var i=new _.default.RCRegistryUpdateObjPdu;i.objId=d.default.CONFERENCE_OBJ_ROSTER_ID,i.subType=r.type,i.userData=r.toArrayBuffer();var a=new _.default.RCAdapterItemPdu;a.type=_.default.RCPDU_REG_UPDATE_OBJ,a.itemData=i.toArrayBuffer();var o=new _.default.RCAdapterPdu;o.type=_.default.RCPDU_REG_ADAPTER,o.item.push(a),this.sendUniform(o,!0)}},{key:"sendConferMsg",value:function(e){if(null==this._classInfo||T.default.isEmptyObject(this._classInfo)){if(I.log("不能发送课堂消息.McuClient还未初始化数据!"),0==m.default.getCurrentStatus().code||1==m.default.getCurrentStatus().code)return void this._emit(h.default.MCU_ERROR,h.default.ERR_APE_SEND_FAILED_NO_JOIN)}else{I.log("发送课堂消息.",e);var t=new _.default.RCConferenceSendDataRequestPdu;t.type=_.default.RCPDU_SEND_CONFERENCE_DATA_REQUEST,t.initiator=this._classInfo.nodeId,t.peer=parseInt(e.to),t.userData=this._rCArrayBufferUtil.strToUint8Array("h5"+e.message),t.isPublic=!0,t.actionType=e.actionType,t.isPublic||0==t.peer?(I.log("发送公聊课堂消息."),this.sendChatUniform(t)):(I.log("发送私聊课堂消息."),this.send(t))}}},{key:"sendConferRecordMsg",value:function(e){if(!this.mcu.connected)return I.warn(m.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};if(null==e)return void I.warn("控制录制状的消息发送失败,参数错误",e);m.default.recordStatus=e.recordStatus||!1;var t=new _.default.RCConferenceRecordRequestPdu;t.type=_.default.RCPDU_CONFERENCE_RECORD_REQUEST,t.peer=0,t.isPublic=!0,t.initiator=this._classInfo.nodeId,t.record=m.default.recordStatus,t.classTime=m.default.recordTimestamp,t.filename=m.default.recordFileName||m.default.classId+"_"+T.default.creatTimestampYMD()+".rec",this.sendChatUniform(t),I.warn("发送录制消息-》",e)}},{key:"startRecord",value:function(){return m.default.recordTimestamp>=m.default.allowRecordMaxTime?void I.warn("不能再录制,录制时间已经达到最大限制",m.default.recordTimestamp):(I.log("startRecord","isHost",m.default.isHost,"recordStatus",m.default.recordStatus),void(m.default.isHost&&(m.default.classStopTime=T.default.creatTimestampStr(),this.sendConferRecordMsg({recordStatus:!0}),this._emit(h.default.CLASS_STATUS_INFO_CHANGE),this._emit(h.default.CLASS_RECORD_START))))}},{key:"stopRecord",value:function(e){I.log("stopRecord","isHost",m.default.isHost,"recordStatus",m.default.recordStatus),e&&1==e?m.default.recordStatus&&(m.default.classStopTime=T.default.creatTimestampStr(),this.sendConferRecordMsg({recordStatus:!1}),this._emit(h.default.CLASS_STATUS_INFO_CHANGE)):m.default.isHost&&m.default.recordStatus&&(m.default.classStopTime=T.default.creatTimestampStr(),this.sendConferRecordMsg({recordStatus:!1}),this._emit(h.default.CLASS_STATUS_INFO_CHANGE))}},{key:"leaveClass",value:function(){var e=this.mcu.mcuClassInfo.self,t=new _.default.RCNodeInfoUserDataPdu;t.qq="",t.skype="",e.userData=t.toArrayBuffer(),e.deviceType=m.default.deviceType;var n=new _.default.RCRegistryRosterItemPdu;n.nodeId=e.nodeId,n.nodeData=e.toArrayBuffer();var r=new _.default.RCRegistryRosterDeleteItemPdu;r.type=_.default.RCPDU_REG_ROSTER_DELETE_PDU,r.nodeId=m.default.nodeId;var i=new _.default.RCRegistryUpdateObjPdu;i.objId=d.default.CONFERENCE_OBJ_ROSTER_ID,i.subType=r.type,i.userData=r.toArrayBuffer();var a=new _.default.RCAdapterItemPdu;a.type=_.default.RCPDU_REG_UPDATE_OBJ,a.itemData=i.toArrayBuffer();var o=new _.default.RCAdapterPdu;o.type=_.default.RCPDU_REG_ADAPTER,o.item.push(a),this.sendUniform(o,!0)}},{key:"restorClass",value:function(){m.default.classTimestamp=0,m.default.classStatus=d.default.CLASS_STATUS_WAIT,m.default.classStopTime=T.default.creatTimestampStr(),this.stopRecord(),this._emit(h.default.CLASS_STATUS_INFO_CHANGE),this.sendUpdaterClassStatusInfo({actionType:0}),I.log("restorClass")}},{key:"startClass",value:function(e){if(m.default.isHost){var t=T.default.creatTimestampStr();m.default.classStopTime=t;var n=T.default.creatTimestampYMD();m.default.recordFileName=m.default.recordFileName||m.default.siteId+"/"+n+"/"+m.default.classId+"_"+n+".rec",m.default.classStatus==d.default.CLASS_STATUS_WAIT&&(m.default.classStartTime=t),m.default.classStatus=d.default.CLASS_STATUS_STARTED,this.startRecord(),this._emit(h.default.CLASS_STATUS_INFO_CHANGE),this.sendUpdaterClassStatusInfo({actionType:1}),this.startTimerCounter()}else I.warn("没有权限")}},{key:"pauseClass",value:function(e){return m.default.classStatus==d.default.CLASS_STATUS_WAIT?void I.warn("还没有开始,不能点暂停"):(m.default.classStatus=d.default.CLASS_STATUS_PAUSE,m.default.classStopTime=T.default.creatTimestampStr(),this.stopRecord(),this._emit(h.default.CLASS_STATUS_INFO_CHANGE,e),this.sendUpdaterClassStatusInfo({actionType:2}),void this.stopTimerCounter())}},{key:"closeClass",value:function(e){return m.default.classStatus==d.default.CLASS_STATUS_WAIT?void I.warn("还没有开始,不能点关闭"):(this.stopTimerCounter(),this.restorClass(),void this.sendConferMsg({to:0,message:"所有人退出课堂",actionType:d.default.CLASS_ACTION_CLOSE_ALL}))}},{key:"changeHandUpStatus",value:function(e){I.log("切换举手状态->",e),e&&1==e.isHandUp?m.default.handUpTime=T.default.creatTimestamp():m.default.handUpTime=0,this.updateUserInfo()}},{key:"sendUpdaterClassStatusInfo",value:function(e){if(I.log("更新课堂信息->"),null==e||T.default.isEmptyObject(e))return I.log("更新课堂信息->参数错误"),void this._emit(h.default.MCU_ERROR,h.default.ERR_APE_INTERFACE_PARAM_WRONG);A=d.default.CONFERENCE_OBJ_TABLE_ID;var t=this.packPdu(e,A);if(I.log(t),null==t)return I.log("更新课堂信息->参数错误"),void this._emit(h.default.MCU_ERROR,h.default.ERR_APE_INTERFACE_PARAM_WRONG);var n=new _.default.RCRegistryTableItemPdu;n.itemIdx=A,n.owner=0,n.registerObjId=d.default.CONFERENCE_OBJ_TABLE_ID,n.itemData=t.toArrayBuffer();var r=new _.default.RCRegistryTableUpdateItemPdu;r.type=_.default.RCPDU_REG_TABLE_UPDATE_PDU,r.items.push(n);var i=new _.default.RCRegistryUpdateObjPdu;i.objId=d.default.CONFERENCE_OBJ_TABLE_ID,i.subType=r.type,i.userData=r.toArrayBuffer();var a=new _.default.RCAdapterItemPdu;a.type=_.default.RCPDU_REG_UPDATE_OBJ,a.itemData=i.toArrayBuffer();var o=new _.default.RCAdapterPdu;o.type=_.default.RCPDU_REG_ADAPTER,o.item.push(a),I.log("更新课堂信息->发送更新数据"),this.sendUniform(o,!0)}},{key:"onJoinChannelHandlerSuccess",value:function(){I.log("ConferApe.onJoinChannelHandlerSuccess",m.default.classStatus),this.timerCounter.addTimerCallBack(this.timerCounterUptate.bind(this),1),m.default.classStatus==d.default.CLASS_STATUS_STARTED?(this.startTimerCounter(),this.startRecord()):m.default.classStatus==d.default.CLASS_STATUS_WAIT&&m.default.isHost&&m.default.isAutoStartClass&&!m.default.isRecordPlayBack&&(I.log("自动开始上课->classStatus:",m.default.classStatus," isHost:",m.default.isHost," isAutoStartClass:",m.default.isAutoStartClass," isRecordPlayBack:",m.default.isRecordPlayBack),this.startClass())}},{key:"startTimerCounter",value:function(){this.stopTimerCounter(),this.timerCounter&&this.timerCounter.startTimer()}},{key:"stopTimerCounter",value:function(){this.timerCounter&&this.timerCounter.stopTimer()}},{key:"timerCounterUptate",value:function(){return this.mcu.connected||(I.warn("MCU 连接已经断开"),this.stopTimerCounter()),m.default.classStatus!=d.default.CLASS_STATUS_STARTED?void I.warn("当前课堂已经暂停或者未开始,不计时","classStatus-->",m.default.classStatus):(m.default.classTimestamp=m.default.classTimestamp+1,m.default.isHost&&(m.default.recordTimestamp=m.default.recordTimestamp+1),this._emit(h.default.CLASS_UPDATE_TIMER,{classTimestamp:m.default.classTimestamp}),m.default.classTimestamp%m.default.updateClassInfoDelay==0&&m.default.isHost&&(this._emit(h.default.CLASS_STATUS_INFO_CHANGE),this.sendUpdaterClassStatusInfo({actionType:1})),void(m.default.isRecordPlayBack||m.default.classTimestamp%m.default.msDynamicChooseIpDelay!=0||this._emit(h.default.SWITCH_MS_IP)))}},{key:"tableUpdateHandler",value:function(e,t,n){try{var r=this.unPackPdu(e,t,n);if(I.log("tableUpdateHandler"),I.log(r),r&&r.classStatusInfo&&m.default.setClassStatusInfo(r.classStatusInfo),this._emit(h.default.CLASS_UPTATE_STATUS,m.default.classStatusInfo),!this.mcu.connected)return void this.stopTimerCounter();m.default.classStatus==d.default.CLASS_STATUS_STARTED?this.startTimerCounter():this.stopTimerCounter()}catch(e){I.warn("ConferApe table update got exception. itemIdx",t)}}},{key:"conferMsgComingHandler",value:function(e){var t=_.default.RCConferenceSendDataRequestPdu.decode(e),n={};switch(n.fromNodeID=t.initiator,n.toNodeID=t.peer,n.message=this._rCArrayBufferUtil.uint8ArrayToStr(t.userData,2),n.actionType=t.actionType,I.log("conferMsgComingHandler",n),n.actionType){case d.default.CLASS_ACTION_CLOSE_ALL:I.log(n.message),this._emit(h.default.CLASS_RUN_EXIT,{type:1})}}},{key:"onSendConferRecordRequestHandler",value:function(e){try{var t=_.default.RCConferenceRecordRequestPdu.decode(e);I.log("onSendConferRecordRequestHandler->",t),(t&&1==t.record||"true"==t.record)&&this._emit(h.default.CLASS_RECORD_SUCCESS)}catch(e){I.warn("onSendConferRecordRequestHandler err",e.message)}}},{key:"rosterInsertHandler",value:function(e,t){I.log("rosterInsertHandler--->"),m.default.nodeId==e||this.rosterUpdateHandler(e,t)}},{key:"rosterUpdateHandler",value:function(e,t){if(t.userRole=d.default.userTypes[t.role],e==m.default.nodeId){I.log("自己加入课堂的消息->",e,"role-->",t.role,d.default.userTypes[t.role]);var n=Object.keys(this.rosters).length;return n<1&&!m.default.isHost&&m.default.classStatus==d.default.CLASS_STATUS_STARTED&&(I.warn("当前课堂没有老师->暂停课堂"),this.pauseClass({isForce:!0}),this.stopRecord(!0)),void this.unPackRosterInfo(e,t)}if(parseInt(e)>m.default.nodeId){if(t.role==d.default.NR_HOST&&m.default.isHost)return void this.kickOutRoster();if(t.role==d.default.NR_PRESENTER&&m.default.isPresenter)return void this.kickOutRoster();if(t.role==d.default.NR_ASSISTANT&&m.default.isAssistant)return void this.kickOutRoster();if(t.role==d.default.NR_INVISIBLE&&m.default.isInvisible)return void this.kickOutRoster();t.userId==m.default.userId&&"0"!=m.default.userId&&(I.log("异地登陆->userId->",m.default.userId),this._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_REMOTE_LANDING),this._emit(h.default.CLASS_RUN_EXIT,{type:1}))}this.unPackRosterInfo(e,t)}},{key:"unPackRosterInfo",value:function(e,t){var n=this.rosters[e];this.rosters[e]=t;var r=null;try{r=_.default.RCNodeInfoUserDataPdu.decode(t.userData)}catch(e){I.log("RCNodeInfoUserDataPdu decode err",e.message)}var i=t;return i.userData=r,t.role==d.default.NR_INVISIBLE&&m.default.userRole!=d.default.invisible?void I.log("NR_INVISIBLE"):void(n?(I.log("人员更新信息->",i),this._emit(h.default.CLASS_UPDATE_ROSTER,{nodeId:e,nodeData:i})):(I.log("人员加入->",i),this._emit(h.default.CLASS_INSERT_ROSTER,{nodeId:e,nodeData:i}),this.emitRosterChange()))}},{key:"kickOutRoster",value:function(){this._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_KICK_OUT),this._emit(h.default.CLASS_RUN_EXIT,{type:1})}},{key:"updaterRosterStatus",value:function(e){e&&e.status==d.default.CHANNEL_STATUS_OPENING&&null==this.rosters[e.fromNodeId]&&(I.log("媒体模块被占用->占有人已经不存在课堂中->释放->",e),this._emit(h.default.CLASS_NONENTITY_ROSTER,{nodeId:e.fromNodeId}))}},{key:"updaterUserDeviecStatusChange",value:function(e){I.log("音视频设备状态更新->",e),this.updateUserInfo()}},{key:"rosterDelHandler",value:function(e){if(m.default.nodeId==e)I.log("自己离开课堂"),this._emit(h.default.CLASS_RUN_EXIT,{type:0});else{var t=this.rosters[e];t&&I.log(e,"->离开课堂->身份->",t.role),delete this.rosters[e],this.emitRosterChange(),this._emit(h.default.CLASS_DELETE_ROSTER,{nodeId:e});for(var n in this.rosters){var r=parseInt(n);return void(r==m.default.nodeId?(I.log(r,"有权限检查离开的人员是否占用channel"),this._emit(h.default.CLASS_NONENTITY_ROSTER,{nodeId:e}),t&&t.role==d.default.NR_HOST&&(this.pauseClass(),this.stopRecord(!0))):I.warn(m.default.nodeId,"没有权限检查离开的人员是否占用channel"))}}}},{key:"emitRosterChange",value:function(){this._emit(h.default.CLASS_UPDATE_ROSTER_NUM,Object.keys(this.rosters).length)}},{key:"packPdu",value:function(e,t){if(I.log("课堂===packPdu "),null==e||null==t)return this._emit(h.default.MCU_ERROR,h.default.ERR_APE_INTERFACE_PARAM_WRONG),null;var n=new _.default.RCClassStatusInfoPdu;n.nodeId=m.default.nodeId,n.userId=m.default.userId,n.userName=m.default.userName,n.siteId=m.default.siteId,n.classId=m.default.classId,n.className=m.default.className,n.classType=m.default.classType,n.classStatus=m.default.classStatus,n.classStartTime=m.default.classStartTime,n.classStopTime=m.default.classStopTime,n.classTimestamp=m.default.classTimestamp,n.classBeginTime=m.default.classBeginTime,n.classEndTime=m.default.classEndTime,n.recordStatus=m.default.recordStatus,n.recordTimestamp=m.default.recordTimestamp,n.recordFileName=m.default.recordFileName,n.recordDownloadUrl=m.default.recordDownloadUrl,n.serverTimestamp=m.default.serverTimestamp,n.activeDocId=m.default.activeDocId,n.activeDocCurPage=m.default.activeDocCurPage,I.log("classStatusInfo--->",n);var r=new _.default.RCClassSendDataModelPdu;return r.itemIdx=t,r.from=m.default.nodeId,r.owner=m.default.nodeId,r.classStatusInfo=n,r}},{key:"unPackPdu",value:function(e,t,n){if(I.log("课堂===unPackPdu "),null==e||null==t||null==n)return this._emit(h.default.MCU_ERROR,h.default.ERR_APE_INTERFACE_PARAM_WRONG),null;try{var r=_.default.RCClassSendDataModelPdu.decode(n);return r}catch(e){I.log("课堂收到数据 unPackPdu Pdu解析错误,itemIdx="+t+" err:"+e.message)}return null}}]),t}(l.default),w=b;t.default=w;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(I,"loger","D:/work/McuClient/src/apes/ConferApe.js"),__REACT_HOT_LOADER__.register(A,"itemIdx","D:/work/McuClient/src/apes/ConferApe.js"),__REACT_HOT_LOADER__.register(b,"ConferApe","D:/work/McuClient/src/apes/ConferApe.js"),__REACT_HOT_LOADER__.register(w,"default","D:/work/McuClient/src/apes/ConferApe.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")}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}}(),o=n(2),s=r(o),u=n(1),l=r(u),f=n(3),d=(r(f),n(5)),c=r(d),h=n(4),p=r(h),_=l.default.getLoger("MediaModule"),E=function(){function e(){i(this,e),this.needPublishMediaChannel={},this.mediaChannels={},this.maxMediaChannel=0,this.mediaType=s.default.MEDIA_TYPE_DEFAULT,this.MEDIA_OBJ_TABLE_ID=0}return a(e,[{key:"getMediaPlayPath",value:function(e){if(_.log("获取播放地址->"),null==e||null==e.streamId)return _.warn("获取播放地址->参数错误",e),{code:s.default.RETURN_FAILED,data:""};var t="",n="",r="";return"m3u8"==e.type?(r=c.default.siteId==c.default.siteId_letv?"desc.m3u8":"index.m3u8",n=""==c.default.MS_PLAY_HLS_PORT||null==c.default.MS_PLAY_HLS_PORT?"":":"+c.default.MS_PLAY_HLS_PORT,t="http://"+c.default.MS_PLAY_HLS_IP+n+"/live/"+e.streamId+"/"+r):(n=""==c.default.MS_PLAY_RTMP_PORT||null==c.default.MS_PLAY_RTMP_PORT?"":":"+c.default.MS_PLAY_RTMP_PORT,t="rtmp://"+c.default.MS_PLAY_RTMP_IP+n+"/live/"+e.streamId),t=t.replace("::",":"),{code:s.default.RETURN_SUCCESS,data:"",playUrl:t}}},{key:"getMediaRecordPlaybackPath",value:function(e){if(_.log("getMediaRecordPlaybackPath"),null==e||null==e.streamId)return _.warn("getMediaRecordPlaybackPath,参数错误",e),{code:s.default.RETURN_FAILED,data:""};var t=""==c.default.RS_RECORD_PLAY_PORT||null==c.default.RS_RECORD_PLAY_PORT?"":":"+c.default.RS_RECORD_PLAY_PORT,n="http://"+c.default.RS_RECORD_PLAY_IP+t+"/live/"+e.streamId+"/total.m3u8";return n=n.replace("::",":"),{code:s.default.RETURN_SUCCESS,data:"",playUrl:n}}},{key:"getMediaPublishPath",value:function(e){_.log("getMediaPublishPath");var t=this.getFreeMediaChannel();if(0==t)return{code:s.default.RETURN_FAILED,data:"不能再打开更多的设备",mediaChannels:this.mediaChannels};var n="live";e&&"flash"==e.type&&(n="flash");var r=""==c.default.MS_PUBLISH_PORT||null==c.default.MS_PUBLISH_PORT?"":":"+c.default.MS_PUBLISH_PORT,i=p.default.creatTimestamp(),a=c.default.siteId+"_"+c.default.classId+"_"+c.default.userId+"_"+t+"_"+i,o="rtmp://"+c.default.MS_PUBLISH_IP+r+"/"+n+"/"+a;return o=o.replace("::",":"),this.needPublishMediaChannel[o]={channelId:t,publishUrl:o,streamId:a,timestamp:i,nodeId:c.default.nodeId},{code:s.default.RETURN_SUCCESS,data:"",mediaId:t,publishUrl:o}}},{key:"getFreeMediaChannel",value:function(){var e=0;for(var t in this.mediaChannels){var n=this.mediaChannels[t];if(n&&n.status==s.default.CHANNEL_STATUS_RELEASED)return n.channelId;e++}return _.log("getFreeMediaChannel","maxMediaChannel",this.maxMediaChannel,"counter:",e),_.log(this.mediaChannels),e<this.maxMediaChannel?this.MEDIA_OBJ_TABLE_ID+e:0}},{key:"getNeedPublishMediaChannel",value:function(e){return this.needPublishMediaChannel[e]}},{key:"getOpeningMediaChannel",value:function(e){if(_.log("getOpeningMediaChannel","nodeId",e,"mediaChannels:",this.mediaChannels),null==e||0==e)return 0;for(var t in this.mediaChannels){var n=this.mediaChannels[t];if(n&&n.status==s.default.CHANNEL_STATUS_OPENING&&n.fromNodeId==e)return n.channelId}return 0}},{key:"checkChannelIsOpening",value:function(e){if(null==e)return _.warn("checkChannelIsOpening error,channel=",e),!0;var t=this.mediaChannels[e];return null!=t&&t.status!=s.default.CHANNEL_STATUS_RELEASED}},{key:"getAllMediaChannelInfo",value:function(){var e=[];for(var t in this.mediaChannels){var n=this.mediaChannels[t];n&&e.push({mediaId:n.channelId,status:n.status,fromNodeId:n.fromNodeId})}if(e.length<this.maxMediaChannel)for(var r=e.length;r<this.maxMediaChannel;r++){var i=this.MEDIA_OBJ_TABLE_ID+r;e.push({mediaId:i,status:s.default.CHANNEL_STATUS_RELEASED,fromNodeId:0})}return e}},{key:"getDefaultChannelInfo",value:function(){var e={};return e.owner=0,e.status=s.default.CHANNEL_STATUS_RELEASED,e.fromNodeId=c.default.nodeId,e.channelId=0,e.streamId="",e.classId=c.default.classId,e.siteId=c.default.siteId,e.toNodeId=0,e.userId=c.default.userId,e.mediaType=this.mediaType||s.default.MEDIA_TYPE_DEFAULT,e}}]),e}();E.allMediaChannelsList={};var g=E;t.default=g;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(_,"loger","D:/work/McuClient/src/apes/MediaModule.js"),__REACT_HOT_LOADER__.register(E,"MediaModule","D:/work/McuClient/src/apes/MediaModule.js"),__REACT_HOT_LOADER__.register(g,"default","D:/work/McuClient/src/apes/MediaModule.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 a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=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}}(),l=n(7),f=r(l),d=n(3),c=r(d),h=n(1),p=r(h),_=n(43),E=r(_),g=n(6),y=r(g),R=n(15),m=r(R),v=n(11),T=r(v),C=n(2),S=r(C),I=n(20),A=(r(I),n(10)),b=r(A),w=n(13),D=r(w),P=n(5),O=r(P),N=n(4),U=r(N),L=p.default.getLoger("MCU"),k=function(e){function t(){i(this,t);var e=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._apes={},e._everSocket=E.default,e._everSocket.on(E.default.OPEN,e._everSocketOpenHandler.bind(e)),e._everSocket.on(E.default.MESSAGE,e._everSocketMsgReceivedHandler.bind(e)),e._everSocket.on(E.default.CLOSED,e._everSocketCloseHandler.bind(e)),e._everSocket.on(E.default.ERROR,e._everSocketErrorHandler.bind(e)),e}return o(t,e),u(t,[{key:"registerApe",value:function(e){this._apes[e._session_id]=e}},{key:"_everSocketOpenHandler",value:function(){this._sendJoinClassRequest()}},{key:"_everSocketCloseHandler",value:function(){return O.default.getCurrentStatus().code==O.default.statusCode_3.code?void L.warn("已经断开连接->"):(O.default.setCurrentStatus(O.default.statusCode_3),void this._emit(c.default.MCU_ERROR,c.default.ERR_SOCKET_DISCONNECT))}},{key:"_everSocketErrorHandler",value:function(e){e==E.default.ERR_SOCKET_RECONNECT_FAILED&&this._emit(c.default.SWITCH_MCU_IP)}},{key:"_sendJoinClassRequest",value:function(){L.log("MCU-发送加入课堂请求."),L.log(this.classInfo);var e=new y.default.RCConferenceDescriptorPdu;e.id=this.classInfo.classId,e.name=this.classInfo.className||"",e.mode=0,e.capacity=1;var t=new y.default.RCConferenceJoinRequestPdu;t.type=2,t.initiator=this.classInfo.nodeId,t.nodeType=T.default.NT_TERMINAL,t.classDescription=e;var n=y.default.create_join_class_request_pdu(t.type,this.classInfo.nodeId,this.classInfo.classId,0,S.default.BROADCAST_CHANNEL_ID,!0,T.default.DP_TOP,this.classInfo.topNodeID,T.default.SEG_ONCE);n.set("site",this.classInfo.siteId),n.set("userId",this.classInfo.userId),n.set("userName",D.default.fromByteArray(b.default.strToUint8Array(this.classInfo.userName))),n.set("userRole",this.classInfo.userRole),n.set("deviceType",""+O.default.deviceType),n.set("data",t.toArrayBuffer()),this._everSocket.send(n.toArrayBuffer())}},{key:"_everSocketMsgReceivedHandler",value:function(e){var t=this,n=y.default.decode_pdu(e),r=n.get("type"),i=n.get("data"),a=function(){switch(r){case m.default.RCPDU_CONNECT_PROVIDER_RESPONSE:var e=y.default.RCConferenceJoinResponsePdu.decode(i),a=e.result;switch(L.warn("RCPDU_CONNECT_PROVIDER_RESPONSE ->pduResultCode:"+a),a){case T.default.RET_SUCCESS:t._updateMCUConfInfoDescription(e.classDescription),t._emit(c.default.CLASS_JOIN_MCU_SUCCESS,t.classInfo);break;case T.default.RET_FULL_CAPACITY:t._emit(c.default.MCU_ERROR,c.default.ERR_CLASS_JOIN_FULL);break;default:L.arn("JoinConfPdu-未知类型-等待处理.",a)}break;case m.default.RCPDU_SEND_DATA_REQUEST:var o=t._apes[n.sessionId],s=(0,S.default)(n.sessionId);if(o){y.default.id2type(n.subType);if(L.warn("接收服务端消息----------------->subType->",n.subType,O.default.mcuDelay,O.default.messageDelay),o._apeDelayed&&O.default.messageDelay&&O.default.mcuDelay>0)return L.warn("延迟处理消息->",O.default.mcuDelay),setTimeout(function(){o._emit(n.subType,n.data)},1e3*O.default.mcuDelay),{v:void 0};o._emit(n.subType,n.data)}else L.warn(s+"尚未注册");break;default:L.warn("PDU-未知类型-等待处理.",r)}}();if("object"===("undefined"==typeof a?"undefined":s(a)))return a.v}},{key:"_updateMCUConfInfoDescription",value:function(e){L.log("_updateMCUConfInfoDescription."),L.log(e)}},{key:"send",value:function(e){this.connected?(L.log("发送数据到服务端-------------------->"),this._everSocket.send(e.toArrayBuffer())):(L.log("发送数据到服务端-------------------->失败->未连接到服务端"),this._emit(c.default.MCU_ERROR,c.default.ERR_SOCKET_DISCONNECT))}},{key:"leaveMCU",value:function(){for(var e in this._apes)this._apes[e].stopApe();L.log("leaveMCU"),O.default.setCurrentStatus(O.default.statusCode_3),this._everSocket.end()}},{key:"joinMCU",value:function(e){L.log("开始建立EverSocket通道."),L.log(e),e.classId=parseInt(e.classId),this.classInfo=e,this.classInfo.nodeId=U.default.creatSoleNumberFromTimestamp(),O.default.nodeId=this.classInfo.nodeId;var t=new y.default.RCNodeInfoRecordPdu;t.name=this.classInfo.userName,t.nodeId=this.classInfo.nodeId,t.userId=this.classInfo.userId,t.role=S.default.userTypesToId[this.classInfo.userRole]||1,t.level=0,t.handUpTime=0,t.openCamera=0,t.openMicrophones=0,t.microphones=O.default.microphones,t.cameras=O.default.cameras,t.videoQuality=O.default.videoQuality,t.userIp=O.default.userIp;var n={};n._conference_id=this.classInfo.classId,n._top_node_id=this.classInfo.topNodeID,this.mcuClassInfo={},this.mcuClassInfo.self=t,this.mcuClassInfo.info=n,this.classInfo.mcuClassInfo=this.mcuClassInfo,this._everSocket.begin(this.classInfo.MCUServerIP,this.classInfo.MCUServerPort)}},{key:"switchMCUIp",value:function(e){e&&e.MCUServerIP&&(this.classInfo.MCUServerIP=e.MCUServerIP,this.classInfo.MCUServerPort=e.MCUServerPort,this._everSocket&&this._everSocket.switchSocketIp(this.classInfo.MCUServerIP,this.classInfo.MCUServerPort))}},{key:"connected",get:function(){return!(!this._everSocket||!this._everSocket.connected)}}]),t}(f.default),M=new k;t.default=M;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(L,"loger","D:/work/McuClient/src/mcu.js"),__REACT_HOT_LOADER__.register(k,"MCU","D:/work/McuClient/src/mcu.js"),__REACT_HOT_LOADER__.register(M,"default","D:/work/McuClient/src/mcu.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(f===setTimeout)return setTimeout(e,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function a(e){if(d===clearTimeout)return clearTimeout(e);if((d===r||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function o(){_&&h&&(_=!1,h.length?p=h.concat(p):E=-1,p.length&&s())}function s(){if(!_){var e=i(o);_=!0;for(var t=p.length;t;){for(h=p,p=[];++E<t;)h&&h[E].run();E=-1,t=p.length}h=null,_=!1,a(e)}}function u(e,t){this.fun=e,this.array=t}function l(){}var f,d,c=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(e){f=n}try{d="function"==typeof clearTimeout?clearTimeout:r}catch(e){d=r}}();var h,p=[],_=!1,E=-1;c.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];p.push(new u(e,t)),1!==p.length||_||i(s)},u.prototype.run=function(){this.fun.apply(null,this.array)},c.title="browser",c.browser=!0,c.env={},c.argv=[],c.version="",c.versions={},c.on=l,c.addListener=l,c.once=l,c.off=l,c.removeListener=l,c.removeAllListeners=l,c.emit=l,c.binding=function(e){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(e){throw new Error("process.chdir is not supported")},c.umask=function(){return 0}},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,n){var r,i,a;(function(e){!function(o,s){n(12).amd?(i=[n(16)],r=s,a="function"==typeof r?r.apply(t,i):r,!(void 0!==a&&(e.exports=a))):"object"==typeof e&&e&&e.exports?e.exports=function(){var e;try{e=n(16)}catch(e){}return s(e)}():(o.dcodeIO=o.dcodeIO||{}).ByteBuffer=s(o.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 a,o,s=8*i-r-1,u=(1<<s)-1,l=u>>1,f=-7,d=n?i-1:0,c=n?-1:1,h=e[t+d];for(d+=c,a=h&(1<<-f)-1,h>>=-f,f+=s;f>0;a=256*a+e[t+d],d+=c,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=r;f>0;o=256*o+e[t+d],d+=c,f-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:(h?-1:1)*(1/0);o+=Math.pow(2,r),a-=l}return(h?-1:1)*o*Math.pow(2,a-r)}function i(e,t,n,r,i,a){var o,s,u,l=8*a-i-1,f=(1<<l)-1,d=f>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,p=r?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),t+=o+d>=1?c/u:c*Math.pow(2,1-d),t*u>=2&&(o++,u/=2),o+d>=f?(s=0,o=f):o+d>=1?(s=(t*u-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+h]=255&o,h+=p,o/=256,l-=8);e[n+h-p]|=128*_}var a=function(e,t,n){if("undefined"==typeof e&&(e=a.DEFAULT_CAPACITY),"undefined"==typeof t&&(t=a.DEFAULT_ENDIAN),"undefined"==typeof n&&(n=a.DEFAULT_NOASSERT),!n){if(e|=0,e<0)throw RangeError("Illegal capacity");t=!!t,n=!!n}this.buffer=0===e?s: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};a.VERSION="5.0.1",a.LITTLE_ENDIAN=!0,a.BIG_ENDIAN=!1,a.DEFAULT_CAPACITY=16,a.DEFAULT_ENDIAN=a.BIG_ENDIAN,a.DEFAULT_NOASSERT=!1,a.Long=e||null;var o=a.prototype;o.__isByteBuffer__,Object.defineProperty(o,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var s=new ArrayBuffer(0),u=String.fromCharCode;a.accessor=function(){return Uint8Array},a.allocate=function(e,t,n){return new a(e,t,n)},a.concat=function(e,t,n,r){"boolean"!=typeof t&&"string"==typeof t||(r=n,n=t,t=void 0);for(var i,o=0,s=0,u=e.length;s<u;++s)a.isByteBuffer(e[s])||(e[s]=a.wrap(e[s],t)),i=e[s].limit-e[s].offset,i>0&&(o+=i);if(0===o)return new a(0,n,r);var l,f=new a(o,n,r);for(s=0;s<u;)l=e[s++],i=l.limit-l.offset,i<=0||(f.view.set(l.view.subarray(l.offset,l.limit),f.offset),f.offset+=i);return f.limit=f.offset,f.offset=0,f},a.isByteBuffer=function(e){return(e&&e.__isByteBuffer__)===!0},a.type=function(){return ArrayBuffer},a.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 a.fromBase64(e,n);case"hex":return a.fromHex(e,n);case"binary":return a.fromBinary(e,n);case"utf8":return a.fromUTF8(e,n);case"debug":return a.fromDebug(e,n);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");var i;if(a.isByteBuffer(e))return i=o.clone.call(e),i.markedOffset=-1,i;if(e instanceof Uint8Array)i=new a(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 a(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 a(e.length,n,r),i.limit=e.length;for(var s=0;s<e.length;++s)i.view[s]=e[s]}return i},o.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,a=e.length,o=a>>3,s=0;for(t+=this.writeVarint32(a,t);o--;)r=1&!!e[s++]|(1&!!e[s++])<<1|(1&!!e[s++])<<2|(1&!!e[s++])<<3|(1&!!e[s++])<<4|(1&!!e[s++])<<5|(1&!!e[s++])<<6|(1&!!e[s++])<<7,this.writeByte(r,t++);if(s<a){var u=0;for(r=0;s<a;)r|=(1&!!e[s++])<<u++;this.writeByte(r,t++)}return n?(this.offset=t,this):t-i},o.readBitSet=function(e){var t="undefined"==typeof e;t&&(e=this.offset);var n,r=this.readVarint32(e),i=r.value,a=i>>3,o=0,s=[];for(e+=r.length;a--;)n=this.readByte(e++),s[o++]=!!(1&n),s[o++]=!!(2&n),s[o++]=!!(4&n),s[o++]=!!(8&n),s[o++]=!!(16&n),s[o++]=!!(32&n),s[o++]=!!(64&n),s[o++]=!!(128&n);if(o<i){var u=0;for(n=this.readByte(e++);o<i;)s[o++]=!!(n>>u++&1)}return t&&(this.offset=e),s},o.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},o.writeBytes=o.append,o.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},o.writeByte=o.writeInt8,o.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},o.readByte=o.readInt8,o.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},o.writeUInt8=o.writeUint8,o.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},o.readUInt8=o.readUint8,o.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},o.writeShort=o.writeInt16,o.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},o.readShort=o.readInt16,o.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},o.writeUInt16=o.writeUint16,o.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},o.readUInt16=o.readUint16,o.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},o.writeInt=o.writeInt32,o.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},o.readInt=o.readInt32,o.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},o.writeUInt32=o.writeUint32,o.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},o.readUInt32=o.readUint32,e&&(o.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 a=t.low,o=t.high;return this.littleEndian?(this.view[n+3]=a>>>24&255,this.view[n+2]=a>>>16&255,this.view[n+1]=a>>>8&255,this.view[n]=255&a,n+=4,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):(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,n+=4,this.view[n]=a>>>24&255,this.view[n+1]=a>>>16&255,this.view[n+2]=a>>>8&255,this.view[n+3]=255&a),r&&(this.offset+=8),this},o.writeLong=o.writeInt64,o.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 a=new e(r,i,!1);return n&&(this.offset+=8),a},o.readLong=o.readInt64,o.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 a=t.low,o=t.high;return this.littleEndian?(this.view[n+3]=a>>>24&255,this.view[n+2]=a>>>16&255,this.view[n+1]=a>>>8&255,this.view[n]=255&a,n+=4,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):(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,n+=4,this.view[n]=a>>>24&255,this.view[n+1]=a>>>16&255,this.view[n+2]=a>>>8&255,this.view[n+3]=255&a),r&&(this.offset+=8),this},o.writeUInt64=o.writeUint64,o.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 a=new e(r,i,!0);return n&&(this.offset+=8),a},o.readUInt64=o.readUint64),o.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},o.writeFloat=o.writeFloat32,o.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},o.readFloat=o.readFloat32,o.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},o.writeDouble=o.writeFloat64,o.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},o.readDouble=o.readFloat64,a.MAX_VARINT32_BYTES=5,a.calculateVarint32=function(e){return e>>>=0,e<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},a.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},a.zigZagDecode32=function(e){return e>>>1^-(1&e)|0},o.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=a.calculateVarint32(e);t+=i;var o=this.buffer.byteLength;for(t>o&&this.resize((o*=2)>t?o: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},o.writeVarint32ZigZag=function(e,t){return this.writeVarint32(a.zigZagEncode32(e),t)},o.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 a=Error("Truncated");throw a.truncated=!0,a}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}},o.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"==typeof t?t.value=a.zigZagDecode32(t.value):t=a.zigZagDecode32(t),t},e&&(a.MAX_VARINT64_BYTES=10,a.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},a.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()},a.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()},o.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=a.calculateVarint64(t),o=t.toInt()>>>0,s=t.shiftRightUnsigned(28).toInt()>>>0,u=t.shiftRightUnsigned(56).toInt()>>>0;n+=i;var l=this.buffer.byteLength;switch(n>l&&this.resize((l*=2)>n?l: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?s>>>21|128:s>>>21&127;case 7:this.view[n+6]=7!==i?s>>>14|128:s>>>14&127;case 6:this.view[n+5]=6!==i?s>>>7|128:s>>>7&127;case 5:this.view[n+4]=5!==i?128|s:127&s;case 4:this.view[n+3]=4!==i?o>>>21|128:o>>>21&127;case 3:this.view[n+2]=3!==i?o>>>14|128:o>>>14&127;case 2:this.view[n+1]=2!==i?o>>>7|128:o>>>7&127;case 1:this.view[n]=1!==i?128|o:127&o}return r?(this.offset+=i,this):i},o.writeVarint64ZigZag=function(e,t){return this.writeVarint64(a.zigZagEncode64(e),t)},o.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,a=0,o=0,s=0;if(s=this.view[t++],i=127&s,128&s&&(s=this.view[t++],i|=(127&s)<<7,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],i|=(127&s)<<14,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],i|=(127&s)<<21,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],a=127&s,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],a|=(127&s)<<7,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],a|=(127&s)<<14,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],a|=(127&s)<<21,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],o=127&s,(128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],o|=(127&s)<<7,128&s||this.noAssert&&"undefined"==typeof s))))))))))throw Error("Buffer overrun");var u=e.fromBits(i|a<<28,a>>>4|o<<24,!1);return n?(this.offset=t,u):{value:u,length:t-r}},o.readVarint64ZigZag=function(t){var n=this.readVarint64(t);return n&&n.value instanceof e?n.value=a.zigZagDecode64(n.value):n=a.zigZagDecode64(n),n}),o.writeCString=function(e,n){var r="undefined"==typeof n;r&&(n=this.offset);var i,a=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(i=0;i<a;++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)}a=f.calculateUTF16asUTF8(t(e))[1],n+=a+1;var o=this.buffer.byteLength;return n>o&&this.resize((o*=2)>n?o:n),n-=a+1,f.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),this.view[n++]=0,r?(this.offset=n,this):a},o.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,a=-1;return f.decodeUTF8toUTF16(function(){if(0===a)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return a=this.view[e++],0===a?null:a}.bind(this),r=n(),!0),t?(this.offset=e,r()):{string:r(),length:e-i}},o.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,a=n;i=f.calculateUTF16asUTF8(t(e),this.noAssert)[1],n+=4+i;var o=this.buffer.byteLength;if(n>o&&this.resize((o*=2)>n?o: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,f.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==a+4+i)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+4+i));return r?(this.offset=n,this):n-a},o.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,a.METRICS_BYTES,e+=4);return e+=i.length,t?(this.offset=e,i.string):{string:i.string,length:e-n}},a.METRICS_CHARS="c",a.METRICS_BYTES="b",o.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,a=n;i=f.calculateUTF16asUTF8(t(e))[1],n+=i;var o=this.buffer.byteLength;return n>o&&this.resize((o*=2)>n?o:n),n-=i,f.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),r?(this.offset=n,this):n-a},o.writeString=o.writeUTF8String,a.calculateUTF8Chars=function(e){return f.calculateUTF16asUTF8(t(e))[0]},a.calculateUTF8Bytes=function(e){return f.calculateUTF16asUTF8(t(e))[1]},a.calculateString=a.calculateUTF8Bytes,o.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=a.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 o,s=0,u=r;if(t===a.METRICS_CHARS){if(o=n(),f.decodeUTF8(function(){return s<e&&r<this.limit?this.view[r++]:null}.bind(this),function(e){++s,f.UTF8toUTF16(e,o)}),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return i?(this.offset=r,o()):{string:o(),length:r-u}}if(t===a.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 l=r+e;if(f.decodeUTF8toUTF16(function(){return r<l?this.view[r++]:null}.bind(this),o=n(),this.noAssert),r!==l)throw RangeError("Illegal range: Truncated data, "+r+" == "+l);return i?(this.offset=r,o()):{string:o(),length:r-u}}throw TypeError("Unsupported metrics: "+t)},o.readString=o.readUTF8String,o.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,o,s=n;i=f.calculateUTF16asUTF8(t(e),this.noAssert)[1],o=a.calculateVarint32(i),n+=o+i;var u=this.buffer.byteLength;if(n>u&&this.resize((u*=2)>n?u:n),n-=o+i,n+=this.writeVarint32(i,n),f.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==s+i+o)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+i+o));return r?(this.offset=n,this):n-s},o.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,a.METRICS_BYTES,e+=r.length);return e+=i.length,t?(this.offset=e,i.string):{string:i.string,length:e-n}},o.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 a||(e=a.wrap(e,t));var i=e.limit-e.offset;if(i<=0)return this;n+=i;var o=this.buffer.byteLength;return n>o&&this.resize((o*=2)>n?o:n),n-=i,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=i,r&&(this.offset+=i),this},o.appendTo=function(e,t){return e.append(this,t),this},o.assert=function(e){return this.noAssert=!e,this},o.capacity=function(){return this.buffer.byteLength},o.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},o.clone=function(e){var t=new a(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},o.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=s,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},o.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 a(0,this.littleEndian,this.noAssert);var n=t-e,r=new a(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},o.copyTo=function(e,t,n,r){var i,o;if(!this.noAssert&&!a.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(o="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 s=r-n;return 0===s?e:(e.ensureCapacity(t+s),e.view.set(this.view.subarray(n,r),t),i&&(this.offset+=s),o&&(e.offset+=s),this)},o.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},o.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},o.flip=function(){return this.limit=this.offset,this.offset=0,this},o.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},o.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},o.LE=function(e){return this.littleEndian="undefined"==typeof e||!!e,this},o.BE=function(e){return this.littleEndian="undefined"!=typeof e&&!e,this},o.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 a||(e=a.wrap(e,t));var i=e.limit-e.offset;if(i<=0)return this;var o=i-n;if(o>0){var s=new ArrayBuffer(this.buffer.byteLength+o),u=new Uint8Array(s);u.set(this.view.subarray(n,this.buffer.byteLength),i),this.buffer=s,this.view=u,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,n+=o}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},o.prependTo=function(e,t){return e.prepend(this,t),this},o.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},o.remaining=function(){return this.limit-this.offset},o.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},o.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},o.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)},o.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},o.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},o.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 s;var r=new ArrayBuffer(n-t);return new Uint8Array(r).set(new Uint8Array(this.buffer).subarray(t,n),0),r},o.toArrayBuffer=o.toBuffer,o.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 l=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,a,o;null!==(i=e());)if(a=n[i],"undefined"==typeof a&&r(i),null!==(i=e())&&(o=n[i],"undefined"==typeof o&&r(i),t(a<<2>>>0|(48&o)>>4),null!==(i=e()))){if(a=n[i],"undefined"==typeof a){if(61===i)break;r(i)}if(t((15&o)<<4>>>0|(60&a)>>2),null!==(i=e())){if(o=n[i],"undefined"==typeof o){if(61===i)break;r(i)}t((3&a)<<6>>>0|o)}}},e.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},e}();o.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 l.encode(function(){return e<t?this.view[e++]:null}.bind(this),r=n()),r()},a.fromBase64=function(e,n){if("string"!=typeof e)throw TypeError("str");var r=new a(e.length/4*3,n),i=0;return l.decode(t(e),function(e){r.view[i++]=e}),r.limit=i,r},a.btoa=function(e){return a.fromBinary(e).toBase64()},a.atob=function(e){return a.fromBase64(e).toBinary()},o.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)},a.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var n,r=0,i=e.length,o=new a(i,t);r<i;){if(n=e.charCodeAt(r),n>255)throw RangeError("illegal char code: "+n);o.view[r++]=n}return o.limit=i,o},o.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",a="",o="";n<r;){if(n!==-1&&(t=this.view[n],i+=t<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(a+=t>32&&t<127?String.fromCharCode(t):".")),++n,e&&n>0&&n%16===0&&n!==r){for(;i.length<51;)i+=" ";o+=i+a+"\n",i=a=""}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+=" ";o+=i+a+"\n"}return e?o:i},a.fromDebug=function(e,t,n){for(var r,i,o=e.length,s=new a((o+1)/3|0,t,n),u=0,l=0,f=!1,d=!1,c=!1,h=!1,p=!1;u<o;){switch(r=e.charAt(u++)){case"!":if(!n){if(d||c||h){p=!0;break}d=c=h=!0}s.offset=s.markedOffset=s.limit=l,f=!1;break;case"|":if(!n){if(d||h){p=!0;break}d=h=!0}s.offset=s.limit=l,f=!1;break;case"[":if(!n){if(d||c){p=!0;break}d=c=!0}s.offset=s.markedOffset=l,f=!1;break;case"<":if(!n){if(d){p=!0;break}d=!0}s.offset=l,f=!1;break;case"]":if(!n){if(h||c){p=!0;break}h=c=!0}s.limit=s.markedOffset=l,f=!1;break;case">":if(!n){if(h){p=!0;break}h=!0}s.limit=l,f=!1;break;case"'":if(!n){if(c){p=!0;break}c=!0}s.markedOffset=l,f=!1;break;case" ":f=!1;break;default:if(!n&&f){p=!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");s.view[l++]=i,f=!0}if(p)throw TypeError("Illegal str: Invalid symbol at "+u)}if(!n){if(!d||!h)throw TypeError("Illegal str: Missing offset or limit");if(l<s.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+l+" < "+o)}return s},o.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("")},a.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,o=new a(i/2|0,t),s=0,u=0;s<i;s+=2){if(r=parseInt(e.substring(s,s+2),16),!n&&(!isFinite(r)||r<0||r>255))throw TypeError("Illegal str: Contains non-hex characters");o.view[u++]=r}return o.limit=u,o};var f=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,a,o=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())&&o([n,r]),t((31&n)<<6|63&r);else if(224===(240&n))(null===(r=e())||null===(i=e()))&&o([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===(a=e()))&&o([n,r,i,a]),t((7&n)<<18|(63&r)<<12|(63&i)<<6|63&a)}},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 o.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{f.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()},a.fromUTF8=function(e,n,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new a(f.calculateUTF16asUTF8(t(e),!0)[1],n,r),o=0;return f.encodeUTF16toUTF8(t(e),function(e){i.view[o++]=e}),i.limit=o,i},a})}).call(t,n(9)(e))},function(e,t){var n={utf8:{stringToBytes:function(e){return n.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(n.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}};e.exports=n},function(e,t,n){var r,i,a;!function(n,o){i=[t,e],r=o,a="function"==typeof r?r.apply(t,i):r,!(void 0!==a&&(e.exports=a))}(this,function(e,t){"use strict";function n(){return"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random())}function r(e){try{delete window[e]}catch(t){window[e]=void 0}}function i(e){var t=document.getElementById(e);document.getElementsByTagName("head")[0].removeChild(t)}function a(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=e,s=t.timeout||o.timeout,u=t.jsonpCallback||o.jsonpCallback,l=void 0;return new Promise(function(o,f){var d=t.jsonpCallbackFunction||n(),c=u+"_"+d;window[d]=function(e){o({ok:!0,json:function(){return Promise.resolve(e)}}),l&&clearTimeout(l),i(c),r(d)},a+=a.indexOf("?")===-1?"?":"&";var h=document.createElement("script");h.setAttribute("src",""+a+u+"="+d),h.id=c,document.getElementsByTagName("head")[0].appendChild(h),l=setTimeout(function(){f(new Error("JSONP request to "+e+" timed out")),r(d),i(c)},s)})}var o={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};t.exports=a})},function(e,t,n){!function(t,n){e.exports=n()}(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,t,n){e.exports=n(1)},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;if(!(e&&e.length&&t))throw new Error("ips and callback are required.");new a(e,t,n)}Object.defineProperty(t,"__esModule",{value:!0});var i=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}}();t.default=r;var a=function(){function e(t,r,i){n(this,e),this.ip="",this.ipcallback=r,this.timeoutId=null,this.reqsCache=[];for(var a=0;a<t.length;a++)this.reqsCache.push(this.send(t[a],i-10));this.timeoutId=setTimeout(this.notify.bind(this),i)}return i(e,[{key:"clearAll",value:function(){this.reqsCache&&this.reqsCache.length&&this.reqsCache.forEach(function(e){e.abort()}),clearTimeout(this.timeoutId),this.ip="",this.ipcallback=null,this.timeoutId=null,this.reqsCache=[]}},{key:"clearReq",value:function(e){this.reqsCache.splice(this.reqsCache.indexOf(e),1)}},{key:"notify",value:function(){this.ipcallback(this.ip),this.clearAll()}},{key:"send",value:function(e,t){var n=this,r=new XMLHttpRequest;return r.open("HEAD","//"+e+"/?_="+Date.now()),r.timeout=t,r.onload=function(){n.ip=e,n.clearReq(r),r.onload=null,n.notify()},r.ontimeout=function(){n.clearReq(r),r.ontimeout=null},r.onerror=function(){n.clearReq(r),r.onerror=null},r.onabort=function(){n.clearReq(r),r.onabort=null},r.send(),r}}]),e}();!function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(a,"IpHunter","/Users/AlexWang/ws/iphunter/src/main.js"),__REACT_HOT_LOADER__.register(r,"check","/Users/AlexWang/ws/iphunter/src/main.js"))}()}])})},function(e,t,n){var r,i;!function(t,n){"use strict";"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(n,a){"use strict";function o(e,t){t=t||re;var n=t.createElement("script");n.text=e,t.head.appendChild(n).parentNode.removeChild(n)}function s(e){var t=!!e&&"length"in e&&e.length,n=Ee.type(e);return"function"!==n&&!Ee.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function u(e,t,n){if(Ee.isFunction(t))return Ee.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return Ee.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(Ae.test(t))return Ee.filter(t,e,n);t=Ee.filter(t,e)}return Ee.grep(e,function(e){return ue.call(t,e)>-1!==n&&1===e.nodeType})}function l(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function f(e){var t={};return Ee.each(e.match(Ne)||[],function(e,n){t[n]=!0}),t}function d(e){return e}function c(e){throw e}function h(e,t,n){var r;try{e&&Ee.isFunction(r=e.promise)?r.call(e).done(t).fail(n):e&&Ee.isFunction(r=e.then)?r.call(e,t,n):t.call(void 0,e)}catch(e){n.call(void 0,e)}}function p(){re.removeEventListener("DOMContentLoaded",p),n.removeEventListener("load",p),Ee.ready()}function _(){this.expando=Ee.expando+_.uid++}function E(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(He,"-$&").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:Fe.test(n)?JSON.parse(n):n)}catch(e){}Be.set(e,t,n)}else n=void 0;return n}function g(e,t,n,r){var i,a=1,o=20,s=r?function(){return r.cur()}:function(){return Ee.css(e,t,"")},u=s(),l=n&&n[3]||(Ee.cssNumber[t]?"":"px"),f=(Ee.cssNumber[t]||"px"!==l&&+u)&&Ge.exec(Ee.css(e,t));if(f&&f[3]!==l){l=l||f[3],n=n||[],f=+u||1;do a=a||".5",f/=a,Ee.style(e,t,f+l);while(a!==(a=s()/u)&&1!==a&&--o)}return n&&(f=+f||+u||0,i=n[1]?f+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=f,r.end=i)),i}function y(e){var t,n=e.ownerDocument,r=e.nodeName,i=Je[r];return i?i:(t=n.body.appendChild(n.createElement(r)),i=Ee.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),Je[r]=i,i)}function R(e,t){for(var n,r,i=[],a=0,o=e.length;a<o;a++)r=e[a],r.style&&(n=r.style.display,t?("none"===n&&(i[a]=xe.get(r,"display")||null,i[a]||(r.style.display="")),""===r.style.display&&Ve(r)&&(i[a]=y(r))):"none"!==n&&(i[a]="none",xe.set(r,"display",n)));for(a=0;a<o;a++)null!=i[a]&&(e[a].style.display=i[a]);return e}function m(e,t){var n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&Ee.nodeName(e,t)?Ee.merge([e],n):n}function v(e,t){for(var n=0,r=e.length;n<r;n++)xe.set(e[n],"globalEval",!t||xe.get(t[n],"globalEval"))}function T(e,t,n,r,i){for(var a,o,s,u,l,f,d=t.createDocumentFragment(),c=[],h=0,p=e.length;h<p;h++)if(a=e[h],a||0===a)if("object"===Ee.type(a))Ee.merge(c,a.nodeType?[a]:a);else if($e.test(a)){for(o=o||d.appendChild(t.createElement("div")),s=(Qe.exec(a)||["",""])[1].toLowerCase(),u=ze[s]||ze._default,o.innerHTML=u[1]+Ee.htmlPrefilter(a)+u[2],f=u[0];f--;)o=o.lastChild;Ee.merge(c,o.childNodes),o=d.firstChild,o.textContent=""}else c.push(t.createTextNode(a));for(d.textContent="",h=0;a=c[h++];)if(r&&Ee.inArray(a,r)>-1)i&&i.push(a);else if(l=Ee.contains(a.ownerDocument,a),o=m(d.appendChild(a),"script"),l&&v(o),n)for(f=0;a=o[f++];)Ke.test(a.type||"")&&n.push(a);return d}function C(){return!0}function S(){return!1}function I(){try{return re.activeElement}catch(e){}}function A(e,t,n,r,i,a){var o,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)A(e,s,n,r,t[s],a);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=S;else if(!i)return e;return 1===a&&(o=i,i=function(e){return Ee().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=Ee.guid++)),e.each(function(){Ee.event.add(this,t,i,r,n)})}function b(e,t){return Ee.nodeName(e,"table")&&Ee.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e:e}function w(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function D(e){var t=at.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function P(e,t){var n,r,i,a,o,s,u,l;if(1===t.nodeType){if(xe.hasData(e)&&(a=xe.access(e),o=xe.set(t,a),l=a.events)){delete o.handle,o.events={};for(i in l)for(n=0,r=l[i].length;n<r;n++)Ee.event.add(t,i,l[i][n])}Be.hasData(e)&&(s=Be.access(e),u=Ee.extend({},s),Be.set(t,u))}}function O(e,t){var n=t.nodeName.toLowerCase();"input"===n&&We.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function N(e,t,n,r){t=oe.apply([],t);var i,a,s,u,l,f,d=0,c=e.length,h=c-1,p=t[0],_=Ee.isFunction(p);if(_||c>1&&"string"==typeof p&&!pe.checkClone&&it.test(p))return e.each(function(i){var a=e.eq(i);_&&(t[0]=p.call(this,i,a.html())),N(a,t,n,r)});if(c&&(i=T(t,e[0].ownerDocument,!1,e,r),a=i.firstChild,1===i.childNodes.length&&(i=a),a||r)){for(s=Ee.map(m(i,"script"),w),u=s.length;d<c;d++)l=i,d!==h&&(l=Ee.clone(l,!0,!0),u&&Ee.merge(s,m(l,"script"))),n.call(e[d],l,d);if(u)for(f=s[s.length-1].ownerDocument,Ee.map(s,D),d=0;d<u;d++)l=s[d],Ke.test(l.type||"")&&!xe.access(l,"globalEval")&&Ee.contains(f,l)&&(l.src?Ee._evalUrl&&Ee._evalUrl(l.src):o(l.textContent.replace(ot,""),f))}return e}function U(e,t,n){for(var r,i=t?Ee.filter(t,e):e,a=0;null!=(r=i[a]);a++)n||1!==r.nodeType||Ee.cleanData(m(r)),r.parentNode&&(n&&Ee.contains(r.ownerDocument,r)&&v(m(r,"script")),r.parentNode.removeChild(r));return e}function L(e,t,n){var r,i,a,o,s=e.style;return n=n||lt(e),n&&(o=n.getPropertyValue(t)||n[t],""!==o||Ee.contains(e.ownerDocument,e)||(o=Ee.style(e,t)),!pe.pixelMarginRight()&&ut.test(o)&&st.test(t)&&(r=s.width,i=s.minWidth,a=s.maxWidth,s.minWidth=s.maxWidth=s.width=o,o=n.width,s.width=r,s.minWidth=i,s.maxWidth=a)),void 0!==o?o+"":o}function k(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function M(e){if(e in pt)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=ht.length;n--;)if(e=ht[n]+t,e in pt)return e}function x(e,t,n){var r=Ge.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function B(e,t,n,r,i){for(var a=n===(r?"border":"content")?4:"width"===t?1:0,o=0;a<4;a+=2)"margin"===n&&(o+=Ee.css(e,n+qe[a],!0,i)),r?("content"===n&&(o-=Ee.css(e,"padding"+qe[a],!0,i)),"margin"!==n&&(o-=Ee.css(e,"border"+qe[a]+"Width",!0,i))):(o+=Ee.css(e,"padding"+qe[a],!0,i),"padding"!==n&&(o+=Ee.css(e,"border"+qe[a]+"Width",!0,i)));return o}function F(e,t,n){var r,i=!0,a=lt(e),o="border-box"===Ee.css(e,"boxSizing",!1,a);if(e.getClientRects().length&&(r=e.getBoundingClientRect()[t]),r<=0||null==r){if(r=L(e,t,a),(r<0||null==r)&&(r=e.style[t]),ut.test(r))return r;i=o&&(pe.boxSizingReliable()||r===e.style[t]),r=parseFloat(r)||0}return r+B(e,t,n||(o?"border":"content"),i,a)+"px"}function H(e,t,n,r,i){return new H.prototype.init(e,t,n,r,i)}function j(){Et&&(n.requestAnimationFrame(j),Ee.fx.tick())}function G(){return n.setTimeout(function(){_t=void 0}),_t=Ee.now()}function q(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)n=qe[r],i["margin"+n]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function V(e,t,n){for(var r,i=(W.tweeners[t]||[]).concat(W.tweeners["*"]),a=0,o=i.length;a<o;a++)if(r=i[a].call(n,t,e))return r}function Y(e,t,n){var r,i,a,o,s,u,l,f,d="width"in t||"height"in t,c=this,h={},p=e.style,_=e.nodeType&&Ve(e),E=xe.get(e,"fxshow");n.queue||(o=Ee._queueHooks(e,"fx"),null==o.unqueued&&(o.unqueued=0,s=o.empty.fire,o.empty.fire=function(){o.unqueued||s()}),o.unqueued++,c.always(function(){c.always(function(){o.unqueued--,Ee.queue(e,"fx").length||o.empty.fire()})}));for(r in t)if(i=t[r],gt.test(i)){if(delete t[r],a=a||"toggle"===i,i===(_?"hide":"show")){if("show"!==i||!E||void 0===E[r])continue;_=!0}h[r]=E&&E[r]||Ee.style(e,r)}if(u=!Ee.isEmptyObject(t),u||!Ee.isEmptyObject(h)){d&&1===e.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],l=E&&E.display,null==l&&(l=xe.get(e,"display")),f=Ee.css(e,"display"),"none"===f&&(l?f=l:(R([e],!0),l=e.style.display||l,f=Ee.css(e,"display"),R([e]))),("inline"===f||"inline-block"===f&&null!=l)&&"none"===Ee.css(e,"float")&&(u||(c.done(function(){p.display=l}),null==l&&(f=p.display,l="none"===f?"":f)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",c.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]})),u=!1;for(r in h)u||(E?"hidden"in E&&(_=E.hidden):E=xe.access(e,"fxshow",{display:l}),a&&(E.hidden=!_),_&&R([e],!0),c.done(function(){_||R([e]),xe.remove(e,"fxshow");for(r in h)Ee.style(e,r,h[r])})),u=V(_?E[r]:0,r,c),r in E||(E[r]=u.start,_&&(u.end=u.start,u.start=0))}}function J(e,t){var n,r,i,a,o;for(n in e)if(r=Ee.camelCase(n),i=t[r],a=e[n],Ee.isArray(a)&&(i=a[1],a=e[n]=a[0]),n!==r&&(e[r]=a,delete e[n]),o=Ee.cssHooks[r],o&&"expand"in o){a=o.expand(a),delete e[r];for(n in a)n in e||(e[n]=a[n],t[n]=i)}else t[r]=i}function W(e,t,n){var r,i,a=0,o=W.prefilters.length,s=Ee.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=_t||G(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,a=1-r,o=0,u=l.tweens.length;o<u;o++)l.tweens[o].run(a);return s.notifyWith(e,[l,a,n]),a<1&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:Ee.extend({},t),opts:Ee.extend(!0,{specialEasing:{},easing:Ee.easing._default},n),originalProperties:t,originalOptions:n,startTime:_t||G(),duration:n.duration,tweens:[],createTween:function(t,n){var r=Ee.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),f=l.props;for(J(f,l.opts.specialEasing);a<o;a++)if(r=W.prefilters[a].call(l,e,f,l.opts))return Ee.isFunction(r.stop)&&(Ee._queueHooks(l.elem,l.opts.queue).stop=Ee.proxy(r.stop,r)),r;return Ee.map(f,V,l),Ee.isFunction(l.opts.start)&&l.opts.start.call(e,l),Ee.fx.timer(Ee.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function Q(e){return e.getAttribute&&e.getAttribute("class")||""}function K(e,t,n,r){var i;if(Ee.isArray(t))Ee.each(t,function(t,i){n||Pt.test(e)?r(e,i):K(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==Ee.type(t))r(e,t);else for(i in t)K(e+"["+i+"]",t[i],n,r)}function z(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,a=t.toLowerCase().match(Ne)||[];if(Ee.isFunction(n))for(;r=a[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function $(e,t,n,r){function i(s){var u;return a[s]=!0,Ee.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||a[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),i(l),!1)}),u}var a={},o=e===Gt;return i(t.dataTypes[0])||!a["*"]&&i("*")}function Z(e,t){var n,r,i=Ee.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&Ee.extend(!0,e,r),e}function X(e,t,n){for(var r,i,a,o,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)a=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){a=i;break}o||(o=i)}a=a||o}if(a)return a!==u[0]&&u.unshift(a),n[a]}function ee(e,t,n,r){var i,a,o,s,u,l={},f=e.dataTypes.slice();if(f[1])for(o in e.converters)l[o.toLowerCase()]=e.converters[o];for(a=f.shift();a;)if(e.responseFields[a]&&(n[e.responseFields[a]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=a,a=f.shift())if("*"===a)a=u;else if("*"!==u&&u!==a){if(o=l[u+" "+a]||l["* "+a],!o)for(i in l)if(s=i.split(" "),s[1]===a&&(o=l[u+" "+s[0]]||l["* "+s[0]])){o===!0?o=l[i]:l[i]!==!0&&(a=s[0],f.unshift(s[1]));break}if(o!==!0)if(o&&e.throws)t=o(t);else try{t=o(t)}catch(e){return{state:"parsererror",error:o?e:"No conversion from "+u+" to "+a}}}return{state:"success",data:t}}function te(e){return Ee.isWindow(e)?e:9===e.nodeType&&e.defaultView}var ne=[],re=n.document,ie=Object.getPrototypeOf,ae=ne.slice,oe=ne.concat,se=ne.push,ue=ne.indexOf,le={},fe=le.toString,de=le.hasOwnProperty,ce=de.toString,he=ce.call(Object),pe={},_e="3.1.0",Ee=function(e,t){return new Ee.fn.init(e,t)},ge=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ye=/^-ms-/,Re=/-([a-z])/g,me=function(e,t){return t.toUpperCase()};Ee.fn=Ee.prototype={jquery:_e,constructor:Ee,length:0,toArray:function(){return ae.call(this)},get:function(e){return null!=e?e<0?this[e+this.length]:this[e]:ae.call(this)},pushStack:function(e){var t=Ee.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return Ee.each(this,e)},map:function(e){return this.pushStack(Ee.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(ae.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:se,sort:ne.sort,splice:ne.splice},Ee.extend=Ee.fn.extend=function(){var e,t,n,r,i,a,o=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof o&&(l=o,o=arguments[s]||{},s++),"object"==typeof o||Ee.isFunction(o)||(o={}),s===u&&(o=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)n=o[t],r=e[t],o!==r&&(l&&r&&(Ee.isPlainObject(r)||(i=Ee.isArray(r)))?(i?(i=!1,a=n&&Ee.isArray(n)?n:[]):a=n&&Ee.isPlainObject(n)?n:{},o[t]=Ee.extend(l,a,r)):void 0!==r&&(o[t]=r));return o},Ee.extend({expando:"jQuery"+(_e+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===Ee.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=Ee.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==fe.call(e))&&(!(t=ie(e))||(n=de.call(t,"constructor")&&t.constructor,"function"==typeof n&&ce.call(n)===he)); +},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?le[fe.call(e)]||"object":typeof e},globalEval:function(e){o(e)},camelCase:function(e){return e.replace(ye,"ms-").replace(Re,me)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var n,r=0;if(s(e))for(n=e.length;r<n&&t.call(e[r],r,e[r])!==!1;r++);else for(r in e)if(t.call(e[r],r,e[r])===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(ge,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(s(Object(e))?Ee.merge(n,"string"==typeof e?[e]:e):se.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:ue.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],a=0,o=e.length,s=!n;a<o;a++)r=!t(e[a],a),r!==s&&i.push(e[a]);return i},map:function(e,t,n){var r,i,a=0,o=[];if(s(e))for(r=e.length;a<r;a++)i=t(e[a],a,n),null!=i&&o.push(i);else for(a in e)i=t(e[a],a,n),null!=i&&o.push(i);return oe.apply([],o)},guid:1,proxy:function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),Ee.isFunction(e))return r=ae.call(arguments,2),i=function(){return e.apply(t||this,r.concat(ae.call(arguments)))},i.guid=e.guid=e.guid||Ee.guid++,i},now:Date.now,support:pe}),"function"==typeof Symbol&&(Ee.fn[Symbol.iterator]=ne[Symbol.iterator]),Ee.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){le["[object "+t+"]"]=t.toLowerCase()});var ve=function(e){function t(e,t,n,r){var i,a,o,s,u,l,f,c=t&&t.ownerDocument,p=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==p&&9!==p&&11!==p)return n;if(!r&&((t?t.ownerDocument||t:j)!==U&&N(t),t=t||U,k)){if(11!==p&&(u=ge.exec(e)))if(i=u[1]){if(9===p){if(!(o=t.getElementById(i)))return n;if(o.id===i)return n.push(o),n}else if(c&&(o=c.getElementById(i))&&F(t,o)&&o.id===i)return n.push(o),n}else{if(u[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((i=u[3])&&T.getElementsByClassName&&t.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(i)),n}if(T.qsa&&!J[e+" "]&&(!M||!M.test(e))){if(1!==p)c=t,f=e;else if("object"!==t.nodeName.toLowerCase()){for((s=t.getAttribute("id"))?s=s.replace(ve,Te):t.setAttribute("id",s=H),l=A(e),a=l.length;a--;)l[a]="#"+s+" "+h(l[a]);f=l.join(","),c=ye.test(e)&&d(t.parentNode)||t}if(f)try{return Z.apply(n,c.querySelectorAll(f)),n}catch(e){}finally{s===H&&t.removeAttribute("id")}}}return w(e.replace(se,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>C.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[H]=!0,e}function i(e){var t=U.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function a(e,t){for(var n=e.split("|"),r=n.length;r--;)C.attrHandle[n[r]]=t}function o(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return function(t){return"label"in t&&t.disabled===e||"form"in t&&t.disabled===e||"form"in t&&t.disabled===!1&&(t.isDisabled===e||t.isDisabled!==!e&&("label"in t||!Se(t))!==e)}}function f(e){return r(function(t){return t=+t,r(function(n,r){for(var i,a=e([],n.length,t),o=a.length;o--;)n[i=a[o]]&&(n[i]=!(r[i]=n[i]))})})}function d(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function c(){}function h(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function p(e,t,n){var r=t.dir,i=t.next,a=i||r,o=n&&"parentNode"===a,s=q++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,u){var l,f,d,c=[G,s];if(u){for(;t=t[r];)if((1===t.nodeType||o)&&e(t,n,u))return!0}else for(;t=t[r];)if(1===t.nodeType||o)if(d=t[H]||(t[H]={}),f=d[t.uniqueID]||(d[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=f[a])&&l[0]===G&&l[1]===s)return c[2]=l[2];if(f[a]=c,c[2]=e(t,n,u))return!0}}}function _(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function E(e,n,r){for(var i=0,a=n.length;i<a;i++)t(e,n[i],r);return r}function g(e,t,n,r,i){for(var a,o=[],s=0,u=e.length,l=null!=t;s<u;s++)(a=e[s])&&(n&&!n(a,r,i)||(o.push(a),l&&t.push(s)));return o}function y(e,t,n,i,a,o){return i&&!i[H]&&(i=y(i)),a&&!a[H]&&(a=y(a,o)),r(function(r,o,s,u){var l,f,d,c=[],h=[],p=o.length,_=r||E(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?_:g(_,c,e,s,u),R=n?a||(r?e:p||i)?[]:o:y;if(n&&n(y,R,s,u),i)for(l=g(R,h),i(l,[],s,u),f=l.length;f--;)(d=l[f])&&(R[h[f]]=!(y[h[f]]=d));if(r){if(a||e){if(a){for(l=[],f=R.length;f--;)(d=R[f])&&l.push(y[f]=d);a(null,R=[],l,u)}for(f=R.length;f--;)(d=R[f])&&(l=a?ee(r,d):c[f])>-1&&(r[l]=!(o[l]=d))}}else R=g(R===o?R.splice(p,R.length):R),a?a(null,o,R,u):Z.apply(o,R)})}function R(e){for(var t,n,r,i=e.length,a=C.relative[e[0].type],o=a||C.relative[" "],s=a?1:0,u=p(function(e){return e===t},o,!0),l=p(function(e){return ee(t,e)>-1},o,!0),f=[function(e,n,r){var i=!a&&(r||n!==D)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];s<i;s++)if(n=C.relative[e[s].type])f=[p(_(f),n)];else{if(n=C.filter[e[s].type].apply(null,e[s].matches),n[H]){for(r=++s;r<i&&!C.relative[e[r].type];r++);return y(s>1&&_(f),s>1&&h(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,s<r&&R(e.slice(s,r)),r<i&&R(e=e.slice(r)),r<i&&h(e))}f.push(n)}return _(f)}function m(e,n){var i=n.length>0,a=e.length>0,o=function(r,o,s,u,l){var f,d,c,h=0,p="0",_=r&&[],E=[],y=D,R=r||a&&C.find.TAG("*",l),m=G+=null==y?1:Math.random()||.1,v=R.length;for(l&&(D=o===U||o||l);p!==v&&null!=(f=R[p]);p++){if(a&&f){for(d=0,o||f.ownerDocument===U||(N(f),s=!k);c=e[d++];)if(c(f,o||U,s)){u.push(f);break}l&&(G=m)}i&&((f=!c&&f)&&h--,r&&_.push(f))}if(h+=p,i&&p!==h){for(d=0;c=n[d++];)c(_,E,o,s);if(r){if(h>0)for(;p--;)_[p]||E[p]||(E[p]=z.call(u));E=g(E)}Z.apply(u,E),l&&!r&&E.length>0&&h+n.length>1&&t.uniqueSort(u)}return l&&(G=m,D=y),_};return i?r(o):o}var v,T,C,S,I,A,b,w,D,P,O,N,U,L,k,M,x,B,F,H="sizzle"+1*new Date,j=e.document,G=0,q=0,V=n(),Y=n(),J=n(),W=function(e,t){return e===t&&(O=!0),0},Q={}.hasOwnProperty,K=[],z=K.pop,$=K.push,Z=K.push,X=K.slice,ee=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",ie="\\["+ne+"*("+re+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+re+"))|)"+ne+"*\\]",ae=":("+re+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ie+")*)|.*)\\)|)",oe=new RegExp(ne+"+","g"),se=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),ue=new RegExp("^"+ne+"*,"+ne+"*"),le=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),fe=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),de=new RegExp(ae),ce=new RegExp("^"+re+"$"),he={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,_e=/^h\d$/i,Ee=/^[^{]+\{\s*\[native \w/,ge=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,Re=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),me=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},ve=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,Te=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},Ce=function(){N()},Se=p(function(e){return e.disabled===!0},{dir:"parentNode",next:"legend"});try{Z.apply(K=X.call(j.childNodes),j.childNodes),K[j.childNodes.length].nodeType}catch(e){Z={apply:K.length?function(e,t){$.apply(e,X.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}T=t.support={},I=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},N=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:j;return r!==U&&9===r.nodeType&&r.documentElement?(U=r,L=U.documentElement,k=!I(U),j!==U&&(n=U.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Ce,!1):n.attachEvent&&n.attachEvent("onunload",Ce)),T.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),T.getElementsByTagName=i(function(e){return e.appendChild(U.createComment("")),!e.getElementsByTagName("*").length}),T.getElementsByClassName=Ee.test(U.getElementsByClassName),T.getById=i(function(e){return L.appendChild(e).id=H,!U.getElementsByName||!U.getElementsByName(H).length}),T.getById?(C.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&k){var n=t.getElementById(e);return n?[n]:[]}},C.filter.ID=function(e){var t=e.replace(Re,me);return function(e){return e.getAttribute("id")===t}}):(delete C.find.ID,C.filter.ID=function(e){var t=e.replace(Re,me);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),C.find.TAG=T.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):T.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,a=t.getElementsByTagName(e);if("*"===e){for(;n=a[i++];)1===n.nodeType&&r.push(n);return r}return a},C.find.CLASS=T.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&k)return t.getElementsByClassName(e)},x=[],M=[],(T.qsa=Ee.test(U.querySelectorAll))&&(i(function(e){L.appendChild(e).innerHTML="<a id='"+H+"'></a><select id='"+H+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&M.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||M.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+H+"-]").length||M.push("~="),e.querySelectorAll(":checked").length||M.push(":checked"),e.querySelectorAll("a#"+H+"+*").length||M.push(".#.+[+~]")}),i(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=U.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&M.push("name"+ne+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&M.push(":enabled",":disabled"),L.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&M.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),M.push(",.*:")})),(T.matchesSelector=Ee.test(B=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){T.disconnectedMatch=B.call(e,"*"),B.call(e,"[s!='']:x"),x.push("!=",ae)}),M=M.length&&new RegExp(M.join("|")),x=x.length&&new RegExp(x.join("|")),t=Ee.test(L.compareDocumentPosition),F=t||Ee.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},W=t?function(e,t){if(e===t)return O=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!T.sortDetached&&t.compareDocumentPosition(e)===n?e===U||e.ownerDocument===j&&F(j,e)?-1:t===U||t.ownerDocument===j&&F(j,t)?1:P?ee(P,e)-ee(P,t):0:4&n?-1:1)}:function(e,t){if(e===t)return O=!0,0;var n,r=0,i=e.parentNode,a=t.parentNode,s=[e],u=[t];if(!i||!a)return e===U?-1:t===U?1:i?-1:a?1:P?ee(P,e)-ee(P,t):0;if(i===a)return o(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;s[r]===u[r];)r++;return r?o(s[r],u[r]):s[r]===j?-1:u[r]===j?1:0},U):U},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==U&&N(e),n=n.replace(fe,"='$1']"),T.matchesSelector&&k&&!J[n+" "]&&(!x||!x.test(n))&&(!M||!M.test(n)))try{var r=B.call(e,n);if(r||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return t(n,U,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==U&&N(e),F(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==U&&N(e);var n=C.attrHandle[t.toLowerCase()],r=n&&Q.call(C.attrHandle,t.toLowerCase())?n(e,t,!k):void 0;return void 0!==r?r:T.attributes||!k?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.escape=function(e){return(e+"").replace(ve,Te)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(O=!T.detectDuplicates,P=!T.sortStable&&e.slice(0),e.sort(W),O){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return P=null,e},S=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=S(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=S(t);return n},C=t.selectors={cacheLength:50,createPseudo:r,match:he,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Re,me),e[3]=(e[3]||e[4]||e[5]||"").replace(Re,me),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=A(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Re,me).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=V[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&V(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var a=t.attr(i,e);return null==a?"!="===n:!n||(a+="","="===n?a===r:"!="===n?a!==r:"^="===n?r&&0===a.indexOf(r):"*="===n?r&&a.indexOf(r)>-1:"$="===n?r&&a.slice(-r.length)===r:"~="===n?(" "+a.replace(oe," ")+" ").indexOf(r)>-1:"|="===n&&(a===r||a.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var a="nth"!==e.slice(0,3),o="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,f,d,c,h,p,_=a!==o?"nextSibling":"previousSibling",E=t.parentNode,g=s&&t.nodeName.toLowerCase(),y=!u&&!s,R=!1;if(E){if(a){for(;_;){for(c=t;c=c[_];)if(s?c.nodeName.toLowerCase()===g:1===c.nodeType)return!1;p=_="only"===e&&!p&&"nextSibling"}return!0}if(p=[o?E.firstChild:E.lastChild],o&&y){for(c=E,d=c[H]||(c[H]={}),f=d[c.uniqueID]||(d[c.uniqueID]={}),l=f[e]||[],h=l[0]===G&&l[1],R=h&&l[2],c=h&&E.childNodes[h];c=++h&&c&&c[_]||(R=h=0)||p.pop();)if(1===c.nodeType&&++R&&c===t){f[e]=[G,h,R];break}}else if(y&&(c=t,d=c[H]||(c[H]={}),f=d[c.uniqueID]||(d[c.uniqueID]={}),l=f[e]||[],h=l[0]===G&&l[1],R=h),R===!1)for(;(c=++h&&c&&c[_]||(R=h=0)||p.pop())&&((s?c.nodeName.toLowerCase()!==g:1!==c.nodeType)||!++R||(y&&(d=c[H]||(c[H]={}),f=d[c.uniqueID]||(d[c.uniqueID]={}),f[e]=[G,R]),c!==t)););return R-=i,R===r||R%r===0&&R/r>=0}}},PSEUDO:function(e,n){var i,a=C.pseudos[e]||C.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return a[H]?a(n):a.length>1?(i=[e,e,"",n],C.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=a(e,n),o=i.length;o--;)r=ee(e,i[o]),e[r]=!(t[r]=i[o])}):function(e){return a(e,0,i)}):a}},pseudos:{not:r(function(e){var t=[],n=[],i=b(e.replace(se,"$1"));return i[H]?r(function(e,t,n,r){for(var a,o=i(e,null,r,[]),s=e.length;s--;)(a=o[s])&&(e[s]=!(t[s]=a))}):function(e,r,a){return t[0]=e,i(t,null,a,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(Re,me),function(t){return(t.textContent||t.innerText||S(t)).indexOf(e)>-1}}),lang:r(function(e){return ce.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(Re,me).toLowerCase(),function(t){var n;do if(n=k?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===L},focus:function(e){return e===U.activeElement&&(!U.hasFocus||U.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:l(!1),disabled:l(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!C.pseudos.empty(e)},header:function(e){return _e.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:f(function(){return[0]}),last:f(function(e,t){return[t-1]}),eq:f(function(e,t,n){return[n<0?n+t:n]}),even:f(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:f(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:f(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:f(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},C.pseudos.nth=C.pseudos.eq;for(v in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.pseudos[v]=s(v);for(v in{submit:!0,reset:!0})C.pseudos[v]=u(v);return c.prototype=C.filters=C.pseudos,C.setFilters=new c,A=t.tokenize=function(e,n){var r,i,a,o,s,u,l,f=Y[e+" "];if(f)return n?0:f.slice(0);for(s=e,u=[],l=C.preFilter;s;){r&&!(i=ue.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(a=[])),r=!1,(i=le.exec(s))&&(r=i.shift(),a.push({value:r,type:i[0].replace(se," ")}),s=s.slice(r.length));for(o in C.filter)!(i=he[o].exec(s))||l[o]&&!(i=l[o](i))||(r=i.shift(),a.push({value:r,type:o,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?t.error(e):Y(e,u).slice(0)},b=t.compile=function(e,t){var n,r=[],i=[],a=J[e+" "];if(!a){for(t||(t=A(e)),n=t.length;n--;)a=R(t[n]),a[H]?r.push(a):i.push(a);a=J(e,m(i,r)),a.selector=e}return a},w=t.select=function(e,t,n,r){var i,a,o,s,u,l="function"==typeof e&&e,f=!r&&A(e=l.selector||e);if(n=n||[],1===f.length){if(a=f[0]=f[0].slice(0),a.length>2&&"ID"===(o=a[0]).type&&T.getById&&9===t.nodeType&&k&&C.relative[a[1].type]){if(t=(C.find.ID(o.matches[0].replace(Re,me),t)||[])[0],!t)return n;l&&(t=t.parentNode),e=e.slice(a.shift().value.length)}for(i=he.needsContext.test(e)?0:a.length;i--&&(o=a[i],!C.relative[s=o.type]);)if((u=C.find[s])&&(r=u(o.matches[0].replace(Re,me),ye.test(a[0].type)&&d(t.parentNode)||t))){if(a.splice(i,1),e=r.length&&h(a),!e)return Z.apply(n,r),n;break}}return(l||b(e,f))(r,t,!k,n,!t||ye.test(e)&&d(t.parentNode)||t),n},T.sortStable=H.split("").sort(W).join("")===H,T.detectDuplicates=!!O,N(),T.sortDetached=i(function(e){return 1&e.compareDocumentPosition(U.createElement("fieldset"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||a("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),T.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||a("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||a(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(n);Ee.find=ve,Ee.expr=ve.selectors,Ee.expr[":"]=Ee.expr.pseudos,Ee.uniqueSort=Ee.unique=ve.uniqueSort,Ee.text=ve.getText,Ee.isXMLDoc=ve.isXML,Ee.contains=ve.contains,Ee.escapeSelector=ve.escape;var Te=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&Ee(e).is(n))break;r.push(e)}return r},Ce=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},Se=Ee.expr.match.needsContext,Ie=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,Ae=/^.[^:#\[\.,]*$/;Ee.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?Ee.find.matchesSelector(r,e)?[r]:[]:Ee.find.matches(e,Ee.grep(t,function(e){return 1===e.nodeType}))},Ee.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(Ee(e).filter(function(){for(t=0;t<r;t++)if(Ee.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)Ee.find(e,i[t],n);return r>1?Ee.uniqueSort(n):n},filter:function(e){return this.pushStack(u(this,e||[],!1))},not:function(e){return this.pushStack(u(this,e||[],!0))},is:function(e){return!!u(this,"string"==typeof e&&Se.test(e)?Ee(e):e||[],!1).length}});var be,we=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,De=Ee.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||be,"string"==typeof e){if(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:we.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof Ee?t[0]:t,Ee.merge(this,Ee.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:re,!0)),Ie.test(r[1])&&Ee.isPlainObject(t))for(r in t)Ee.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=re.getElementById(r[2]),i&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):Ee.isFunction(e)?void 0!==n.ready?n.ready(e):e(Ee):Ee.makeArray(e,this)};De.prototype=Ee.fn,be=Ee(re);var Pe=/^(?:parents|prev(?:Until|All))/,Oe={children:!0,contents:!0,next:!0,prev:!0};Ee.fn.extend({has:function(e){var t=Ee(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(Ee.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,a=[],o="string"!=typeof e&&Ee(e);if(!Se.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:1===n.nodeType&&Ee.find.matchesSelector(n,e))){a.push(n);break}return this.pushStack(a.length>1?Ee.uniqueSort(a):a)},index:function(e){return e?"string"==typeof e?ue.call(Ee(e),this[0]):ue.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(Ee.uniqueSort(Ee.merge(this.get(),Ee(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),Ee.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Te(e,"parentNode")},parentsUntil:function(e,t,n){return Te(e,"parentNode",n)},next:function(e){return l(e,"nextSibling")},prev:function(e){return l(e,"previousSibling")},nextAll:function(e){return Te(e,"nextSibling")},prevAll:function(e){return Te(e,"previousSibling")},nextUntil:function(e,t,n){return Te(e,"nextSibling",n)},prevUntil:function(e,t,n){return Te(e,"previousSibling",n)},siblings:function(e){return Ce((e.parentNode||{}).firstChild,e)},children:function(e){return Ce(e.firstChild)},contents:function(e){return e.contentDocument||Ee.merge([],e.childNodes)}},function(e,t){Ee.fn[e]=function(n,r){var i=Ee.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=Ee.filter(r,i)),this.length>1&&(Oe[e]||Ee.uniqueSort(i),Pe.test(e)&&i.reverse()),this.pushStack(i)}});var Ne=/\S+/g;Ee.Callbacks=function(e){e="string"==typeof e?f(e):Ee.extend({},e);var t,n,r,i,a=[],o=[],s=-1,u=function(){for(i=e.once,r=t=!0;o.length;s=-1)for(n=o.shift();++s<a.length;)a[s].apply(n[0],n[1])===!1&&e.stopOnFalse&&(s=a.length,n=!1);e.memory||(n=!1),t=!1,i&&(a=n?[]:"")},l={add:function(){return a&&(n&&!t&&(s=a.length-1,o.push(n)),function t(n){Ee.each(n,function(n,r){Ee.isFunction(r)?e.unique&&l.has(r)||a.push(r):r&&r.length&&"string"!==Ee.type(r)&&t(r)})}(arguments),n&&!t&&u()),this},remove:function(){return Ee.each(arguments,function(e,t){for(var n;(n=Ee.inArray(t,a,n))>-1;)a.splice(n,1),n<=s&&s--}),this},has:function(e){return e?Ee.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=o=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=o=[],n||t||(a=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],o.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},Ee.extend({Deferred:function(e){var t=[["notify","progress",Ee.Callbacks("memory"),Ee.Callbacks("memory"),2],["resolve","done",Ee.Callbacks("once memory"),Ee.Callbacks("once memory"),0,"resolved"],["reject","fail",Ee.Callbacks("once memory"),Ee.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return a.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return Ee.Deferred(function(n){Ee.each(t,function(t,r){var i=Ee.isFunction(e[r[4]])&&e[r[4]];a[r[1]](function(){var e=i&&i.apply(this,arguments);e&&Ee.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(e,r,i){function a(e,t,r,i){return function(){var s=this,u=arguments,l=function(){var n,l;if(!(e<o)){if(n=r.apply(s,u),n===t.promise())throw new TypeError("Thenable self-resolution");l=n&&("object"==typeof n||"function"==typeof n)&&n.then,Ee.isFunction(l)?i?l.call(n,a(o,t,d,i),a(o,t,c,i)):(o++,l.call(n,a(o,t,d,i),a(o,t,c,i),a(o,t,d,t.notifyWith))):(r!==d&&(s=void 0,u=[n]),(i||t.resolveWith)(s,u))}},f=i?l:function(){try{l()}catch(n){Ee.Deferred.exceptionHook&&Ee.Deferred.exceptionHook(n,f.stackTrace),e+1>=o&&(r!==c&&(s=void 0,u=[n]),t.rejectWith(s,u))}};e?f():(Ee.Deferred.getStackHook&&(f.stackTrace=Ee.Deferred.getStackHook()),n.setTimeout(f))}}var o=0;return Ee.Deferred(function(n){t[0][3].add(a(0,n,Ee.isFunction(i)?i:d,n.notifyWith)),t[1][3].add(a(0,n,Ee.isFunction(e)?e:d)),t[2][3].add(a(0,n,Ee.isFunction(r)?r:c))}).promise()},promise:function(e){return null!=e?Ee.extend(e,i):i}},a={};return Ee.each(t,function(e,n){var o=n[2],s=n[5];i[n[1]]=o.add,s&&o.add(function(){r=s},t[3-e][2].disable,t[0][2].lock),o.add(n[3].fire),a[n[0]]=function(){return a[n[0]+"With"](this===a?void 0:this,arguments),this},a[n[0]+"With"]=o.fireWith}),i.promise(a),e&&e.call(a,a),a},when:function(e){var t=arguments.length,n=t,r=Array(n),i=ae.call(arguments),a=Ee.Deferred(),o=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?ae.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&(h(e,a.done(o(n)).resolve,a.reject),"pending"===a.state()||Ee.isFunction(i[n]&&i[n].then)))return a.then();for(;n--;)h(i[n],o(n),a.reject);return a.promise()}});var Ue=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;Ee.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&Ue.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},Ee.readyException=function(e){n.setTimeout(function(){throw e})};var Le=Ee.Deferred();Ee.fn.ready=function(e){return Le.then(e).catch(function(e){Ee.readyException(e)}),this},Ee.extend({isReady:!1,readyWait:1,holdReady:function(e){e?Ee.readyWait++:Ee.ready(!0)},ready:function(e){(e===!0?--Ee.readyWait:Ee.isReady)||(Ee.isReady=!0,e!==!0&&--Ee.readyWait>0||Le.resolveWith(re,[Ee]))}}),Ee.ready.then=Le.then,"complete"===re.readyState||"loading"!==re.readyState&&!re.documentElement.doScroll?n.setTimeout(Ee.ready):(re.addEventListener("DOMContentLoaded",p),n.addEventListener("load",p));var ke=function(e,t,n,r,i,a,o){var s=0,u=e.length,l=null==n;if("object"===Ee.type(n)){i=!0;for(s in n)ke(e,t,s,n[s],!0,a,o)}else if(void 0!==r&&(i=!0,Ee.isFunction(r)||(o=!0),l&&(o?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(Ee(e),n)})),t))for(;s<u;s++)t(e[s],n,o?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):a},Me=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};_.uid=1,_.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Me(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[Ee.camelCase(t)]=n;else for(r in t)i[Ee.camelCase(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][Ee.camelCase(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){Ee.isArray(t)?t=t.map(Ee.camelCase):(t=Ee.camelCase(t),t=t in r?[t]:t.match(Ne)||[]),n=t.length;for(;n--;)delete r[t[n]]}(void 0===t||Ee.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!Ee.isEmptyObject(t)}};var xe=new _,Be=new _,Fe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,He=/[A-Z]/g;Ee.extend({hasData:function(e){return Be.hasData(e)||xe.hasData(e)},data:function(e,t,n){return Be.access(e,t,n)},removeData:function(e,t){Be.remove(e,t)},_data:function(e,t,n){return xe.access(e,t,n)},_removeData:function(e,t){xe.remove(e,t)}}),Ee.fn.extend({data:function(e,t){var n,r,i,a=this[0],o=a&&a.attributes;if(void 0===e){if(this.length&&(i=Be.get(a),1===a.nodeType&&!xe.get(a,"hasDataAttrs"))){for(n=o.length;n--;)o[n]&&(r=o[n].name,0===r.indexOf("data-")&&(r=Ee.camelCase(r.slice(5)),E(a,r,i[r])));xe.set(a,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){Be.set(this,e)}):ke(this,function(t){var n;if(a&&void 0===t){if(n=Be.get(a,e),void 0!==n)return n;if(n=E(a,e),void 0!==n)return n}else this.each(function(){Be.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Be.remove(this,e)})}}),Ee.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=xe.get(e,t),n&&(!r||Ee.isArray(n)?r=xe.access(e,t,Ee.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=Ee.queue(e,t),r=n.length,i=n.shift(),a=Ee._queueHooks(e,t),o=function(){Ee.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete a.stop,i.call(e,o,a)),!r&&a&&a.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return xe.get(e,n)||xe.access(e,n,{empty:Ee.Callbacks("once memory").add(function(){xe.remove(e,[t+"queue",n])})})}}),Ee.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?Ee.queue(this[0],e):void 0===t?this:this.each(function(){var n=Ee.queue(this,e,t);Ee._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&Ee.dequeue(this,e)})},dequeue:function(e){return this.each(function(){Ee.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=Ee.Deferred(),a=this,o=this.length,s=function(){--r||i.resolveWith(a,[a]); +};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";o--;)n=xe.get(a[o],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var je=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Ge=new RegExp("^(?:([+-])=|)("+je+")([a-z%]*)$","i"),qe=["Top","Right","Bottom","Left"],Ve=function(e,t){return e=t||e,"none"===e.style.display||""===e.style.display&&Ee.contains(e.ownerDocument,e)&&"none"===Ee.css(e,"display")},Ye=function(e,t,n,r){var i,a,o={};for(a in t)o[a]=e.style[a],e.style[a]=t[a];i=n.apply(e,r||[]);for(a in t)e.style[a]=o[a];return i},Je={};Ee.fn.extend({show:function(){return R(this,!0)},hide:function(){return R(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Ve(this)?Ee(this).show():Ee(this).hide()})}});var We=/^(?:checkbox|radio)$/i,Qe=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,Ke=/^$|\/(?:java|ecma)script/i,ze={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ze.optgroup=ze.option,ze.tbody=ze.tfoot=ze.colgroup=ze.caption=ze.thead,ze.th=ze.td;var $e=/<|&#?\w+;/;!function(){var e=re.createDocumentFragment(),t=e.appendChild(re.createElement("div")),n=re.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),pe.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",pe.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Ze=re.documentElement,Xe=/^key/,et=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,tt=/^([^.]*)(?:\.(.+)|)/;Ee.event={global:{},add:function(e,t,n,r,i){var a,o,s,u,l,f,d,c,h,p,_,E=xe.get(e);if(E)for(n.handler&&(a=n,n=a.handler,i=a.selector),i&&Ee.find.matchesSelector(Ze,i),n.guid||(n.guid=Ee.guid++),(u=E.events)||(u=E.events={}),(o=E.handle)||(o=E.handle=function(t){return"undefined"!=typeof Ee&&Ee.event.triggered!==t.type?Ee.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(Ne)||[""],l=t.length;l--;)s=tt.exec(t[l])||[],h=_=s[1],p=(s[2]||"").split(".").sort(),h&&(d=Ee.event.special[h]||{},h=(i?d.delegateType:d.bindType)||h,d=Ee.event.special[h]||{},f=Ee.extend({type:h,origType:_,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&Ee.expr.match.needsContext.test(i),namespace:p.join(".")},a),(c=u[h])||(c=u[h]=[],c.delegateCount=0,d.setup&&d.setup.call(e,r,p,o)!==!1||e.addEventListener&&e.addEventListener(h,o)),d.add&&(d.add.call(e,f),f.handler.guid||(f.handler.guid=n.guid)),i?c.splice(c.delegateCount++,0,f):c.push(f),Ee.event.global[h]=!0)},remove:function(e,t,n,r,i){var a,o,s,u,l,f,d,c,h,p,_,E=xe.hasData(e)&&xe.get(e);if(E&&(u=E.events)){for(t=(t||"").match(Ne)||[""],l=t.length;l--;)if(s=tt.exec(t[l])||[],h=_=s[1],p=(s[2]||"").split(".").sort(),h){for(d=Ee.event.special[h]||{},h=(r?d.delegateType:d.bindType)||h,c=u[h]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=a=c.length;a--;)f=c[a],!i&&_!==f.origType||n&&n.guid!==f.guid||s&&!s.test(f.namespace)||r&&r!==f.selector&&("**"!==r||!f.selector)||(c.splice(a,1),f.selector&&c.delegateCount--,d.remove&&d.remove.call(e,f));o&&!c.length&&(d.teardown&&d.teardown.call(e,p,E.handle)!==!1||Ee.removeEvent(e,h,E.handle),delete u[h])}else for(h in u)Ee.event.remove(e,h+t[l],n,r,!0);Ee.isEmptyObject(u)&&xe.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,a,o,s=Ee.event.fix(e),u=new Array(arguments.length),l=(xe.get(this,"events")||{})[s.type]||[],f=Ee.event.special[s.type]||{};for(u[0]=s,t=1;t<arguments.length;t++)u[t]=arguments[t];if(s.delegateTarget=this,!f.preDispatch||f.preDispatch.call(this,s)!==!1){for(o=Ee.event.handlers.call(this,s,l),t=0;(i=o[t++])&&!s.isPropagationStopped();)for(s.currentTarget=i.elem,n=0;(a=i.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!s.rnamespace.test(a.namespace)||(s.handleObj=a,s.data=a.data,r=((Ee.event.special[a.origType]||{}).handle||a.handler).apply(i.elem,u),void 0!==r&&(s.result=r)===!1&&(s.preventDefault(),s.stopPropagation()));return f.postDispatch&&f.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,i,a,o=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(r=[],n=0;n<s;n++)a=t[n],i=a.selector+" ",void 0===r[i]&&(r[i]=a.needsContext?Ee(i,this).index(u)>-1:Ee.find(i,this,null,[u]).length),r[i]&&r.push(a);r.length&&o.push({elem:u,handlers:r})}return s<t.length&&o.push({elem:this,handlers:t.slice(s)}),o},addProp:function(e,t){Object.defineProperty(Ee.Event.prototype,e,{enumerable:!0,configurable:!0,get:Ee.isFunction(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[Ee.expando]?e:new Ee.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==I()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===I()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&Ee.nodeName(this,"input"))return this.click(),!1},_default:function(e){return Ee.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},Ee.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},Ee.Event=function(e,t){return this instanceof Ee.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?C:S,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&Ee.extend(this,t),this.timeStamp=e&&e.timeStamp||Ee.now(),void(this[Ee.expando]=!0)):new Ee.Event(e,t)},Ee.Event.prototype={constructor:Ee.Event,isDefaultPrevented:S,isPropagationStopped:S,isImmediatePropagationStopped:S,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=C,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=C,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=C,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},Ee.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&Xe.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&et.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},Ee.event.addProp),Ee.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){Ee.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,a=e.handleObj;return i&&(i===r||Ee.contains(r,i))||(e.type=a.origType,n=a.handler.apply(this,arguments),e.type=t),n}}}),Ee.fn.extend({on:function(e,t,n,r){return A(this,e,t,n,r)},one:function(e,t,n,r){return A(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,Ee(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return t!==!1&&"function"!=typeof t||(n=t,t=void 0),n===!1&&(n=S),this.each(function(){Ee.event.remove(this,e,n,t)})}});var nt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,rt=/<script|<style|<link/i,it=/checked\s*(?:[^=]|=\s*.checked.)/i,at=/^true\/(.*)/,ot=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;Ee.extend({htmlPrefilter:function(e){return e.replace(nt,"<$1></$2>")},clone:function(e,t,n){var r,i,a,o,s=e.cloneNode(!0),u=Ee.contains(e.ownerDocument,e);if(!(pe.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||Ee.isXMLDoc(e)))for(o=m(s),a=m(e),r=0,i=a.length;r<i;r++)O(a[r],o[r]);if(t)if(n)for(a=a||m(e),o=o||m(s),r=0,i=a.length;r<i;r++)P(a[r],o[r]);else P(e,s);return o=m(s,"script"),o.length>0&&v(o,!u&&m(e,"script")),s},cleanData:function(e){for(var t,n,r,i=Ee.event.special,a=0;void 0!==(n=e[a]);a++)if(Me(n)){if(t=n[xe.expando]){if(t.events)for(r in t.events)i[r]?Ee.event.remove(n,r):Ee.removeEvent(n,r,t.handle);n[xe.expando]=void 0}n[Be.expando]&&(n[Be.expando]=void 0)}}}),Ee.fn.extend({detach:function(e){return U(this,e,!0)},remove:function(e){return U(this,e)},text:function(e){return ke(this,function(e){return void 0===e?Ee.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return N(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=b(this,e);t.appendChild(e)}})},prepend:function(){return N(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=b(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return N(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return N(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(Ee.cleanData(m(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return Ee.clone(this,e,t)})},html:function(e){return ke(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!rt.test(e)&&!ze[(Qe.exec(e)||["",""])[1].toLowerCase()]){e=Ee.htmlPrefilter(e);try{for(;n<r;n++)t=this[n]||{},1===t.nodeType&&(Ee.cleanData(m(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return N(this,arguments,function(t){var n=this.parentNode;Ee.inArray(this,e)<0&&(Ee.cleanData(m(this)),n&&n.replaceChild(t,this))},e)}}),Ee.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){Ee.fn[e]=function(e){for(var n,r=[],i=Ee(e),a=i.length-1,o=0;o<=a;o++)n=o===a?this:this.clone(!0),Ee(i[o])[t](n),se.apply(r,n.get());return this.pushStack(r)}});var st=/^margin/,ut=new RegExp("^("+je+")(?!px)[a-z%]+$","i"),lt=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=n),t.getComputedStyle(e)};!function(){function e(){if(s){s.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",s.innerHTML="",Ze.appendChild(o);var e=n.getComputedStyle(s);t="1%"!==e.top,a="2px"===e.marginLeft,r="4px"===e.width,s.style.marginRight="50%",i="4px"===e.marginRight,Ze.removeChild(o),s=null}}var t,r,i,a,o=re.createElement("div"),s=re.createElement("div");s.style&&(s.style.backgroundClip="content-box",s.cloneNode(!0).style.backgroundClip="",pe.clearCloneStyle="content-box"===s.style.backgroundClip,o.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",o.appendChild(s),Ee.extend(pe,{pixelPosition:function(){return e(),t},boxSizingReliable:function(){return e(),r},pixelMarginRight:function(){return e(),i},reliableMarginLeft:function(){return e(),a}}))}();var ft=/^(none|table(?!-c[ea]).+)/,dt={position:"absolute",visibility:"hidden",display:"block"},ct={letterSpacing:"0",fontWeight:"400"},ht=["Webkit","Moz","ms"],pt=re.createElement("div").style;Ee.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=L(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,a,o,s=Ee.camelCase(t),u=e.style;return t=Ee.cssProps[s]||(Ee.cssProps[s]=M(s)||s),o=Ee.cssHooks[t]||Ee.cssHooks[s],void 0===n?o&&"get"in o&&void 0!==(i=o.get(e,!1,r))?i:u[t]:(a=typeof n,"string"===a&&(i=Ge.exec(n))&&i[1]&&(n=g(e,t,i),a="number"),null!=n&&n===n&&("number"===a&&(n+=i&&i[3]||(Ee.cssNumber[s]?"":"px")),pe.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),o&&"set"in o&&void 0===(n=o.set(e,n,r))||(u[t]=n)),void 0)}},css:function(e,t,n,r){var i,a,o,s=Ee.camelCase(t);return t=Ee.cssProps[s]||(Ee.cssProps[s]=M(s)||s),o=Ee.cssHooks[t]||Ee.cssHooks[s],o&&"get"in o&&(i=o.get(e,!0,n)),void 0===i&&(i=L(e,t,r)),"normal"===i&&t in ct&&(i=ct[t]),""===n||n?(a=parseFloat(i),n===!0||isFinite(a)?a||0:i):i}}),Ee.each(["height","width"],function(e,t){Ee.cssHooks[t]={get:function(e,n,r){if(n)return!ft.test(Ee.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?F(e,t,r):Ye(e,dt,function(){return F(e,t,r)})},set:function(e,n,r){var i,a=r&<(e),o=r&&B(e,t,r,"border-box"===Ee.css(e,"boxSizing",!1,a),a);return o&&(i=Ge.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=Ee.css(e,t)),x(e,n,o)}}}),Ee.cssHooks.marginLeft=k(pe.reliableMarginLeft,function(e,t){if(t)return(parseFloat(L(e,"marginLeft"))||e.getBoundingClientRect().left-Ye(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),Ee.each({margin:"",padding:"",border:"Width"},function(e,t){Ee.cssHooks[e+t]={expand:function(n){for(var r=0,i={},a="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+qe[r]+t]=a[r]||a[r-2]||a[0];return i}},st.test(e)||(Ee.cssHooks[e+t].set=x)}),Ee.fn.extend({css:function(e,t){return ke(this,function(e,t,n){var r,i,a={},o=0;if(Ee.isArray(t)){for(r=lt(e),i=t.length;o<i;o++)a[t[o]]=Ee.css(e,t[o],!1,r);return a}return void 0!==n?Ee.style(e,t,n):Ee.css(e,t)},e,t,arguments.length>1)}}),Ee.Tween=H,H.prototype={constructor:H,init:function(e,t,n,r,i,a){this.elem=e,this.prop=n,this.easing=i||Ee.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=a||(Ee.cssNumber[n]?"":"px")},cur:function(){var e=H.propHooks[this.prop];return e&&e.get?e.get(this):H.propHooks._default.get(this)},run:function(e){var t,n=H.propHooks[this.prop];return this.options.duration?this.pos=t=Ee.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):H.propHooks._default.set(this),this}},H.prototype.init.prototype=H.prototype,H.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=Ee.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){Ee.fx.step[e.prop]?Ee.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[Ee.cssProps[e.prop]]&&!Ee.cssHooks[e.prop]?e.elem[e.prop]=e.now:Ee.style(e.elem,e.prop,e.now+e.unit)}}},H.propHooks.scrollTop=H.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},Ee.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},Ee.fx=H.prototype.init,Ee.fx.step={};var _t,Et,gt=/^(?:toggle|show|hide)$/,yt=/queueHooks$/;Ee.Animation=Ee.extend(W,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return g(n.elem,e,Ge.exec(t),n),n}]},tweener:function(e,t){Ee.isFunction(e)?(t=e,e=["*"]):e=e.match(Ne);for(var n,r=0,i=e.length;r<i;r++)n=e[r],W.tweeners[n]=W.tweeners[n]||[],W.tweeners[n].unshift(t)},prefilters:[Y],prefilter:function(e,t){t?W.prefilters.unshift(e):W.prefilters.push(e)}}),Ee.speed=function(e,t,n){var r=e&&"object"==typeof e?Ee.extend({},e):{complete:n||!n&&t||Ee.isFunction(e)&&e,duration:e,easing:n&&t||t&&!Ee.isFunction(t)&&t};return Ee.fx.off||re.hidden?r.duration=0:r.duration="number"==typeof r.duration?r.duration:r.duration in Ee.fx.speeds?Ee.fx.speeds[r.duration]:Ee.fx.speeds._default,null!=r.queue&&r.queue!==!0||(r.queue="fx"),r.old=r.complete,r.complete=function(){Ee.isFunction(r.old)&&r.old.call(this),r.queue&&Ee.dequeue(this,r.queue)},r},Ee.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Ve).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=Ee.isEmptyObject(e),a=Ee.speed(t,n,r),o=function(){var t=W(this,Ee.extend({},e),a);(i||xe.get(this,"finish"))&&t.stop(!0)};return o.finish=o,i||a.queue===!1?this.each(o):this.queue(a.queue,o)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",a=Ee.timers,o=xe.get(this);if(i)o[i]&&o[i].stop&&r(o[i]);else for(i in o)o[i]&&o[i].stop&&yt.test(i)&&r(o[i]);for(i=a.length;i--;)a[i].elem!==this||null!=e&&a[i].queue!==e||(a[i].anim.stop(n),t=!1,a.splice(i,1));!t&&n||Ee.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=xe.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],a=Ee.timers,o=r?r.length:0;for(n.finish=!0,Ee.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=a.length;t--;)a[t].elem===this&&a[t].queue===e&&(a[t].anim.stop(!0),a.splice(t,1));for(t=0;t<o;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),Ee.each(["toggle","show","hide"],function(e,t){var n=Ee.fn[t];Ee.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(q(t,!0),e,r,i)}}),Ee.each({slideDown:q("show"),slideUp:q("hide"),slideToggle:q("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){Ee.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),Ee.timers=[],Ee.fx.tick=function(){var e,t=0,n=Ee.timers;for(_t=Ee.now();t<n.length;t++)e=n[t],e()||n[t]!==e||n.splice(t--,1);n.length||Ee.fx.stop(),_t=void 0},Ee.fx.timer=function(e){Ee.timers.push(e),e()?Ee.fx.start():Ee.timers.pop()},Ee.fx.interval=13,Ee.fx.start=function(){Et||(Et=n.requestAnimationFrame?n.requestAnimationFrame(j):n.setInterval(Ee.fx.tick,Ee.fx.interval))},Ee.fx.stop=function(){n.cancelAnimationFrame?n.cancelAnimationFrame(Et):n.clearInterval(Et),Et=null},Ee.fx.speeds={slow:600,fast:200,_default:400},Ee.fn.delay=function(e,t){return e=Ee.fx?Ee.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,r){var i=n.setTimeout(t,e);r.stop=function(){n.clearTimeout(i)}})},function(){var e=re.createElement("input"),t=re.createElement("select"),n=t.appendChild(re.createElement("option"));e.type="checkbox",pe.checkOn=""!==e.value,pe.optSelected=n.selected,e=re.createElement("input"),e.value="t",e.type="radio",pe.radioValue="t"===e.value}();var Rt,mt=Ee.expr.attrHandle;Ee.fn.extend({attr:function(e,t){return ke(this,Ee.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){Ee.removeAttr(this,e)})}}),Ee.extend({attr:function(e,t,n){var r,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return"undefined"==typeof e.getAttribute?Ee.prop(e,t,n):(1===a&&Ee.isXMLDoc(e)||(i=Ee.attrHooks[t.toLowerCase()]||(Ee.expr.match.bool.test(t)?Rt:void 0)),void 0!==n?null===n?void Ee.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=Ee.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!pe.radioValue&&"radio"===t&&Ee.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(Ne);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),Rt={set:function(e,t,n){return t===!1?Ee.removeAttr(e,n):e.setAttribute(n,n),n}},Ee.each(Ee.expr.match.bool.source.match(/\w+/g),function(e,t){var n=mt[t]||Ee.find.attr;mt[t]=function(e,t,r){var i,a,o=t.toLowerCase();return r||(a=mt[o],mt[o]=i,i=null!=n(e,t,r)?o:null,mt[o]=a),i}});var vt=/^(?:input|select|textarea|button)$/i,Tt=/^(?:a|area)$/i;Ee.fn.extend({prop:function(e,t){return ke(this,Ee.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[Ee.propFix[e]||e]})}}),Ee.extend({prop:function(e,t,n){var r,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&Ee.isXMLDoc(e)||(t=Ee.propFix[t]||t,i=Ee.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=Ee.find.attr(e,"tabindex");return t?parseInt(t,10):vt.test(e.nodeName)||Tt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),pe.optSelected||(Ee.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),Ee.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){Ee.propFix[this.toLowerCase()]=this});var Ct=/[\t\r\n\f]/g;Ee.fn.extend({addClass:function(e){var t,n,r,i,a,o,s,u=0;if(Ee.isFunction(e))return this.each(function(t){Ee(this).addClass(e.call(this,t,Q(this)))});if("string"==typeof e&&e)for(t=e.match(Ne)||[];n=this[u++];)if(i=Q(n),r=1===n.nodeType&&(" "+i+" ").replace(Ct," ")){for(o=0;a=t[o++];)r.indexOf(" "+a+" ")<0&&(r+=a+" ");s=Ee.trim(r),i!==s&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,a,o,s,u=0;if(Ee.isFunction(e))return this.each(function(t){Ee(this).removeClass(e.call(this,t,Q(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(Ne)||[];n=this[u++];)if(i=Q(n),r=1===n.nodeType&&(" "+i+" ").replace(Ct," ")){for(o=0;a=t[o++];)for(;r.indexOf(" "+a+" ")>-1;)r=r.replace(" "+a+" "," ");s=Ee.trim(r),i!==s&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):Ee.isFunction(e)?this.each(function(n){Ee(this).toggleClass(e.call(this,n,Q(this),t),t)}):this.each(function(){var t,r,i,a;if("string"===n)for(r=0,i=Ee(this),a=e.match(Ne)||[];t=a[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=Q(this),t&&xe.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||e===!1?"":xe.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+Q(n)+" ").replace(Ct," ").indexOf(t)>-1)return!0;return!1}});var St=/\r/g,It=/[\x20\t\r\n\f]+/g;Ee.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=Ee.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,Ee(this).val()):e,null==i?i="":"number"==typeof i?i+="":Ee.isArray(i)&&(i=Ee.map(i,function(e){return null==e?"":e+""})),t=Ee.valHooks[this.type]||Ee.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=Ee.valHooks[i.type]||Ee.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(St,""):null==n?"":n)}}}),Ee.extend({valHooks:{option:{get:function(e){var t=Ee.find.attr(e,"value");return null!=t?t:Ee.trim(Ee.text(e)).replace(It," ")}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,a="select-one"===e.type,o=a?null:[],s=a?i+1:r.length,u=i<0?s:a?i:0;u<s;u++)if(n=r[u],(n.selected||u===i)&&!n.disabled&&(!n.parentNode.disabled||!Ee.nodeName(n.parentNode,"optgroup"))){if(t=Ee(n).val(),a)return t;o.push(t)}return o},set:function(e,t){for(var n,r,i=e.options,a=Ee.makeArray(t),o=i.length;o--;)r=i[o],(r.selected=Ee.inArray(Ee.valHooks.option.get(r),a)>-1)&&(n=!0);return n||(e.selectedIndex=-1),a}}}}),Ee.each(["radio","checkbox"],function(){Ee.valHooks[this]={set:function(e,t){if(Ee.isArray(t))return e.checked=Ee.inArray(Ee(e).val(),t)>-1}},pe.checkOn||(Ee.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var At=/^(?:focusinfocus|focusoutblur)$/;Ee.extend(Ee.event,{trigger:function(e,t,r,i){var a,o,s,u,l,f,d,c=[r||re],h=de.call(e,"type")?e.type:e,p=de.call(e,"namespace")?e.namespace.split("."):[];if(o=s=r=r||re,3!==r.nodeType&&8!==r.nodeType&&!At.test(h+Ee.event.triggered)&&(h.indexOf(".")>-1&&(p=h.split("."),h=p.shift(),p.sort()),l=h.indexOf(":")<0&&"on"+h,e=e[Ee.expando]?e:new Ee.Event(h,"object"==typeof e&&e),e.isTrigger=i?2:3,e.namespace=p.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:Ee.makeArray(t,[e]),d=Ee.event.special[h]||{},i||!d.trigger||d.trigger.apply(r,t)!==!1)){if(!i&&!d.noBubble&&!Ee.isWindow(r)){for(u=d.delegateType||h,At.test(u+h)||(o=o.parentNode);o;o=o.parentNode)c.push(o),s=o;s===(r.ownerDocument||re)&&c.push(s.defaultView||s.parentWindow||n)}for(a=0;(o=c[a++])&&!e.isPropagationStopped();)e.type=a>1?u:d.bindType||h,f=(xe.get(o,"events")||{})[e.type]&&xe.get(o,"handle"),f&&f.apply(o,t),f=l&&o[l],f&&f.apply&&Me(o)&&(e.result=f.apply(o,t),e.result===!1&&e.preventDefault());return e.type=h,i||e.isDefaultPrevented()||d._default&&d._default.apply(c.pop(),t)!==!1||!Me(r)||l&&Ee.isFunction(r[h])&&!Ee.isWindow(r)&&(s=r[l],s&&(r[l]=null),Ee.event.triggered=h,r[h](),Ee.event.triggered=void 0,s&&(r[l]=s)),e.result}},simulate:function(e,t,n){var r=Ee.extend(new Ee.Event,n,{type:e,isSimulated:!0});Ee.event.trigger(r,null,t)}}),Ee.fn.extend({trigger:function(e,t){return this.each(function(){Ee.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return Ee.event.trigger(e,t,n,!0)}}),Ee.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){Ee.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),Ee.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),pe.focusin="onfocusin"in n,pe.focusin||Ee.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){Ee.event.simulate(t,e.target,Ee.event.fix(e))};Ee.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=xe.access(r,t);i||r.addEventListener(e,n,!0),xe.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=xe.access(r,t)-1;i?xe.access(r,t,i):(r.removeEventListener(e,n,!0),xe.remove(r,t))}}});var bt=n.location,wt=Ee.now(),Dt=/\?/;Ee.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||Ee.error("Invalid XML: "+e),t};var Pt=/\[\]$/,Ot=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,Ut=/^(?:input|select|textarea|keygen)/i;Ee.param=function(e,t){var n,r=[],i=function(e,t){var n=Ee.isFunction(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Ee.isArray(e)||e.jquery&&!Ee.isPlainObject(e))Ee.each(e,function(){i(this.name,this.value)});else for(n in e)K(n,e[n],t,i);return r.join("&")},Ee.fn.extend({serialize:function(){return Ee.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=Ee.prop(this,"elements");return e?Ee.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!Ee(this).is(":disabled")&&Ut.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!We.test(e))}).map(function(e,t){var n=Ee(this).val();return null==n?null:Ee.isArray(n)?Ee.map(n,function(e){return{name:t.name,value:e.replace(Ot,"\r\n")}}):{name:t.name,value:n.replace(Ot,"\r\n")}}).get()}});var Lt=/%20/g,kt=/#.*$/,Mt=/([?&])_=[^&]*/,xt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Bt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ft=/^(?:GET|HEAD)$/,Ht=/^\/\//,jt={},Gt={},qt="*/".concat("*"),Vt=re.createElement("a");Vt.href=bt.href,Ee.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:bt.href,type:"GET",isLocal:Bt.test(bt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":qt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":Ee.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Z(Z(e,Ee.ajaxSettings),t):Z(Ee.ajaxSettings,e)},ajaxPrefilter:z(jt),ajaxTransport:z(Gt),ajax:function(e,t){function r(e,t,r,s){var l,c,h,m,v,T=t;f||(f=!0,u&&n.clearTimeout(u),i=void 0,o=s||"",C.readyState=e>0?4:0,l=e>=200&&e<300||304===e,r&&(m=X(p,C,r)),m=ee(p,m,C,l),l?(p.ifModified&&(v=C.getResponseHeader("Last-Modified"),v&&(Ee.lastModified[a]=v),v=C.getResponseHeader("etag"),v&&(Ee.etag[a]=v)),204===e||"HEAD"===p.type?T="nocontent":304===e?T="notmodified":(T=m.state,c=m.data,h=m.error,l=!h)):(h=T,!e&&T||(T="error",e<0&&(e=0))),C.status=e,C.statusText=(t||T)+"",l?g.resolveWith(_,[c,T,C]):g.rejectWith(_,[C,T,h]),C.statusCode(R),R=void 0,d&&E.trigger(l?"ajaxSuccess":"ajaxError",[C,p,l?c:h]),y.fireWith(_,[C,T]),d&&(E.trigger("ajaxComplete",[C,p]),--Ee.active||Ee.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,a,o,s,u,l,f,d,c,h,p=Ee.ajaxSetup({},t),_=p.context||p,E=p.context&&(_.nodeType||_.jquery)?Ee(_):Ee.event,g=Ee.Deferred(),y=Ee.Callbacks("once memory"),R=p.statusCode||{},m={},v={},T="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(f){if(!s)for(s={};t=xt.exec(o);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return f?o:null},setRequestHeader:function(e,t){return null==f&&(e=v[e.toLowerCase()]=v[e.toLowerCase()]||e,m[e]=t),this},overrideMimeType:function(e){return null==f&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(f)C.always(e[C.status]);else for(t in e)R[t]=[R[t],e[t]];return this},abort:function(e){var t=e||T;return i&&i.abort(t),r(0,t),this}};if(g.promise(C),p.url=((e||p.url||bt.href)+"").replace(Ht,bt.protocol+"//"),p.type=t.method||t.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(Ne)||[""],null==p.crossDomain){l=re.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Vt.protocol+"//"+Vt.host!=l.protocol+"//"+l.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=Ee.param(p.data,p.traditional)),$(jt,p,t,C),f)return C;d=Ee.event&&p.global,d&&0===Ee.active++&&Ee.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ft.test(p.type),a=p.url.replace(kt,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Lt,"+")):(h=p.url.slice(a.length),p.data&&(a+=(Dt.test(a)?"&":"?")+p.data,delete p.data),p.cache===!1&&(a=a.replace(Mt,""),h=(Dt.test(a)?"&":"?")+"_="+wt++ +h),p.url=a+h),p.ifModified&&(Ee.lastModified[a]&&C.setRequestHeader("If-Modified-Since",Ee.lastModified[a]),Ee.etag[a]&&C.setRequestHeader("If-None-Match",Ee.etag[a])),(p.data&&p.hasContent&&p.contentType!==!1||t.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+qt+"; q=0.01":""):p.accepts["*"]);for(c in p.headers)C.setRequestHeader(c,p.headers[c]);if(p.beforeSend&&(p.beforeSend.call(_,C,p)===!1||f))return C.abort();if(T="abort",y.add(p.complete), +C.done(p.success),C.fail(p.error),i=$(Gt,p,t,C)){if(C.readyState=1,d&&E.trigger("ajaxSend",[C,p]),f)return C;p.async&&p.timeout>0&&(u=n.setTimeout(function(){C.abort("timeout")},p.timeout));try{f=!1,i.send(m,r)}catch(e){if(f)throw e;r(-1,e)}}else r(-1,"No Transport");return C},getJSON:function(e,t,n){return Ee.get(e,t,n,"json")},getScript:function(e,t){return Ee.get(e,void 0,t,"script")}}),Ee.each(["get","post"],function(e,t){Ee[t]=function(e,n,r,i){return Ee.isFunction(n)&&(i=i||r,r=n,n=void 0),Ee.ajax(Ee.extend({url:e,type:t,dataType:i,data:n,success:r},Ee.isPlainObject(e)&&e))}}),Ee._evalUrl=function(e){return Ee.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},Ee.fn.extend({wrapAll:function(e){var t;return this[0]&&(Ee.isFunction(e)&&(e=e.call(this[0])),t=Ee(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return Ee.isFunction(e)?this.each(function(t){Ee(this).wrapInner(e.call(this,t))}):this.each(function(){var t=Ee(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=Ee.isFunction(e);return this.each(function(n){Ee(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){Ee(this).replaceWith(this.childNodes)}),this}}),Ee.expr.pseudos.hidden=function(e){return!Ee.expr.pseudos.visible(e)},Ee.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},Ee.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var Yt={0:200,1223:204},Jt=Ee.ajaxSettings.xhr();pe.cors=!!Jt&&"withCredentials"in Jt,pe.ajax=Jt=!!Jt,Ee.ajaxTransport(function(e){var t,r;if(pe.cors||Jt&&!e.crossDomain)return{send:function(i,a){var o,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)s[o]=e.xhrFields[o];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(o in i)s.setRequestHeader(o,i[o]);t=function(e){return function(){t&&(t=r=s.onload=s.onerror=s.onabort=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?a(0,"error"):a(s.status,s.statusText):a(Yt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),r=s.onerror=t("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout(function(){t&&r()})},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),Ee.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),Ee.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return Ee.globalEval(e),e}}}),Ee.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),Ee.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=Ee("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),re.head.appendChild(t[0])},abort:function(){n&&n()}}}});var Wt=[],Qt=/(=)\?(?=&|$)|\?\?/;Ee.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Wt.pop()||Ee.expando+"_"+wt++;return this[e]=!0,e}}),Ee.ajaxPrefilter("json jsonp",function(e,t,r){var i,a,o,s=e.jsonp!==!1&&(Qt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Qt.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=Ee.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Qt,"$1"+i):e.jsonp!==!1&&(e.url+=(Dt.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return o||Ee.error(i+" was not called"),o[0]},e.dataTypes[0]="json",a=n[i],n[i]=function(){o=arguments},r.always(function(){void 0===a?Ee(n).removeProp(i):n[i]=a,e[i]&&(e.jsonpCallback=t.jsonpCallback,Wt.push(i)),o&&Ee.isFunction(a)&&a(o[0]),o=a=void 0}),"script"}),pe.createHTMLDocument=function(){var e=re.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),Ee.parseHTML=function(e,t,n){if("string"!=typeof e)return[];"boolean"==typeof t&&(n=t,t=!1);var r,i,a;return t||(pe.createHTMLDocument?(t=re.implementation.createHTMLDocument(""),r=t.createElement("base"),r.href=re.location.href,t.head.appendChild(r)):t=re),i=Ie.exec(e),a=!n&&[],i?[t.createElement(i[1])]:(i=T([e],t,a),a&&a.length&&Ee(a).remove(),Ee.merge([],i.childNodes))},Ee.fn.load=function(e,t,n){var r,i,a,o=this,s=e.indexOf(" ");return s>-1&&(r=Ee.trim(e.slice(s)),e=e.slice(0,s)),Ee.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),o.length>0&&Ee.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){a=arguments,o.html(r?Ee("<div>").append(Ee.parseHTML(e)).find(r):e)}).always(n&&function(e,t){o.each(function(){n.apply(this,a||[e.responseText,t,e])})}),this},Ee.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){Ee.fn[t]=function(e){return this.on(t,e)}}),Ee.expr.pseudos.animated=function(e){return Ee.grep(Ee.timers,function(t){return e===t.elem}).length},Ee.offset={setOffset:function(e,t,n){var r,i,a,o,s,u,l,f=Ee.css(e,"position"),d=Ee(e),c={};"static"===f&&(e.style.position="relative"),s=d.offset(),a=Ee.css(e,"top"),u=Ee.css(e,"left"),l=("absolute"===f||"fixed"===f)&&(a+u).indexOf("auto")>-1,l?(r=d.position(),o=r.top,i=r.left):(o=parseFloat(a)||0,i=parseFloat(u)||0),Ee.isFunction(t)&&(t=t.call(e,n,Ee.extend({},s))),null!=t.top&&(c.top=t.top-s.top+o),null!=t.left&&(c.left=t.left-s.left+i),"using"in t?t.using.call(e,c):d.css(c)}},Ee.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){Ee.offset.setOffset(this,e,t)});var t,n,r,i,a=this[0];if(a)return a.getClientRects().length?(r=a.getBoundingClientRect(),r.width||r.height?(i=a.ownerDocument,n=te(i),t=i.documentElement,{top:r.top+n.pageYOffset-t.clientTop,left:r.left+n.pageXOffset-t.clientLeft}):r):{top:0,left:0}},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===Ee.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),Ee.nodeName(e[0],"html")||(r=e.offset()),r={top:r.top+Ee.css(e[0],"borderTopWidth",!0),left:r.left+Ee.css(e[0],"borderLeftWidth",!0)}),{top:t.top-r.top-Ee.css(n,"marginTop",!0),left:t.left-r.left-Ee.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===Ee.css(e,"position");)e=e.offsetParent;return e||Ze})}}),Ee.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;Ee.fn[e]=function(r){return ke(this,function(e,r,i){var a=te(e);return void 0===i?a?a[t]:e[r]:void(a?a.scrollTo(n?a.pageXOffset:i,n?i:a.pageYOffset):e[r]=i)},e,r,arguments.length)}}),Ee.each(["top","left"],function(e,t){Ee.cssHooks[t]=k(pe.pixelPosition,function(e,n){if(n)return n=L(e,t),ut.test(n)?Ee(e).position()[t]+"px":n})}),Ee.each({Height:"height",Width:"width"},function(e,t){Ee.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){Ee.fn[r]=function(i,a){var o=arguments.length&&(n||"boolean"!=typeof i),s=n||(i===!0||a===!0?"margin":"border");return ke(this,function(t,n,i){var a;return Ee.isWindow(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(a=t.documentElement,Math.max(t.body["scroll"+e],a["scroll"+e],t.body["offset"+e],a["offset"+e],a["client"+e])):void 0===i?Ee.css(t,n,s):Ee.style(t,n,i,s)},t,o?i:void 0,o)}})}),Ee.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),Ee.parseJSON=JSON.parse,r=[],i=function(){return Ee}.apply(t,r),!(void 0!==i&&(e.exports=i));var Kt=n.jQuery,zt=n.$;return Ee.noConflict=function(e){return n.$===Ee&&(n.$=zt),e&&n.jQuery===Ee&&(n.jQuery=Kt),Ee},a||(n.jQuery=n.$=Ee),Ee})},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,a=16384,o=[],s=-1,u=arguments.length;if(!u)return"";for(var l="";++s<u;){var f=Number(arguments[s]);if(!isFinite(f)||f<0||f>1114111||n(f)!=f)throw RangeError("Invalid code point: "+f);f<=65535?o.push(f):(f-=65536,r=(f>>10)+55296,i=f%1024+56320,o.push(r,i)),(s+1==u||o.length>a)&&(l+=t.apply(null,o),o.length=0)}return l};e?e(String,"fromCodePoint",{value:r,configurable:!0,writable:!0}):String.fromCodePoint=r}()},function(e,t){(function(){"use strict";function e(e){throw e}function t(e,t){var n=e.split("."),r=T;!(n[0]in r)&&r.execScript&&r.execScript("var "+n[0]);for(var i;n.length&&(i=n.shift());)n.length||t===m?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(C?Uint8Array:Array)?t:new(C?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(C?Uint16Array:Array)(2*e),this.length=0}function i(e){var t,n,r,i,a,o,s,u,l,f,d=e.length,c=0,h=Number.POSITIVE_INFINITY;for(u=0;u<d;++u)e[u]>c&&(c=e[u]),e[u]<h&&(h=e[u]);for(t=1<<c,n=new(C?Uint32Array:Array)(t),r=1,i=0,a=2;r<=c;){for(u=0;u<d;++u)if(e[u]===r){for(o=0,s=i,l=0;l<r;++l)o=o<<1|1&s,s>>=1;for(f=r<<16|u,l=o;l<t;l+=a)n[l]=f;++i}++r,i<<=1,a<<=1}return[n,c,h]}function a(e,t){this.h=O,this.w=0,this.input=C&&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=C&&t.outputBuffer instanceof Array?new Uint8Array(t.outputBuffer):t.outputBuffer),"number"==typeof t.outputIndex&&(this.b=t.outputIndex)),this.a||(this.a=new(C?Uint8Array:Array)(32768))}function o(e,t){this.length=e,this.H=t}function s(t,n){function r(t,n){var r,i=t.H,a=[],o=0;r=k[t.length],a[o++]=65535&r,a[o++]=r>>16&255,a[o++]=r>>24;var s;switch(v){case 1===i:s=[0,i-1,0];break;case 2===i:s=[1,i-2,0];break;case 3===i:s=[2,i-3,0];break;case 4===i:s=[3,i-4,0];break;case 6>=i:s=[4,i-5,1];break;case 8>=i:s=[5,i-7,1];break;case 12>=i:s=[6,i-9,2];break;case 16>=i:s=[7,i-13,2];break;case 24>=i:s=[8,i-17,3];break;case 32>=i:s=[9,i-25,3];break;case 48>=i:s=[10,i-33,4];break;case 64>=i:s=[11,i-49,4];break;case 96>=i:s=[12,i-65,5];break;case 128>=i:s=[13,i-97,5];break;case 192>=i:s=[14,i-129,6];break;case 256>=i:s=[15,i-193,6];break;case 384>=i:s=[16,i-257,7];break;case 512>=i:s=[17,i-385,7];break;case 768>=i:s=[18,i-513,8];break;case 1024>=i:s=[19,i-769,8];break;case 1536>=i:s=[20,i-1025,9];break;case 2048>=i:s=[21,i-1537,9];break;case 3072>=i:s=[22,i-2049,10];break;case 4096>=i:s=[23,i-3073,10];break;case 6144>=i:s=[24,i-4097,11];break;case 8192>=i:s=[25,i-6145,11];break;case 12288>=i:s=[26,i-8193,12];break;case 16384>=i:s=[27,i-12289,12];break;case 24576>=i:s=[28,i-16385,13];break;case 32768>=i:s=[29,i-24577,13];break;default:e("invalid distance")}r=s,a[o++]=r[0],a[o++]=r[1],a[o++]=r[2];var u,l;for(u=0,l=a.length;u<l;++u)_[E++]=a[u];y[a[0]]++,R[a[3]]++,g=t.length+n-1,c=null}var i,a,o,s,l,f,d,c,h,p={},_=C?new Uint16Array(2*n.length):[],E=0,g=0,y=new(C?Uint32Array:Array)(286),R=new(C?Uint32Array:Array)(30),T=t.w;if(!C){for(o=0;285>=o;)y[o++]=0;for(o=0;29>=o;)R[o++]=0}for(y[256]=1,i=0,a=n.length;i<a;++i){for(o=l=0,s=3;o<s&&i+o!==a;++o)l=l<<8|n[i+o];if(p[l]===m&&(p[l]=[]),f=p[l],!(0<g--)){for(;0<f.length&&32768<i-f[0];)f.shift();if(i+3>=a){for(c&&r(c,-1),o=0,s=a-i;o<s;++o)h=n[i+o],_[E++]=h,++y[h];break}0<f.length?(d=u(n,i,f),c?c.length<d.length?(h=n[i-1],_[E++]=h,++y[h],r(d,0)):r(c,-1):d.length<T?c=d:r(d,0)):c?r(c,-1):(h=n[i],_[E++]=h,++y[h])}f.push(i)}return _[E++]=256,y[256]++,t.M=y,t.L=R,C?_.subarray(0,E):_}function u(e,t,n){var r,i,a,s,u,l,f=0,d=e.length;s=0,l=n.length;e:for(;s<l;s++){if(r=n[l-s-1],a=3,3<f){for(u=f;3<u;u--)if(e[r+u-1]!==e[t+u-1])continue e;a=f}for(;258>a&&t+a<d&&e[r+a]===e[t+a];)++a;if(a>f&&(i=r,f=a),258===a)break}return new o(f,t-i)}function l(e,t){var n,i,a,o,s,u=e.length,l=new r(572),d=new(C?Uint8Array:Array)(u);if(!C)for(o=0;o<u;o++)d[o]=0;for(o=0;o<u;++o)0<e[o]&&l.push(o,e[o]);if(n=Array(l.length/2),i=new(C?Uint32Array:Array)(l.length/2),1===n.length)return d[l.pop().index]=1,d;for(o=0,s=l.length/2;o<s;++o)n[o]=l.pop(),i[o]=n[o].value;for(a=f(i,i.length,t),o=0,s=n.length;o<s;++o)d[n[o].index]=a[o];return d}function f(e,t,n){function r(e){var n=h[e][p[e]];n===t?(r(e+1),r(e+1)):--d[n],++p[e]}var i,a,o,s,u,l=new(C?Uint16Array:Array)(n),f=new(C?Uint8Array:Array)(n),d=new(C?Uint8Array:Array)(t),c=Array(n),h=Array(n),p=Array(n),_=(1<<n)-t,E=1<<n-1;for(l[n-1]=t,a=0;a<n;++a)_<E?f[a]=0:(f[a]=1,_-=E),_<<=1,l[n-2-a]=(l[n-1-a]/2|0)+t;for(l[0]=f[0],c[0]=Array(l[0]),h[0]=Array(l[0]),a=1;a<n;++a)l[a]>2*l[a-1]+f[a]&&(l[a]=2*l[a-1]+f[a]),c[a]=Array(l[a]),h[a]=Array(l[a]);for(i=0;i<t;++i)d[i]=n;for(o=0;o<l[n-1];++o)c[n-1][o]=e[o],h[n-1][o]=o;for(i=0;i<n;++i)p[i]=0;for(1===f[n-1]&&(--d[0],++p[n-1]),a=n-2;0<=a;--a){for(s=i=0,u=p[a+1],o=0;o<l[a];o++)s=c[a+1][u]+c[a+1][u+1],s>e[i]?(c[a][o]=s,h[a][o]=t,u+=2):(c[a][o]=e[i],h[a][o]=i,++i);p[a]=0,1===f[a]&&r(a)}return d}function d(e){var t,n,r,i,a=new(C?Uint16Array:Array)(e.length),o=[],s=[],u=0;for(t=0,n=e.length;t<n;t++)o[e[t]]=(0|o[e[t]])+1;for(t=1,n=16;t<=n;t++)s[t]=u,u+=0|o[t],u<<=1;for(t=0,n=e.length;t<n;t++)for(u=s[e[t]],s[e[t]]+=1,r=a[t]=0,i=e[t];r<i;r++)a[t]=a[t]<<1|1&u,u>>>=1;return a}function c(t,n){switch(this.l=[],this.m=32768,this.e=this.g=this.c=this.q=0,this.input=C?new Uint8Array(t):t,this.s=!1,this.n=x,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 M:this.b=32768,this.a=new(C?Uint8Array:Array)(32768+this.m+258);break;case x:this.b=0,this.a=new(C?Uint8Array:Array)(this.m),this.f=this.K,this.t=this.I,this.o=this.J;break;default:e(Error("invalid inflate mode"))}}function h(t,n){for(var r,i=t.g,a=t.e,o=t.input,s=t.c,u=o.length;a<n;)s>=u&&e(Error("input buffer is broken")),i|=o[s++]<<a,a+=8;return r=i&(1<<n)-1,t.g=i>>>n,t.e=a-n,t.c=s,r}function p(e,t){for(var n,r,i=e.g,a=e.e,o=e.input,s=e.c,u=o.length,l=t[0],f=t[1];a<f&&!(s>=u);)i|=o[s++]<<a,a+=8;return n=l[i&(1<<f)-1],r=n>>>16,e.g=i>>r,e.e=a-r,e.c=s,65535&n}function _(e){function t(e,t,n){var r,i,a,o=this.z;for(a=0;a<e;)switch(r=p(this,t)){case 16:for(i=3+h(this,2);i--;)n[a++]=o;break;case 17:for(i=3+h(this,3);i--;)n[a++]=0;o=0;break;case 18:for(i=11+h(this,7);i--;)n[a++]=0;o=0;break;default:o=n[a++]=r}return this.z=o,n}var n,r,a,o,s=h(e,5)+257,u=h(e,5)+1,l=h(e,4)+4,f=new(C?Uint8Array:Array)(G.length);for(o=0;o<l;++o)f[G[o]]=h(e,3);if(!C)for(o=l,l=f.length;o<l;++o)f[G[o]]=0;n=i(f),r=new(C?Uint8Array:Array)(s),a=new(C?Uint8Array:Array)(u),e.z=0,e.o(i(t.call(e,s,n,r)),i(t.call(e,u,n,a)))}function E(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,a=1,o=0,s=e.length,u=0;0<s;){i=1024<s?1024:s,s-=i;do a+=e[u++],o+=a;while(--i);a%=65521,o%=65521}return(o<<16|a)>>>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 c(t,{index:this.c,bufferSize:n.bufferSize,bufferType:n.bufferType,resize:n.resize})}function y(e,t){this.input=e,this.a=new(C?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 a(this.input,r)}function R(e,n){var r,i,a,o;if(Object.keys)r=Object.keys(n);else for(i in r=[],a=0,n)r[a++]=i;for(a=0,o=r.length;a<o;++a)i=r[a],t(e+"."+i,n[i])}var m=void 0,v=!0,T=this,C="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(C?Uint8Array:Array)(n<<1);if(C)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,a=this.index,o=this.i,s=i[a];if(n&&1<t&&(e=8<t?(D[255&e]<<24|D[e>>>8&255]<<16|D[e>>>16&255]<<8|D[e>>>24&255])>>32-t:D[e]>>8-t),8>t+o)s=s<<t|e,o+=t;else for(r=0;r<t;++r)s=s<<1|e>>t-r-1&1,8===++o&&(o=0,i[a++]=D[s],s=0,a===i.length&&(i=this.f()));i[a]=s,this.buffer=i,this.i=o,this.index=a},n.prototype.finish=function(){var e,t=this.buffer,n=this.index;return 0<this.i&&(t[n]<<=8-this.i,t[n]=D[t[n]],n++),C?e=t.subarray(0,n):(t.length=n,e=t),e};var S,I=new(C?Uint8Array:Array)(256);for(S=0;256>S;++S){for(var A=S,b=A,w=7,A=A>>>1;A;A>>>=1)b<<=1,b|=1&A,--w;I[S]=(b<<w&255)>>>0}var D=I;r.prototype.getParent=function(e){return 2*((e-2)/4|0)},r.prototype.push=function(e,t){var n,r,i,a=this.buffer;for(n=this.length,a[this.length++]=t,a[this.length++]=e;0<n&&(r=this.getParent(n),a[n]>a[r]);)i=a[n],a[n]=a[r],a[r]=i,i=a[n+1],a[n+1]=a[r+1],a[r+1]=i,n=r;return this.length},r.prototype.pop=function(){var e,t,n,r,i,a=this.buffer;for(t=a[0],e=a[1],this.length-=2,a[0]=a[this.length],a[1]=a[this.length+1],i=0;(r=2*i+2,!(r>=this.length))&&(r+2<this.length&&a[r+2]>a[r]&&(r+=2),a[r]>a[i]);)n=a[i],a[i]=a[r],a[r]=n,n=a[i+1],a[i+1]=a[r+1],a[r+1]=n,i=r;return{index:e,value:t,length:this.length}};var P,O=2,N={NONE:0,r:1,k:O,O:3},U=[];for(P=0;288>P;P++)switch(v){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)}a.prototype.j=function(){var t,r,i,a,o=this.input;switch(this.h){case 0:for(i=0,a=o.length;i<a;){r=C?o.subarray(i,i+65535):o.slice(i,i+65535),i+=r.length;var u=r,f=i===a,c=m,h=m,p=m,_=m,E=m,g=this.a,y=this.b;if(C){for(g=new Uint8Array(this.a.buffer);g.length<=y+u.length+5;)g=new Uint8Array(g.length<<1);g.set(this.a)}if(c=f?1:0,g[y++]=0|c,h=u.length,p=~h+65536&65535,g[y++]=255&h,g[y++]=h>>>8&255,g[y++]=255&p,g[y++]=p>>>8&255,C)g.set(u,y),y+=u.length,g=g.subarray(0,y);else{for(_=0,E=u.length;_<E;++_)g[y++]=u[_];g.length=y}this.b=y,this.a=g}break;case 1:var R=new n(C?new Uint8Array(this.a.buffer):this.a,this.b);R.d(1,1,v),R.d(1,2,v);var T,S,I,A=s(this,o);for(T=0,S=A.length;T<S;T++)if(I=A[T],n.prototype.d.apply(R,U[I]),256<I)R.d(A[++T],A[++T],v),R.d(A[++T],5),R.d(A[++T],A[++T],v);else if(256===I)break;this.a=R.finish(),this.b=this.a.length;break;case O:var b,w,D,P,N,L,k,M,x,B,F,H,j,G,q,V=new n(C?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(b=O,V.d(1,1,v),V.d(b,2,v),w=s(this,o),L=l(this.M,15),k=d(L),M=l(this.L,7),x=d(M),D=286;257<D&&0===L[D-1];D--);for(P=30;1<P&&0===M[P-1];P--);var W,Q,K,z,$,Z,X=D,ee=P,te=new(C?Uint32Array:Array)(X+ee),ne=new(C?Uint32Array:Array)(316),re=new(C?Uint8Array:Array)(19);for(W=Q=0;W<X;W++)te[Q++]=L[W];for(W=0;W<ee;W++)te[Q++]=M[W];if(!C)for(W=0,z=re.length;W<z;++W)re[W]=0;for(W=$=0,z=te.length;W<z;W+=Q){for(Q=1;W+Q<z&&te[W+Q]===te[W];++Q);if(K=Q,0===te[W])if(3>K)for(;0<K--;)ne[$++]=0,re[0]++;else for(;0<K;)Z=138>K?K:138,Z>K-3&&Z<K&&(Z=K-3),10>=Z?(ne[$++]=17,ne[$++]=Z-3,re[17]++):(ne[$++]=18,ne[$++]=Z-11,re[18]++),K-=Z;else if(ne[$++]=te[W],re[te[W]]++,K--,3>K)for(;0<K--;)ne[$++]=te[W],re[te[W]]++;else for(;0<K;)Z=6>K?K:6,Z>K-3&&Z<K&&(Z=K-3),ne[$++]=16,ne[$++]=Z-3,re[16]++,K-=Z}for(t=C?ne.subarray(0,$):ne.slice(0,$),B=l(re,7),G=0;19>G;G++)J[G]=B[Y[G]];for(N=19;4<N&&0===J[N-1];N--);for(F=d(B),V.d(D-257,5,v),V.d(P-1,5,v),V.d(N-4,4,v),G=0;G<N;G++)V.d(J[G],3,v);for(G=0,q=t.length;G<q;G++)if(H=t[G],V.d(F[H],B[H],v),16<=H){switch(G++,H){case 16:j=2;break;case 17:j=3;break;case 18:j=7;break;default:e("invalid code: "+H)}V.d(t[G],j,v)}var ie,ae,oe,se,ue,le,fe,de,ce=[k,L],he=[x,M];for(ue=ce[0],le=ce[1],fe=he[0],de=he[1],ie=0,ae=w.length;ie<ae;++ie)if(oe=w[ie],V.d(ue[oe],le[oe],v),256<oe)V.d(w[++ie],w[++ie],v),se=w[++ie],V.d(fe[se],de[se],v),V.d(w[++ie],w[++ie],v);else if(256===oe)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(v){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=C?new Uint32Array(L):L,M=0,x=1,B={F:M,D:x};c.prototype.p=function(){for(;!this.s;){var t=h(this,3);switch(1&t&&(this.s=v),t>>>=1){case 0:var n=this.input,r=this.c,i=this.a,a=this.b,o=n.length,s=m,u=m,l=i.length,f=m;switch(this.e=this.g=0,r+1>=o&&e(Error("invalid uncompressed block header: LEN")),s=n[r++]|n[r++]<<8,r+1>=o&&e(Error("invalid uncompressed block header: NLEN")),u=n[r++]|n[r++]<<8,s===~u&&e(Error("invalid uncompressed block header: length verify")),r+s>n.length&&e(Error("input buffer is broken")),this.n){case M:for(;a+s>i.length;){if(f=l-a,s-=f,C)i.set(n.subarray(r,r+f),a),a+=f,r+=f;else for(;f--;)i[a++]=n[r++];this.b=a,i=this.f(),a=this.b}break;case x:for(;a+s>i.length;)i=this.f({v:2});break;default:e(Error("invalid inflate mode"))}if(C)i.set(n.subarray(r,r+s),a),a+=s,r+=s;else for(;s--;)i[a++]=n[r++];this.c=r,this.b=a,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,j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],G=C?new Uint16Array(j):j,q=[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=C?new Uint16Array(q):q,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=C?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=C?new Uint16Array(W):W,K=[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],z=C?new Uint8Array(K):K,$=new(C?Uint8Array:Array)(288);for(F=0,H=$.length;F<H;++F)$[F]=143>=F?8:255>=F?9:279>=F?7:8;var Z,X,ee=i($),te=new(C?Uint8Array:Array)(30);for(Z=0,X=te.length;Z<X;++Z)te[Z]=5;var ne=i(te);c.prototype.o=function(e,t){var n=this.a,r=this.b;this.u=e;for(var i,a,o,s,u=n.length-258;256!==(i=p(this,e));)if(256>i)r>=u&&(this.b=r,n=this.f(),r=this.b),n[r++]=i;else for(a=i-257,s=V[a],0<J[a]&&(s+=h(this,J[a])),i=p(this,t),o=Q[i],0<z[i]&&(o+=h(this,z[i])),r>=u&&(this.b=r,n=this.f(),r=this.b);s--;)n[r]=n[r++-o];for(;8<=this.e;)this.e-=8,this.c--;this.b=r},c.prototype.J=function(e,t){var n=this.a,r=this.b;this.u=e;for(var i,a,o,s,u=n.length;256!==(i=p(this,e));)if(256>i)r>=u&&(n=this.f(),u=n.length),n[r++]=i;else for(a=i-257,s=V[a],0<J[a]&&(s+=h(this,J[a])),i=p(this,t),o=Q[i],0<z[i]&&(o+=h(this,z[i])),r+s>u&&(n=this.f(),u=n.length);s--;)n[r]=n[r++-o];for(;8<=this.e;)this.e-=8,this.c--;this.b=r},c.prototype.f=function(){var e,t,n=new(C?Uint8Array:Array)(this.b-32768),r=this.b-32768,i=this.a;if(C)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,C)i.set(i.subarray(r,r+32768));else for(e=0;32768>e;++e)i[e]=i[r+e];return this.b=32768,i},c.prototype.K=function(e){var t,n,r,i,a=this.input.length/this.c+1|0,o=this.input,s=this.a;return e&&("number"==typeof e.v&&(a=e.v),"number"==typeof e.G&&(a+=e.G)),2>a?(n=(o.length-this.c)/this.u[2],i=258*(n/2)|0,r=i<s.length?s.length+i:s.length<<1):r=s.length*a,C?(t=new Uint8Array(r),t.set(s)):t=s,this.a=t},c.prototype.t=function(){var e,t,n,r,i,a=0,o=this.a,s=this.l,u=new(C?Uint8Array:Array)(this.q+(this.b-32768));if(0===s.length)return C?this.a.subarray(32768,this.b):this.a.slice(32768,this.b);for(t=0,n=s.length;t<n;++t)for(e=s[t],r=0,i=e.length;r<i;++r)u[a++]=e[r];for(t=32768,n=this.b;t<n;++t)u[a++]=o[t];return this.l=[],this.buffer=u},c.prototype.I=function(){var e,t=this.b;return C?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!==E(t)&&e(Error("invalid adler-32 checksum"))),t};var re=8,ie=N;y.prototype.j=function(){var t,n,r,i,a,o,s,u=0;switch(s=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,s[u++]=r,t){case re:switch(this.h){case ie.NONE:a=0;break;case ie.r:a=1;break;case ie.k:a=2;break;default:e(Error("unsupported compression type"))}break;default:e(Error("invalid compression method"))}return i=a<<6|0,s[u++]=i|31-(256*r+i)%31,o=E(this.input),this.A.b=u,s=this.A.j(),u=s.length,C&&(s=new Uint8Array(s.buffer),s.length<=u+4&&(this.a=new Uint8Array(s.length+4),this.a.set(s),s=this.a),s=s.subarray(0,u+4)),s[u++]=o>>24&255,s[u++]=o>>16&255,s[u++]=o>>8&255,s[u++]=255&o,s},t("Zlib.Inflate",g),t("Zlib.Inflate.prototype.decompress",g.prototype.p),R("Zlib.Inflate.BufferType",{ADAPTIVE:B.D,BLOCK:B.F}),t("Zlib.Deflate",y),t("Zlib.Deflate.compress",function(e,t){return new y(e,t).j()}),t("Zlib.Deflate.prototype.compress",y.prototype.j),R("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 a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=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(7),l=r(u),f=n(36),d=r(f),c=n(34),h=r(c),p=n(18),_=r(p),E=n(17),g=r(E),y=n(22),R=r(y),m=n(3),v=r(m),T=n(1),C=r(T),S=n(20),I=r(S),A=n(38),b=r(A),w=n(40),D=r(w),P=n(37),O=r(P),N=n(39),U=r(N),L=n(41),k=r(L),M=n(4),x=r(M),B=n(5),F=r(B),H=n(2),j=r(H),G=n(13),q=(r(G),n(10)),V=(r(q),n(42)),Y=r(V),J=n(14);r(J);n(47).polyfill(),n(52),n(49),n(30);var W=C.default.getLoger("McuClient"),Q={version:"v1.17.0.201705010",author:"www.3mang.com"},K=void 0,z=void 0,$=void 0,Z=void 0,X=void 0,ee=void 0,te=void 0,ne=void 0,re=void 0,ie=void 0,ae=function(e){function t(){i(this,t);var e=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.sdkInfo=Q,W.log(e.sdkInfo),e.isGetUserIpCallback=!1,e.isGetFastestMcuCallback=!1,e.isGetFastestMsCallback=!1,F.default.setCurrentStatus(F.default.statusCode_0),e.on(v.default.MCU_ERROR,e._mcuErrorHandler.bind(e)),K=d.default,K.on("*",function(t,n){return e._emit(t,n)}),K.on(K.SUCCESS,e._sassJoinSuccessHandler.bind(e)),K.on(K.CLASS_INIT_SUCCESS,e._sassInitSuccessHandler.bind(e)),K.on(K.CLASS_GET_CLASS_PARAM,e._sassGetClassParamSuccessHandler.bind(e)),K.on(K.CLASS_SAVE_STATUS_INFO_SUCCESS,e._sassSaveClassStatusInfoSuccessHandler.bind(e)),K.on(K.CLASS_SAVE_RECORD_INFO_SUCCESS,e._sassSaveClassRecordInfoSuccessHandler.bind(e)),K.on(K.DELETE_DOCUMENT_SUCCESS,e._sassDeleteDocumentSuccess.bind(e)),z=new h.default,$=R.default,$.on("*",function(t,n){return e._emit(t,n)}),$.on(v.default.CLASS_JOIN_MCU_SUCCESS,e._mcuJoinMCUClassSuccessHandler.bind(e)),$.on(v.default.SWITCH_MCU_IP,e._switchMcuIpHandler.bind(e)),ie=_.default,ie.on("*",function(t,n){return e._emit(t,n)}),ie.on(_.default.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS,e._joinRecordPlaybackSuccessHandler.bind(e)),ie.on(_.default.RECORD_PLAYBACK_CLEAR_DATA,e._recordPlaybackClearDataHandler.bind(e)),Z=new I.default,Z.on("*",function(t,n){return e._emit(t,n)}),Z.on(v.default.CLASS_RUN_EXIT,e._runClassExit.bind(e)),Z.on(v.default.CLASS_STATUS_INFO_CHANGE,e._onClassStatusInfoChange.bind(e)),Z.on(v.default.CLASS_DELETE_ROSTER,e._onClassDeleteRoster.bind(e)),Z.on(v.default.CLASS_NONENTITY_ROSTER,e._onClassNonentityRoster.bind(e)),Z.on(v.default.CLASS_RECORD_START,e._onClassRecordStart.bind(e)),Z.on(v.default.CLASS_RECORD_SUCCESS,e._onClassRecordSuccess.bind(e)),Z.on(v.default.SWITCH_MS_IP,e._switchMsIpHandler.bind(e)),X=new b.default,X.on("*",function(t,n){return e._emit(t,n)}),ee=new D.default,ee.on("*",function(t,n){return e._emit(t,n)}),ee.on(v.default.VIDEO_UPDATE,e.videoUpdate.bind(e)),ee.on(v.default.USER_DEVICE_STATUS_CHAANGE,e.userDeviecStatusChange.bind(e)),te=new O.default,te.on("*",function(t,n){return e._emit(t,n)}),te.on(v.default.AUDIO_UPDATE,e.audioUpdate.bind(e)),te.on(v.default.USER_DEVICE_STATUS_CHAANGE,e.userDeviecStatusChange.bind(e)),re=new k.default,re.on("*",function(t,n){return e._emit(t,n)}),ne=new U.default,ne.on("*",function(t,n){return e._emit(t,n)}),ne.on(v.default.DOC_UPDATE,e.docUpdateHandler.bind(e)),ne.on(v.default.DOC_DELETE,e.docDeleteHandler.bind(e)),ne.on(U.default.DOC_JOIN_CHANNEL_SUCCESS,e.docJoinChannelSuccess.bind(e)),e.init=e._init.bind(e),e.joinClass=e._joinClass.bind(e),e.leaveClass=e._leaveClass.bind(e),e.getMcuClientStatus=e._getMcuClientStatus.bind(e),e.getClassStatusInfo=e._getClassStatusInfo.bind(e),e.sendStartClass=e._sendStartClass.bind(e),e.sendPauseClass=e._sendPauseClass.bind(e),e.sendCloseClass=e._sendCloseClass.bind(e),e.changeHandUpStatus=e._changeHandUpStatus.bind(e),e.initRecordPlayback=e._initRecordPlayback.bind(e),e.startRecordPlayback=e._startRecordPlayback.bind(e),e.stopRecordPlayback=e._stopRecordPlayback.bind(e),e.pauseRecordPlayback=e._pauseRecordPlayback.bind(e),e.seekRecordPlayback=e._seekRecordPlayback.bind(e),e.sendChatMsg=e._sendChatMsg.bind(e),e.getVideoPublishPath=e._getVideoPublishPath.bind(e),e.getVideoAllChannelInfo=e._getVideoAllChannelInfo.bind(e),e.publishVideo=e._publishVideo.bind(e),e.stopPublishVideo=e.unPublishVideo=e._stopPublishVideo.bind(e),e.sendVideoBroadcastMsg=e._sendVideoBroadcastMsg.bind(e),e.getAudioPublishPath=e._getPublishAudioPath.bind(e),e.getAudioAllChannelInfo=e._getAudioAllChannelInfo.bind(e),e.publishAudio=e._publishAudio.bind(e),e.stopPublishAudio=e.unPublishAudio=e._stopPublishAudio.bind(e),e.sendAudioBroadcastMsg=e.sendAudioCommandMsg.bind(e),e.sendInsertAnnotaion=e._sendInsertAnnotaion.bind(e),e.sendDeleteAllAnnotation=e._sendDeleteAllAnnotation.bind(e),e.sendDeleteCurPageAnnotation=e._sendDeleteCurPageAnnotation.bind(e),e.sendGotoPrev=e._sendGotoPrev.bind(e), +e.sendDocumentUpload=e._sendDocumentUpload.bind(e),e.sendDocumentSwitchDoc=e._sendDocumentSwitchDoc.bind(e),e.sendDocumentSwitchPage=e._sendDocumentSwitchPage.bind(e),e.sendDocumentSwitchAnimation=e._sendDocumentSwitchAnimation.bind(e),e.sendDocumentDelete=e._sassDeleteDocument.bind(e),e.sendDocBroadcastMsg=e._sendDocBroadcastMsg.bind(e),e.sendDocumentCommand=e._sendDocumentCommand.bind(e),e.getDocImageFullPath=e._getDocImageFullPath.bind(e),e.getDocPDFFullPath=e._getDocPDFFullPath.bind(e),e.getDocFullAddress=e._getDocFullAddress.bind(e),e.setDeviceInfo=e._setDeviceInfo.bind(e),e.setMessageDelay=e._setMessageDelay.bind(e),e.switchServer=e._switchMcuIpHandler.bind(e),e.switchMediaServer=e._switchMsIpHandler.bind(e),e.setDebugInfo=e._setDebugInfo.bind(e),e}return o(t,e),s(t,[{key:"_setDebugInfo",value:function(e){W.log("设置debug信息-->",e),e&&(C.default.IS_DEBUG=e.isDebug)}},{key:"_setDeviceInfo",value:function(e){W.log("设置设备信息-->",e),e&&(F.default.cameras=e.cameras||[],F.default.microphones=e.microphones||[],F.default.videoQuality=e.videoQuality||0,F.default.curVideoQuality=e.curVideoQuality||0,F.default.micGain=e.micGain||50,F.default.speakerVolume=e.speakerVolume||50,F.default.micCode=e.micCode||0,F.default.curCamera=e.curCamera||"",F.default.curMicrophone=e.curMicrophone||"",!F.default.curCamera&&F.default.cameras.length>0&&(F.default.curCamera=F.default.cameras[0]),!F.default.curMicrophone&&F.default.microphones.length>0&&(F.default.curMicrophone=F.default.microphones[0]))}},{key:"_setMessageDelay",value:function(e){W.warn("延迟消息-->",e),e&&(F.default.messageDelay=Boolean(e.messageDelay))}},{key:"_mcuErrorHandler",value:function(e,t){var n=t||"",r={code:e,reson:v.default.ErrorReson[e]+" "+n};this._emit(v.default.ERROR_EVENT,r),W.error("MCU_ERROR",r)}},{key:"_getMcuClientStatus",value:function(){return F.default.getCurrentStatus()}},{key:"_getClassDetail",value:function(){return F.default.getClassDetail()}},{key:"_getClassStatusInfo",value:function(){return F.default.classStatusInfo}},{key:"_runClassExit",value:function(e){this._leaveClass(e)}},{key:"_onClassStatusInfoChange",value:function(e){return F.default.getCurrentStatus().code!=F.default.statusCode_2.code?void W.warn("不能保存课堂状态",F.default.getCurrentStatus()):void this._sassSaveClassStatusInfo(e)}},{key:"_onClassRecordStart",value:function(e){return F.default.getCurrentStatus().code!=F.default.statusCode_2.code?void W.warn("不能保存课堂状态",F.default.getCurrentStatus()):void(K&&K.saveClassRecordContrlInfo(e))}},{key:"_onClassRecordSuccess",value:function(e){ne&&ne.updaterRecordStatus(),re&&re.updaterRecordStatus()}},{key:"_onClassDeleteRoster",value:function(e){}},{key:"_onClassNonentityRoster",value:function(e){if(F.default.isRecordPlayBack)return void W.warn("录制回放中,不处理");if(null==e||null==e.nodeId)return void W.warn("onClassNonentityRoster.参数错误");var t={nodeId:e.nodeId};ee&&ee.stopPublishVideo(t),te&&te.stopPublishAudio(t)}},{key:"_init",value:function(e){return null==e||x.default.isEmptyObject(e)?(W.error("初始化课堂失败->参数错误",e),void this._emit(v.default.MCU_ERROR,v.default.ERR_CLASS_INIT_PARAM)):null==e.classId||isNaN(e.classId)||null==e.portal||""==e.portal?(W.error("初始化课堂失败->参数错误",e),void this._emit(v.default.MCU_ERROR,v.default.ERR_CLASS_INIT_PARAM)):(W.log("初始化课堂->",e),F.default.isRecordPlayBack=!1,F.default.classId=parseInt(e.classId),F.default.portal=e.portal,F.default.userId=e.userId||"0",F.default.userName=e.userName||"",F.default.userRole=e.userRole||j.default.normal,F.default.userRole!=j.default.host&&F.default.userRole!=j.default.presenter&&F.default.userRole!=j.default.assistant&&F.default.userRole!=j.default.record&&F.default.userRole!=j.default.invisible&&(F.default.userRole=j.default.normal),F.default.messageDelay=e.messageDelay||!1,e.allowRecordMaxTime&&(F.default.allowRecordMaxTime=parseInt(e.allowRecordMaxTime)),void(K&&K.getJoinParams(F.default.getClassInfo())))}},{key:"_joinClass",value:function(e){if(null==e||x.default.isEmptyObject(e))return this._emit(v.default.MCU_ERROR,v.default.ERR_CLASS_JOIN_PARAM),void W.log("加入课堂失败->参数错误.",e);if(null==e.userName||""==e.userName)return W.log("加入课堂失败->参数错误->名字不能为空"),void this._emit(v.default.MCU_ERROR,v.default.ERR_CLASS_JOIN_PARAM);F.default.userName=e.userName||F.default.userName,F.default.autoLogin=e.autoLogin||"",F.default.password=e.password||"",F.default.hasCamera="boolean"==typeof e.hasCamera&&e.hasCamera,F.default.hasMicrophone="boolean"==typeof e.hasMicrophone&&e.hasMicrophone;var t=(0,g.default)(""+F.default.classId+F.default.userId+F.default.userRole);F.default.autoLogin&&t==F.default.autoLogin?(W.log("自动登录"),this._sassJoinSuccessHandler()):K&&K.passwordAndMd5Checking(F.default.getClassInfo())}},{key:"_sassInitSuccessHandler",value:function(e){F.default.md5=e.md5||"",F.default.msType=e.msType||1,F.default.siteId=e.siteId||"",F.default.classType=e.meetingType||0,F.default.passwordRequired=e.passwordRequired||!1,W.log("初始化课堂验证完成."),F.default.setCurrentStatus(F.default.statusCode_1);var t={};t.siteId=F.default.siteId,t.classId=F.default.classId,t.userRole=F.default.userRole,t.userId=F.default.userId,t.userName=F.default.userName,t.classType=F.default.classType,F.default.userRole==j.default.host?t.passwordRequired=!0:t.passwordRequired=F.default.passwordRequired,this._emit(v.default.CLASS_INIT_SUCCESS,t)}},{key:"_sassJoinSuccessHandler",value:function(e){K&&K.getClassParam()}},{key:"_sassGetClassParamSuccessHandler",value:function(e){if(W.log("获取课堂课堂信息完成."),e){if(F.default.mcuDelay=e.h5Delay||0,F.default.className=e.meetingName||"",F.default.classBeginTime=e.beginTime||"",F.default.classEndTime=e.endTime||"",F.default.userIp=e.userIp||"",F.default.maxVideoChannels=e.maxVideoChannels,F.default.maxAudioChannels=e.maxAudioChannels,F.default.maxMediaChannels=Math.max(F.default.maxVideoChannels,F.default.maxAudioChannels),F.default.fps=e.fps||15,F.default.gop=e.gop||3,F.default.videoQuality=e.videoQuality||2,F.default.isAutoStartClass=e.autoRecord||0,F.default.setDocListPrepare(e.docListPrepare),F.default.setRecordList(e.recordList),F.default.setDocList(e.docList),F.default.setMsList(e.msList),F.default.setRsList(e.rsList),F.default.setMcuList(e.mcuList),F.default.setMusicList(e.musicList),F.default.setMusicListPrepare(e.musicListPrepare),e.mcuList&&e.mcuList.length>0){var t=parseInt(Math.random()*e.mcuList.length);F.default.MCUServerIP=e.mcuList[t].ip||"",F.default.MCUServerPort=e.mcuList[t].port||"",W.log("初始->MCU->.",F.default.MCUServerIP,F.default.MCUServerPort)}if(e.rsList&&e.rsList.length>0){var n=parseInt(Math.random()*e.rsList.length);F.default.RS_RECORD_PLAY_IP=e.rsList[n].ip||"",F.default.RS_RECORD_PLAY_PORT=e.rsList[n].port||"",W.log("初始->RS->.",F.default.RS_RECORD_PLAY_IP,F.default.RS_RECORD_PLAY_PORT)}if(F.default.msList&&F.default.msList.length>0){var r=parseInt(Math.random()*F.default.msList.length);F.default.MS_PUBLISH_IP=F.default.msList[r].ip||"",F.default.MS_PUBLISH_PORT=F.default.msList[r].port||""}if(W.log("初始->MS->.",F.default.MS_PUBLISH_IP,F.default.MS_PUBLISH_PORT),F.default.pullRtmpList&&F.default.pullRtmpList.length>0){var i=parseInt(Math.random()*F.default.pullRtmpList.length);F.default.MS_PLAY_RTMP_IP=F.default.pullRtmpList[i].ip||"",F.default.MS_PLAY_RTMP_PORT=F.default.pullRtmpList[i].port||""}else F.default.MS_PLAY_RTMP_IP=F.default.MS_PUBLISH_IP,F.default.MS_PLAY_RTMP_PORT=F.default.MS_PUBLISH_PORT;if(W.log("初始->MSPull->.",F.default.MS_PLAY_RTMP_IP,F.default.MS_PLAY_RTMP_PORT),F.default.hlsList&&F.default.hlsList.length>0){var a=parseInt(Math.random()*F.default.hlsList.length);F.default.MS_PLAY_HLS_IP=F.default.hlsList[a].ip||"",F.default.MS_PLAY_HLS_PORT=F.default.hlsList[a].port||""}else F.default.MS_PLAY_HLS_IP=F.default.RS_RECORD_PLAY_IP,F.default.MS_PLAY_HLS_PORT=F.default.RS_RECORD_PLAY_PORT;if(W.log("初始->MSHls->.",F.default.MS_PLAY_HLS_IP,F.default.MS_PLAY_HLS_PORT),e.docList&&e.docList.length>0){var o=parseInt(Math.random()*e.docList.length);W.log("docServer->",e.docList[o]),F.default.DOCServerIP=e.docList[o].ip||"",F.default.DOCServerPort=e.docList[o].port||"",W.log("初始->DOC->.",F.default.DOCServerIP,F.default.DOCServerPort)}if(e.recordList&&e.recordList.length>0){var s=parseInt(Math.random()*e.recordList.length);F.default.RecordServerIP=e.recordList[s].ip||"",F.default.RecordServerPort=e.recordList[s].port||"",W.log("初始->RECORD->.",F.default.RecordServerIP,F.default.RecordServerPort)}}if(this._emit(v.default.CLASS_GET_INFO_SUCCESS,F.default.getClassInfo()),e.currentInfo){W.log("本地同步最后一次保存过的课堂状态信息");try{F.default.setClassStatusInfo(JSON.parse(e.currentInfo))}catch(t){F.default.setClassStatusInfo(e.currentInfo)}W.log(F.default.classStatusInfo)}else W.log("还没有保存过课堂状信息");F.default.isRecordPlayBack?ie?(W.log("开启录制回放流程"),ie.readyRecordPlay()):W.warn("开启录制回放流程失败->还未创建模块"):this.getUserIpInfo()}},{key:"getUserIpInfo",value:function(){z&&z.getUserIpInfo("",F.default.userIp,this._getUserIpCallbackHandler.bind(this),1e3)}},{key:"_getUserIpCallbackHandler",value:function(e){if(!this.isGetUserIpCallback){this.isGetUserIpCallback=!0,e&&"ok"==e.ret&&(F.default.country=e.country,F.default.city=e.city,F.default.province=e.province,F.default.isp=e.isp),this._mergeMcuAndMsList();var t=this;F.default.siteId_letv==F.default.siteId?(W.log("MS不需要选点->siteId->",F.default.siteId),t.isGetFastestMcuCallback=!0,t._startConnectMCU()):this._getFastestMsServer(function(e){W.log("MS选点结束->",e),e&&e.ip&&(F.default.MS_PUBLISH_IP=e.ip||"",F.default.MS_PUBLISH_PORT=e.port||""),W.log("当前使用的MS->",F.default.MS_PUBLISH_IP,F.default.MS_PUBLISH_PORT),t.isGetFastestMcuCallback=!0,t._startConnectMCU()}),this._getFastestMcuServer(function(e){W.log("MCU选点结束->",e),e&&e.ip&&(F.default.MCUServerIP=e.ip||"",F.default.MCUServerPort=e.port||""),W.log("当前使用的MCU->",F.default.MCUServerIP,F.default.MCUServerPort),t.isGetFastestMsCallback=!0,t._startConnectMCU()})}}},{key:"_startConnectMCU",value:function(){this.isGetFastestMcuCallback&&this.isGetFastestMsCallback&&this._joinMCU()}},{key:"_mergeMcuAndMsList",value:function(){z&&(F.default.mcuListFromServer=z.getServerMcuList(F.default.country,F.default.province,F.default.city,F.default.isp,Y.default.serverList),F.default.msListFromServer=z.getServerMsList(F.default.country,F.default.province,F.default.city,F.default.isp,Y.default.serverList)),F.default.mcuListAll.length=0,F.default.mcuListAll=F.default.mcuListAll.concat(F.default.mcuList,F.default.mcuListFromServer),F.default.msListAll.length=0,F.default.msListAll=F.default.msListAll.concat(F.default.msList,F.default.msListFromServer)}},{key:"_getFastestMcuServer",value:function(e){z?z.getFastestMcuServer(F.default.mcuListAll,e):e&&e({ip:""})}},{key:"_getFastestMsServer",value:function(e){z?z.getFastestMsServer(F.default.msListAll,e):e&&e({ip:""})}},{key:"_sassSaveClassStatusInfo",value:function(e){var t=!1;e&&1==e.isForce&&(t=!0),F.default.isHost||t?F.default.getCurrentStatus().code==F.default.statusCode_2.code?K.saveClassStatusInfo({classStatusInfo:F.default.classStatusInfo}):W.error("不能保存课堂数据",F.default.getCurrentStatus()):W.log("没有保存课堂状态信息的权限->身份",F.default.userRole)}},{key:"_sassSaveClassStatusInfoSuccessHandler",value:function(e){W.log("保存课堂状态信息成功."),W.log(e)}},{key:"_sassSaveClassRecordInfoSuccessHandler",value:function(e){W.log("保存课堂录制信息成功."),W.log(e)}},{key:"_joinMCU",value:function(){W.log("加入课堂->."),$&&$.joinMCU(F.default.getClassInfo())}},{key:"_switchMcuIp",value:function(){W.log("切换MCU IP->."),$&&$.switchMCUIp(F.default.getClassInfo())}},{key:"_mcuJoinMCUClassSuccessHandler",value:function(e){F.default.setCurrentStatus(F.default.statusCode_2);var t={};t.isRecordPlayBack=F.default.isRecordPlayBack,t.DOCServerIP=F.default.DOCServerIP,t.DOCServerPort=F.default.DOCServerPort,t.classStatus=F.default.classStatus,t.classId=F.default.classId,t.className=F.default.className,t.h5Module=F.default.h5Module,t.isHost=F.default.isHost,t.maxAudioChannels=F.default.maxAudioChannels,t.maxVideoChannels=F.default.maxVideoChannels,t.maxMediaChannels=F.default.maxMediaChannels,t.mcuDelay=F.default.mcuDelay,t.msType=F.default.msType,t.nodeId=F.default.nodeId,t.password=F.default.password,t.passwordRequired=F.default.passwordRequired,t.role=F.default.role,t.siteId=F.default.siteId,t.topNodeID=F.default.topNodeID,t.userId=F.default.userId,t.userName=F.default.userName,t.userRole=F.default.userRole,t.userType=F.default.userType,t.siteId=F.default.siteId,t.classId=F.default.classId,t.userRole=F.default.userRole,t.userId=F.default.userId,t.passwordRequired=F.default.passwordRequired,t.classType=F.default.classType||j.default.CLASS_TYPE_INTERACT,t.country=F.default.country,t.city=F.default.city,t.province=F.default.province,t.isp=F.default.isp,t.classTimestamp=F.default.classTimestamp,t.recordTimestamp=F.default.recordTimestamp,t.recordPlaybackMaxTime=F.default.recordPlaybackMaxTime,t.fps=F.default.fps,t.gop=F.default.gop,t.videoQuality=F.default.videoQuality,W.log("加入课堂成功->"),W.log(t),this._emit(v.default.CLASS_JOIN_SUCCESS,t)}},{key:"_switchMcuIpHandler",value:function(e){if(F.default.isRecordPlayBack)return void W.log("录制回放->不进行MCU动态选点");W.log("MCU->动态选点");var t=this;this._getFastestMcuServer(function(n){W.log("MCU选点结束->",n);var r=F.default.MCUServerIP;if(n&&n.ip)F.default.MCUServerIP=n.ip||"",F.default.MCUServerPort=n.port||"";else if(F.default.mcuList&&F.default.mcuList.length>0){var i=parseInt(Math.random()*F.default.mcuList.length);F.default.MCUServerIP=F.default.mcuList[i].ip||"",F.default.MCUServerPort=F.default.mcuList[i].port||""}r&&r!=F.default.MCUServerIP?(W.log("MCU->最新地址->",F.default.MCUServerIP,F.default.MCUServerPort),e&&1==e.reConnect?(W.log("MCU->切换到最新的IP->",F.default.MCUServerIP,F.default.MCUServerPort),t._startConnectMCU()):t._switchMcuIp()):W.log("MCU不需要切换->之前的IP->",r,"新的IP->",F.default.MCUServerIP)})}},{key:"_switchMsIpHandler",value:function(e){if(F.default.isRecordPlayBack)return void W.log("录制回放->不进行MS动态选点");W.log("MS->动态选点");this._getFastestMsServer(function(e){W.log("MS选点结束->",e);var t=F.default.MCUServerIP;if(e&&e.ip)F.default.MS_PUBLISH_IP=e.ip||"",F.default.MS_PUBLISH_PORT=e.port||"";else if(F.default.msList&&F.default.msList.length>0){var n=parseInt(Math.random()*F.default.msList.length);F.default.MS_PUBLISH_IP=F.default.msList[n].ip||"",F.default.MS_PUBLISH_PORT=F.default.msList[n].port||""}t&&t!=F.default.MS_PUBLISH_IP?W.log("MS->最新地址->",F.default.MS_PUBLISH_IP,F.default.MS_PUBLISH_PORT):W.log("MS不需要切换->IP",F.default.MS_PUBLISH_IP)})}},{key:"_sassDeleteDocument",value:function(e){return $.connected?null==e||x.default.isEmptyObject(e)?(W.error("删除文档失败->参数错误",e),void this._emit(v.default.MCU_ERROR,v.default.ERR_DOC_DELETE_FAILED_PARAM)):null==e.itemIdx||isNaN(e.itemIdx)||null==e.docId||""==e.docId?(W.error("删除文档失败->",e),void this._emit(v.default.MCU_ERROR,v.default.ERR_DOC_DELETE_FAILED_PARAM)):(W.log("删除文档->",e),void(K&&K.sassDeleteDocument(e))):void W.warn(F.default.getCurrentStatus())}},{key:"_sendDocBroadcastMsg",value:function(e){return $.connected?void(ne&&ne.sendDocBroadcastMsg(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sassDeleteDocumentSuccess",value:function(e){W.log("删除文档成功->",e),this._sendDocumentDelete(e)}},{key:"_sendStartClass",value:function(e){return $.connected?void(Z&&Z.startClass(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendPauseClass",value:function(e){return $.connected?void(Z&&Z.pauseClass(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_changeHandUpStatus",value:function(e){return $.connected?void(Z&&Z.changeHandUpStatus(e)):(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"_sendCloseClass",value:function(e){return $.connected?void(Z&&Z.closeClass(e)):(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"_leaveClass",value:function(e){if(!$.connected)return W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""};ee&&ee.stopPublishVideo(),te&&te.stopPublishAudio(),Z&&(Z.stopRecord(),Z.leaveClass());var t={};e&&e.type?t=e:t.type=0,W.warn("离开课堂->",v.default.CLASS_EXIT,t),this._emit(v.default.CLASS_EXIT,t),$&&($.leaveMCU(),F.default.setCurrentStatus(F.default.statusCode_3))}},{key:"_sendChatMsg",value:function(e){return $.connected?null===e||x.default.isEmptyObject(e)?(W.log("发送聊天消息失败->参数错误",e),{code:j.default.RETURN_FAILED,data:""}):void(X&&X.sendChatMsg(e)):(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"userDeviecStatusChange",value:function(e){Z&&Z.updaterUserDeviecStatusChange(e)}},{key:"videoUpdate",value:function(e){Z&&Z.updaterRosterStatus(e)}},{key:"_sendVideoBroadcastMsg",value:function(e){return $.connected?ee?ee.sendVideoBroadcastMsg(e):void 0:(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"_getVideoPlayPath",value:function(e){if(ee)return ee.getPlayVideoPath(e)}},{key:"_getVideoPublishPath",value:function(e){if(ee)return ee.getPublishVideoPath(e)}},{key:"_getVideoAllChannelInfo",value:function(e){if(ee)return ee.getAllChannelInfo(e)}},{key:"_publishVideo",value:function(e){return $.connected?ee?ee.publishVideo(e):void 0:(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"_stopPublishVideo",value:function(e){return $.connected?ee?ee.stopPublishVideo(e):void 0:(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"audioUpdate",value:function(e){Z&&Z.updaterRosterStatus(e)}},{key:"sendAudioCommandMsg",value:function(e){return $.connected?te?te.sendAudioBroadcastMsg(e):void 0:(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"_getPlayAudioPath",value:function(e){if(te)return te.getAudioPlayPath(e)}},{key:"_getPublishAudioPath",value:function(e){if(te)return te.getAudioPublishPath(e)}},{key:"_getAudioAllChannelInfo",value:function(e){if(te)return te.getAllChannelInfo(e)}},{key:"_publishAudio",value:function(e){return $.connected?te?te.publishAudio(e):void 0:(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"_stopPublishAudio",value:function(e){return $.connected?te?te.stopPublishAudio(e):void 0:(W.warn(F.default.getCurrentStatus()),{code:j.default.RETURN_FAILED,data:""})}},{key:"_sendInsertAnnotaion",value:function(e){return $.connected?void(re&&re.sendInsetAnnotaion(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendDeleteCurPageAnnotation",value:function(e){return $.connected?void(re&&re.sendDeleteCurPageAnnotation(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendDeleteAllAnnotation",value:function(e){return $.connected?void(re&&re.sendDeleteAllAnnotation(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendGotoPrev",value:function(e){re&&re.sendGotoPrev(e)}},{key:"_getDocFullAddress",value:function(e){return ne?ne.getDocFullAddress(e):(W.error("文档模块还没有创建无法获取"),{code:j.default.RETURN_FAILED,data:"文档模块还没有创建无法获取"})}},{key:"_getDocImageFullPath",value:function(e){return ne?ne.getDocImageFullPath(e):(W.error("文档模块还没有创建无法获取"),[])}},{key:"_getDocPDFFullPath",value:function(e){return ne?ne.getDocPDFFullPath(e):(W.error("文档模块还没有创建,无法获取"),[])}},{key:"_sendDocumentUpload",value:function(e){return $.connected?void(ne&&ne.documentUpload(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendDocumentSwitchDoc",value:function(e){return $.connected?void(ne&&ne.documentSwitchDoc(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendDocumentSwitchPage",value:function(e){return $.connected?void(ne&&ne.documentSwitchPage(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendDocumentSwitchAnimation",value:function(e){return $.connected?void(ne&&ne.documentSwitchAnimation(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendDocumentCommand",value:function(e){return $.connected?void(ne&&ne.documentCommand(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_sendDocumentDelete",value:function(e){return $.connected?void(ne&&ne.documentDelete(e)):void W.warn(F.default.getCurrentStatus())}},{key:"_documentDeleteAll",value:function(e){return $.connected?void(ne&&ne.documentDeleteAll(e)):void W.warn(F.default.getCurrentStatus())}},{key:"docUpdateHandler",value:function(e){return $.connected||F.default.isRecordPlayBack?void(re&&re.docUpdateHandler(e)):void W.warn(F.default.getCurrentStatus())}},{key:"docDeleteHandler",value:function(e){re&&re.docDeleteHandler(e)}},{key:"docJoinChannelSuccess",value:function(){if(W.log("docJoinChannelSuccess->isHost=",F.default.isHost,"length=",F.default.docListPrepare.length),F.default.isHost&&F.default.docListPrepare.length>0)for(var e=0;e<F.default.docListPrepare.length;e++){var t=F.default.docListPrepare[e];if(t){var n={pageNum:t.pdfSize,fileName:t.name,fileType:t.type,relativeUrl:t.relativeLocation,url:t.absoluteLocation,creatUserId:t.createUserID,docId:t.id,md5:t.MD5,visible:!1};this._sendDocumentUpload(n)}}}},{key:"_initRecordPlayback",value:function(e){return null==e?(W.error("录制回放初始化失败->参数错误"),void this._emit(v.default.MCU_ERROR,v.default.ERR_INIT_RECORD_PLAY_BACK_FAILED)):null==e.classId||isNaN(e.classId)||null==e.portal||""==e.portal?(W.error("录制回放初始化失败->",e),void this._emit(v.default.MCU_ERROR,v.default.ERR_INIT_RECORD_PLAY_BACK_FAILED)):(W.log("录制回放初始化->",e),F.default.isRecordPlayBack=!0,F.default.classId=parseInt(e.classId),F.default.portal=e.portal,F.default.userRole=j.default.normal,F.default.userId=e.userId||"0",F.default.userName=e.userName||"",void(K&&K.getClassParam()))}},{key:"_startRecordPlayback",value:function(e){ie&&ie.startRecordPlayback(e)}},{key:"_stopRecordPlayback",value:function(e){ie&&ie.stopRecordPlayback(e)}},{key:"_pauseRecordPlayback",value:function(e){ie&&ie.pauseRecordPlayback(e)}},{key:"_seekRecordPlayback",value:function(e){ie&&ie.seekRecordPlayback(e)}},{key:"_recordPlaybackClearDataHandler",value:function(e){W.log("录制回放状态更新->"),ne&&ne.clearData(),re&&re.clearData()}},{key:"_joinRecordPlaybackSuccessHandler",value:function(e){W.log("加入录制回放成功."),F.default.setCurrentStatus(F.default.statusCode_2);var t={};t.isRecordPlayBack=F.default.isRecordPlayBack,t.DOCServerIP=F.default.DOCServerIP,t.DOCServerPort=F.default.DOCServerPort,t.classStatus=F.default.classStatus,t.classId=F.default.classId,t.className=F.default.className,t.h5Module=F.default.h5Module,t.isHost=F.default.isHost,t.maxAudioChannels=F.default.maxAudioChannels,t.maxVideoChannels=F.default.maxVideoChannels,t.maxMediaChannels=F.default.maxMediaChannels,t.mcuDelay=F.default.mcuDelay,t.msType=F.default.msType,t.nodeId=F.default.nodeId,t.password=F.default.password,t.passwordRequired=F.default.passwordRequired,t.role=F.default.role,t.siteId=F.default.siteId,t.topNodeID=F.default.topNodeID,t.userId=F.default.userId,t.userName=F.default.userName,t.userRole=F.default.userRole,t.userType=F.default.userType,t.siteId=F.default.siteId,t.classId=F.default.classId,t.userRole=F.default.userRole,t.userId=F.default.userId,t.passwordRequired=F.default.passwordRequired,t.classType=F.default.classType||j.default.CLASS_TYPE_INTERACT,t.country=F.default.country,t.city=F.default.city,t.province=F.default.province,t.isp=F.default.isp,t.classTimestamp=F.default.classTimestamp,t.recordTimestamp=F.default.recordTimestamp,t.recordPlaybackMaxTime=F.default.recordPlaybackMaxTime,t.fps=F.default.fps,t.gop=F.default.gop,t.videoQuality=F.default.videoQuality,W.log(t),this._emit(v.default.CLASS_JOIN_SUCCESS,t)}}]),t}(l.default),oe=ae;t.default=oe;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(W,"loger","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(Q,"_sdkInfo","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(K,"_sass","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(z,"_ipManager","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register($,"_mcu","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(Z,"_confer_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(X,"_chat_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(ee,"_video_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(te,"_audio_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(ne,"_doc_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(re,"_whiteboard_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(ie,"_recordPlayback","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(ae,"MessageEntrance","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(oe,"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(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=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(7),l=r(u),f=n(1),d=r(f),c=n(17),h=r(c),p=n(28),_=r(p),E=n(27),g=r(E),y=d.default.getLoger("IpManager"),R=2e3,m="1935",v="7777",T="5555",C=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this))}return o(t,e),s(t,[{key:"getUserIpInfo",value:function(e,t,n,r){var i={ret:-1},a=(0,h.default)("addr="+t+"&token=b657c3507b324353e09c1958ee956a98efceb3e3"),o=(new Date).getTime(),s="http://ipapi.ipip.net/find?addr="+t+"&sid=14&uid=5237&sig="+a+"&_="+o;y.log("获取IP信息->",s);(0,g.default)(s,{timeout:r||R}).then(function(e){return e.json()}).then(function(e){e&&(i.ret=e.ret,i.country=e.data[0],i.province=e.data[1],i.city=e.data[2],i.isp=e.data[4]),y.warn("获取IP信息->完成->",i),n&&n(i)}).catch(function(e){y.warn("获取IP信息->失败->",e.message),n&&n(i)})}},{key:"getFastestMcuServer",value:function(e,t,n){y.log("开始MCU选点-> ",e);var r={ip:""};if(null==e||e.length<1)return void(t&&t(r));for(var i=new Object,a=e.length,o=0;o<a;o++){var s=e[o];s&&s.ip&&(i[s.ip+":"+T]=s.ip+":"+T)}var u=new Array;for(var l in i)u.push(l);if(y.log("MCU选点->列表",u),null==u||u.length<1)return void(t&&t(r));try{(0,_.default)(u,function(n){if(n){y.log("MCU选点->done -> ",n);var i=n.replace(":"+T,"")||"";r.ip=i,r.port="";for(var a=e.length,o=0;o<a;o++){var s=e[o];if(s&&s.ip&&i==s.ip){r.port=s.port||v;break}}t&&t(r)}else y.warn("MCU选点-> nothing!"),t&&t(r)},n||R)}catch(e){y.log("MCU选点->失败",e.message)}}},{key:"getFastestMsServer",value:function(e,t,n){y.log("开始MS选点->",e);var r={ip:""};if(null==e||e.length<1)return void(t&&t(r));for(var i=new Object,a=e.length,o=0;o<a;o++){var s=e[o];s&&s.ip&&(i[s.ip+":"+T]=s.ip+":"+T)}var u=new Array;for(var l in i)u.push(l);if(null==u||u.length<1)return void(t&&t(r));y.log("MS选点->列表",u);try{(0,_.default)(u,function(n){if(n){y.log("MS选点->done -> ",n);var i=n.replace(":"+T,"")||"";r.ip=i,r.port="";for(var a=e.length,o=0;o<a;o++){var s=e[o];if(s&&s.ip&&i==s.ip){r.port=s.port||m;break}}t&&t(r)}else y.warn("MS选点-> nothing!"),t&&t(r)},n||R)}catch(e){y.warn("MS选点->ERROR -> ",e.message),t&&t(r)}}},{key:"getServerMcuList",value:function(e,t,n,r,i){var a=i.MCU[e];if(!a)return a=i.MCU.default||[];if("中国"!=e)return a;var o=a.isp[r];if(o)return o;var s=a.province[t];if(s)return s;var u=a.default;return u?u:[]}},{key:"getServerMsList",value:function(e,t,n,r,i){var a=i.MS[e];if(!a)return a=i.MS.default||[];if("中国"!=e)return a;var o=a.isp[r];if(o)return o;var s=a.province[t];if(s)return s;var u=a.default;return u?u:[]}}]),t}(l.default),S=C;t.default=S;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(y,"loger","D:/work/McuClient/src/IpManager.js"),__REACT_HOT_LOADER__.register(R,"TIME_OUT","D:/work/McuClient/src/IpManager.js"),__REACT_HOT_LOADER__.register(m,"MS_DEFAULT_PORT","D:/work/McuClient/src/IpManager.js"),__REACT_HOT_LOADER__.register(v,"MCU_DEFAULT_PORT","D:/work/McuClient/src/IpManager.js"),__REACT_HOT_LOADER__.register(T,"SPEED_TEST_PORT","D:/work/McuClient/src/IpManager.js"),__REACT_HOT_LOADER__.register(C,"IpManager","D:/work/McuClient/src/IpManager.js"),__REACT_HOT_LOADER__.register(S,"default","D:/work/McuClient/src/IpManager.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return l}Object.defineProperty(t,"__esModule",{value:!0}),t.MessageTypes=void 0,t.createMcuClient=i;var a=n(33),o=r(a),s=n(3),u=r(s),l=new o.default;t.MessageTypes=u.default;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(l,"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 a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=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(7),l=r(u),f=n(1),d=r(f),c=n(3),h=r(c),p=n(5),_=r(p),E=n(17),g=r(E),y=n(2),R=r(y),m=n(28),v=(r(m),n(27)),T=(r(v),d.default.getLoger("Sass")),C={},S=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this))}return o(t,e),s(t,[{key:"getJoinParams",value:function(e){var n=this,r="http://"+e.portal+"/3m/api/meeting/joinParams.do?meetingNumber="+e.classId+"&userID="+e.userId;T.log("1.初始化init获取课堂校验信息."),T.log(r),T.log(e),fetch(r,{timeout:5e3}).then(function(e){if(e.ok)return e.json();throw T.error("初始化init获取课堂校验信息-网络异常.状态码:"+e.status),n._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_INIT_NETWORK),""}).then(function(e){0===e.code?(T.log("初始化init获取课堂校验信息-完成"),n._emit(t.CLASS_INIT_SUCCESS,e)):1===e.code?n._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_INIT_FAILED_1):2===e.code?n._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_INIT_FAILED_2):3===e.code?n._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_INIT_FAILED_3):4===e.code?n._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_INIT_FAILED_4):n._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_INIT_FAILED,e)}).catch(function(e){T.error("初始化init获取课堂校验信息-异常.状态码:"+e),n._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_INIT_PROTOCOL,e)})}},{key:"passwordAndMd5Checking",value:function(e){return T.log("2.开始Sass校验"),T.log(e),C=e,"true"===C.passwordRequired||C.passwordRequired===!0?void this.sendPWDChecking():void this.sendMD5Checking()}},{key:"sendPWDChecking",value:function(){var e=this,t=0;C.userRole==R.default.host&&(t=1);var n="http://"+C.portal+"/3m/api/meeting/signIn.do?siteId="+C.siteId+"&classId="+C.classId+"&isTeacher="+t+"&password="+C.password;T.log("3.课堂密码校验",n),fetch(n,{timeout:5e3}).then(function(t){if(200===t.status)return t.text();throw T.error("课堂密码校验-网络异常.状态码:"+t.status),e._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_JOIN_NETWORK), +""}).then(function(t){var n=JSON.parse(t);return"false"===n.flag||n.flag===!1?(T.error("课堂密码校验-失败."),void e._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_PASSWORD_WRONG)):"true"===n.flag||n.flag===!0?(T.log("课堂密码校验-成功."),void e.sendMD5Checking()):(T.error("课堂密码校验-协议异常.",n),void e._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_JOIN_PROTOCOL))}).catch(function(t){T.error("课堂密码校验-异常.状态码:"+t),e._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_JOIN_FAILED)})}},{key:"sendMD5Checking",value:function(){var e=this,n="http://"+C.portal+"/3m/meeting/md5CheckMeeting.do?siteId="+C.siteId+"&meetingNumber="+C.classId+"&userId="+C.userId+"&userName="+C.userName+"&userType="+C.userType+"&nopassword="+C.passwordRequired+"&md5="+C.md5;T.log("4.MD5校验",n),fetch(n,{timeout:5e3}).then(function(t){if(200===t.status)return t.json();throw T.error("MD5校验-网络异常.状态码:"+t.status),e._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_JOIN_NETWORK),""}).then(function(n){"true"==n.flag||1==n.flag?(T.log("MD5校验完成"),T.log(n),e._emit(t.SUCCESS,n)):(T.log("MD5校验-失败."),e._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_MD5_WRONG))}).catch(function(t){T.error("MD5校验-异常.状态码:"+t),e._emit(h.default.MCU_ERROR,h.default.ERR_CLASS_JOIN_FAILED)})}},{key:"getClassDetail",value:function(){var e=this,n="http://"+_.default.portal+"/3m/meeting/getClassH5.do?classNumber="+_.default.classId;T.log("获取Class详情.",n),fetch(n,{timeout:5e3}).then(function(t){if(t.ok)return t.json();throw T.error("获取Class详情-网络异常.状态码:"+t.status),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_CLASS_DETAIL),""}).then(function(n){0===n.errorCode?(T.log("获取Class详情完成"),e._emit(t.CLASS_GET_CLASS_DETAIL,n)):(T.warn("获取Class详情失败."),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_CLASS_DETAIL))}).catch(function(t){T.error("获取Class详情异常.状态码:"+t),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_CLASS_DETAIL)})}},{key:"getClassParam",value:function(){var e=this,n=(new Date).getTime(),r=(0,g.default)(_.default.classId+""+n),i="http://"+_.default.portal+"/3m/api/meeting/detail.do?meetingNumber="+_.default.classId+"×tamp="+n+"&authId="+r;T.log("5.获取课堂课堂的完整信息 "),T.log(i),fetch(i,{timeout:5e3}).then(function(t){if(t.ok)return t.json();throw T.error("获取课堂课堂的完整信息-网络异常.状态码:"+t.status),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_CLASS_PARAML),""}).then(function(n){0===n.code?(T.log("获取课堂课堂的完整信息完成"),e._emit(t.CLASS_GET_CLASS_PARAM,n)):(T.warn("获取课堂课堂的完整信息 失败."),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_CLASS_PARAML))}).catch(function(t){T.error("获取课堂课堂的完整信息异常.状态码:"+t),e._emit(h.default.MCU_ERROR,h.default.ERR_GET_CLASS_PARAML)})}},{key:"sassDeleteDocument",value:function(e){var n=this;if(_.default.isRecordPlayBack)return void T.log("录制回放中,能删除文档");var r=(new Date).getTime(),i=(0,g.default)(e.docId+""+e.classId+r),a="http://"+_.default.portal+"/3m/api/document/deleteRelation.do?docId="+e.docId+"&classId="+_.default.classId+"×tamp="+r+"&authId="+i;T.log("sassDeleteDocument",a),fetch(a,{timeout:5e3}).then(function(e){if(e.ok)return e.json();throw T.error("sassDeleteDocument-网络异常.状态码:"+e.status),n._emit(h.default.MCU_ERROR,h.default.ERR_DOC_DELETE_FAILED),""}).then(function(r){0===r.code?(T.log("sassDeleteDocument 完成"),n._emit(t.DELETE_DOCUMENT_SUCCESS,e)):(T.warn("sassDeleteDocumnt 失败."),n._emit(h.default.MCU_ERROR,h.default.ERR_DOC_DELETE_FAILED))}).catch(function(e){T.error("sassDeleteDocument异常.状态码:"+e),n._emit(h.default.MCU_ERROR,h.default.ERR_DOC_DELETE_FAILED)})}},{key:"saveClassStatusInfo",value:function(e){var n=this;if(_.default.isRecordPlayBack)return void T.log("录制回放中,不需要保存课堂信息");var r=(new Date).getTime(),i=(0,g.default)(_.default.classId+""+r),a=JSON.stringify(e.classStatusInfo),o="http://"+_.default.portal+"/3m/api/meeting/saveInfo.do";T.log("saveClassStatusInfo",o),fetch(o,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"classId="+_.default.classId+"&info="+a+"×tamp="+r+"&authId="+i,timeout:5e3}).then(function(e){if(e.ok)return e.json();throw T.error("saveClassStatusInfo-网络异常.状态码:"+e.status),""}).then(function(r){0===r.code?(T.log("saveClassStatusInfo 完成"),n._emit(t.CLASS_SAVE_STATUS_INFO_SUCCESS,e)):1===r.code?T.log("saveClassStatusInfo 失败 课堂号为空"):2===r.code?T.log("saveClassStatusInfo 失败 无效的课堂号"):3===r.code?T.log("saveClassStatusInfo 失败 验证信息错误"):T.warn("saveClassStatusInfo 失败.",r)}).catch(function(e){T.error("saveClassStatusInfo.状态码:"+e)})}},{key:"saveClassRecordContrlInfo",value:function(e){var n=this;if(_.default.isRecordPlayBack)return void T.log("录制回放中,不需要保存");T.log("保存开始录制信息");var r="3mang123A",i=_.default.siteId,a=_.default.classId,o=_.default.userId,s=_.default.userName,u=_.default.className,l=_.default.classBeginTime,f=_.default.classEndTime,d="",c=_.default.recordFileName,h=_.default.recordFileName,p="",E=(_.default.classStatus,_.default.classTimestamp),y=(new Date).getTime(),R=(0,g.default)(r+i+a+y),m="http://"+_.default.portal+"/3m/recordingMeeting/insertRecordingMeeting.do";T.log("saveClassRecordContrlInfo",m),fetch(encodeURI(m),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"siteID="+i+"&meetingID="+a+"&userID="+o+"&userName="+s+"&meetingName="+u+"&startTime="+l+"&endTime="+f+"&playUrl="+d+"&streamName="+c+"&downloadUrl="+p+"&configFile="+h+"×tamp="+y+"&recordTimestamp="+E+"&authId="+R,timeout:5e3}).then(function(e){if(e.ok)return e.json();throw T.error("保存开始录制信息-网络异常.状态码:"+e.status),""}).then(function(r){0===r.errorCode?(T.log("保存开始录制信息 完成"),n._emit(t.CLASS_SAVE_RECORD_INFO_SUCCESS,e)):T.warn("保存开始录制信息 失败.",r)}).catch(function(e){T.error("保存开始录制信息异常.状态码:"+e)})}}]),t}(l.default);S.prototype.SUCCESS=S.SUCCESS="Sass_success",S.prototype.CLASS_INIT_SUCCESS=S.CLASS_INIT_SUCCESS="sass_class_init_success",S.prototype.CLASS_GET_CLASS_PARAM=S.CLASS_GET_CLASS_PARAM="sass_class_getClassParam.message",S.prototype.CLASS_GET_CLASS_DETAIL=S.CLASS_GET_CLASS_DETAIL="sass_class_getClassDetail_message",S.prototype.DELETE_DOCUMENT_SUCCESS=S.DELETE_DOCUMENT_SUCCESS="sass_class_deleteDocumentSuccess_message",S.prototype.CLASS_SAVE_STATUS_INFO_SUCCESS=S.CLASS_SAVE_STATUS_INFO_SUCCESS="sass_class_saveClassStatusInfoSuccess_message",S.prototype.CLASS_SAVE_RECORD_INFO_SUCCESS=S.CLASS_SAVE_RECORD_INFO_SUCCESS="sass_class_saveClassRecordInfoSuccess_message";var I=new S;t.default=I;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(T,"loger","D:/work/McuClient/src/Sass.js"),__REACT_HOT_LOADER__.register(C,"confInfo","D:/work/McuClient/src/Sass.js"),__REACT_HOT_LOADER__.register(S,"Sass","D:/work/McuClient/src/Sass.js"),__REACT_HOT_LOADER__.register(I,"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 a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=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(8),l=r(u),f=n(2),d=r(f),c=n(6),h=r(c),p=n(1),_=r(p),E=n(3),g=r(E),y=n(5),R=r(y),m=n(4),v=r(m),T=n(21),C=r(T),S=_.default.getLoger("AudioApe"),I=function(e){function t(){i(this,t);var e=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,d.default.AUDIO_SESSION_ID,d.default.AUDIO_SESSION_NAME,d.default.AUDIO_SESSION_TAG));return e.releaseTimeId=0,e.mediaModule=new C.default,e.mediaModule.MEDIA_OBJ_TABLE_ID=d.default.AUDIO_OBJ_TABLE_ID,e.mediaModule.mediaChannels={},e.mediaModule.mediaType=d.default.MEDIA_TYPE_AUDIO,e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(h.default.RCPDU_REG_REGISTER_TABLE,d.default.AUDIO_OBJ_TABLE_ID,d.default.AUDIO_OBJ_TABLE_NAME,d.default.AUDIO_OBJ_TABLE_TAG,0,new ArrayBuffer),e.on(h.default.RCPDU_SEND_AUDIO_DATA_REQUEST,e.receiveAudiooCommandHandler.bind(e)),e}return o(t,e),s(t,[{key:"onJoinChannelHandlerSuccess",value:function(){this.mediaModule.maxMediaChannel=R.default.maxAudioChannels}},{key:"getAudioPlayPath",value:function(e){return S.log("获取播流地址->"),this.mediaModule.getMediaPlayPath(e)}},{key:"getAudioPublishPath",value:function(e){if(S.log("获取推流地址->"),!this.mcu.connected)return S.warn(R.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};var t=0,n=C.default.allMediaChannelsList;for(var r in n){var i=n[r];i&&i.status==d.default.CHANNEL_STATUS_OPENING&&t++}if(t>=R.default.maxMediaChannels)return S.warn("不能再打开设备->当前开启的设备数量->",t),{code:d.default.RETURN_FAILED,data:"不能再打开设备,当前开启的设备数量"};var a=this.mediaModule.getMediaPublishPath(e);return this._emit(g.default.AUDIO_GET_PUBLISH_PATH,a),a}},{key:"getAllChannelInfo",value:function(e){return S.log("获取当前所有频道信息->"),this.mediaModule.getAllMediaChannelInfo()}},{key:"publishAudio",value:function(e){if(!this.mcu.connected)return S.warn(R.default.getCurrentStatus()),this._emit(g.default.AUDIO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"已经断开连接!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"已经断开连接",mediaId:0};if(null==e||null==e.publishUrl)return S.warn("推流->参数错误",e),this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),this._emit(g.default.AUDIO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"参数错误!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"参数错误"};var t=this.mediaModule.getNeedPublishMediaChannel(e.publishUrl);if(null==t)return S.warn("推流->推流数据已经无效",e),this._emit(g.default.AUDIO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"推流数据已经无效!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"推流数据已经无效"};var n=this.mediaModule.getFreeMediaChannel();if(0==n)return S.warn("推流->不能再打开更多的设备"),this._emit(g.default.AUDIO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"不能再打开更多的设备",mediaId:0}),{code:d.default.RETURN_FAILED,data:"不能再打开更多的设备",mediaChannels:this.mediaModule.mediaChannels};if(this.mediaModule.checkChannelIsOpening(t.channelId))return t.nodeId==R.default.nodeId?(S.warn(t.channelId,"已经推送过消息,不需要再次推送!"),this._emit(g.default.AUDIO_PUBLISH_RESULT,{code:d.default.RETURN_SUCCESS,data:"已经推送过消息,不需要再次推送!",mediaId:t.channelId}),{code:d.default.RETURN_SUCCESS,data:"已经推送过消息,不需要再次推送!",mediaId:t.channelId}):(S.warn(t.channelId,"频道已经被占用"),this._emit(g.default.AUDIO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"频道已经被占用!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"频道已经被占用!"});var r=this.mediaModule.getDefaultChannelInfo();return r.owner=R.default.nodeId,r.status=d.default.CHANNEL_STATUS_OPENING,r.channelId=t.channelId,r.streamId=t.streamId,r.timestamp=t.timestamp,r.mediaType=d.default.MEDIA_TYPE_AUDIO,this.sendTableUpdateHandler(r),this._emit(g.default.AUDIO_PUBLISH_RESULT,{code:d.default.RETURN_SUCCESS,data:"推流成功!",mediaId:t.channelId}),{code:d.default.RETURN_SUCCESS,data:"推流成功!",mediaId:t.channelId}}},{key:"stopPublishAudio",value:function(e){if(S.log("停止推流 ->",e),!this.mcu.connected)return S.warn(R.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};var t=R.default.nodeId;e&&parseInt(e.nodeId)>0&&(t=parseInt(e.nodeId));var n=0;e&&parseInt(e.mediaId)>0&&(n=parseInt(e.mediaId)),n>0?this._releaseChannelForNodeId(t,n):this._releaseNodeIdAllChannel(t)}},{key:"_releaseChannelForNodeId",value:function(e,t){S.log(e,"释放占用的频道-->",t);var n=this.mediaModule.mediaChannels[t];if(n&&n.status==d.default.CHANNEL_STATUS_OPENING)if(n.fromNodeId==e){var r=this.mediaModule.getDefaultChannelInfo();r.status=d.default.CHANNEL_STATUS_RELEASED,r.channelId=t,this.sendTableUpdateHandler(r)}else S.warn(t,"不属于nodeId",e,"不能释放",n);else S.warn(e,"要释放的频道不存在或者已经释放-->channelId",n)}},{key:"_releaseNodeIdAllChannel",value:function(e){if(S.log(e,"_releaseNodeIdAllChannel",this.mcu.connected),!this.mcu.connected)return clearTimeout(this.releaseTimeId),S.warn(R.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};var t=this.mediaModule.getOpeningMediaChannel(e);if(0==t)return S.warn(e,"没有占用频道不需要处理"),{code:d.default.RETURN_FAILED,data:"没有占用channel不需要处理"};var n=this.mediaModule.getDefaultChannelInfo();n.status=d.default.CHANNEL_STATUS_RELEASED,n.channelId=t,this.sendTableUpdateHandler(n),this.releaseTimeId=setTimeout(function(){S.warn(e,"检查频道是否占用"),this._releaseNodeIdAllChannel(e)}.bind(this),800)}},{key:"sendAudioBroadcastMsg",value:function(e){if(!this.mcu.connected)return S.warn(R.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};if(null===this._classInfo||v.default.isEmptyObject(this._classInfo))return S.log("音频模块广播->失败->还未初始化数据!"),0==R.default.getCurrentStatus().code||1==R.default.getCurrentStatus().code?(this._emit(g.default.MCU_ERROR,g.default.ERR_APE_SEND_FAILED_NO_JOIN),{code:d.default.RETURN_FAILED,data:"sendAudioBroadcastMsg.McuClient还未初始化数据"}):{code:d.default.RETURN_FAILED,data:"sendAudioBroadcastMsg.McuClient还未初始化数据"};if(null==e)return S.warn("音频模块广播->失败->,参数错误",e),this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),{code:d.default.RETURN_FAILED,data:"sendAudioBroadcastMsg,参数错误"};if(S.log("音频模块广播->",e),null!=e.actionType&&e.actionType==d.default.MEDIA_ACTION_OPEN_CAMERA){var t=this.mediaModule.getFreeMediaChannel();if(0==t)return S.warn("不能再打开更多的设备",e),{code:d.default.RETURN_FAILED,data:"不能再打开更多的设备",mediaChannels:this.mediaModule.mediaChannels}}var n=new h.default.RCAudioSendDataRequestPdu;n.type=h.default.RCPDU_SEND_AUDIO_DATA_REQUEST,n.isPublic=!0,n.fromNodeId=R.default.nodeId,n.toNodeId=parseInt(e.toNodeId)||0,n.actionType=parseInt(e.actionType)||d.default.MEDIA_ACTION_DEFAULT;var r="";try{r=JSON.stringify(e.data)}catch(t){S.warn("控制消息->JSON转换失败"),r=e.data}return n.data=this._rCArrayBufferUtil.strToUint8Array("h5"+r),n.isPublic||0==n.toNodeId?this.sendChatUniform(n):this.send(n),{code:d.default.RETURN_SUCCESS,data:""}}},{key:"sendTableUpdateHandler",value:function(e){var t=this.packPdu(e,e.channelId);if(null==t)return void S.warn("音频模块更新数据-> 失败->数据无效",e);var n=new h.default.RCRegistryTableItemPdu;n.itemIdx=e.channelId,n.owner=e.owner,n.itemData=t.toArrayBuffer();var r=new h.default.RCRegistryTableUpdateItemPdu;r.type=h.default.RCPDU_REG_TABLE_UPDATE_PDU,r.items.push(n);var i=new h.default.RCRegistryUpdateObjPdu;i.objId=d.default.AUDIO_OBJ_TABLE_ID,i.subType=r.type,i.userData=r.toArrayBuffer();var a=new h.default.RCAdapterItemPdu;a.type=h.default.RCPDU_REG_UPDATE_OBJ,a.itemData=i.toArrayBuffer();var o=new h.default.RCAdapterPdu;o.type=h.default.RCPDU_REG_ADAPTER,o.item.push(a),S.log("音频模块更新数据->itemIdx="+n.itemIdx),this.sendUniform(o,!0)}},{key:"receiveAudiooCommandHandler",value:function(e){var t=h.default.RCAudioSendDataRequestPdu.decode(e);if(null==t)return void S.warn("音频消息处理,收到的消息为null,不做处理");t.data=this._rCArrayBufferUtil.uint8ArrayToStr(t.data,2);var n={};try{n=JSON.parse(t.data)}catch(e){S.warn("控制消息->JSON转换失败"),n=t.data}t.data=n,0!=t.toNodeId&&t.toNodeId!=R.default.nodeId?S.log("音频消息不处理 toNodeId=",t.toNodeId,"my nodeId=",R.default.nodeId):(S.log("音频控制消息处理 .",t),this._emit(g.default.AUDIO_BROADCAST,t))}},{key:"tableUpdateHandler",value:function(e,t,n,r){var i=this.unPackPdu(e,t,n);if(S.log("tableUpdateHandler->channel",t,"status->",i.status,"seek->",r),0==e&&(S.log("释放占用的频道,channel",t),i.status=d.default.CHANNEL_STATUS_RELEASED,i.streamId=""),this.mediaModule.mediaChannels[t]=i,i&&i.fromNodeId!=R.default.nodeId){var a={};if(a.mediaId=i.channelId,a.fromNodeId=i.fromNodeId,a.userName=i.userName||"",a.userRole=i.userRole||d.default.normal,i.status==d.default.CHANNEL_STATUS_OPENING){a.m3u8Url="",a.rtmpUrl="",a.replay="",a.seek=r||0;var o=this.mediaModule.getMediaPlayPath({type:"m3u8",streamId:i.streamId}),s=this.mediaModule.getMediaPlayPath({type:"rtmp",streamId:i.streamId}),u=this.mediaModule.getMediaRecordPlaybackPath({type:"m3u8",streamId:i.streamId});0==o.code&&(a.m3u8Url=o.playUrl),0==s.code&&(a.rtmpUrl=s.playUrl),0==u.code&&(a.replay=u.playUrl),S.log("AUDIO_PLAY->",a),this._emit(g.default.AUDIO_PLAY,a)}else S.log("AUDIO_STOP->",a),this._emit(g.default.AUDIO_STOP,a)}else S.warn("消息是自己发送的或者是消息无效,不需要处理,消息内容如下:"),S.log(i),i.status==d.default.CHANNEL_STATUS_OPENING?(R.default.openMicrophones=v.default.creatTimestamp(),R.default.openCamera=0):(R.default.openCamera=0,R.default.openMicrophones=0),this._emit(g.default.USER_DEVICE_STATUS_CHAANGE,{nodeId:R.default.nodeId,userRole:R.default.userRole,userName:R.default.userName,userId:R.default.userId,openCamera:R.default.openCamera,openMicrophones:R.default.openMicrophones});this._emit(g.default.AUDIO_UPDATE,i)}},{key:"packPdu",value:function(e,t){if(null==e||null==t)return S.warn("packPdu->失败"),this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),null;var n=new h.default.RCAudioChannelInfoPdu;return n.status=e.status||d.default.CHANNEL_STATUS_RELEASED,n.channelId=t,n.streamId=e.streamId||"",n.siteId=e.siteId||R.default.siteId,n.classId=parseInt(e.classId)||parseInt(R.default.classId),n.userId=e.userId||"0",n.mediaType=e.mediaType||d.default.MEDIA_TYPE_AUDIO,n.timestamp=e.timestamp||v.default.creatTimestamp(),n.fromNodeId=R.default.nodeId,n.userName=R.default.userName||"",n.toNodeId=0,n.userRole=R.default.userRole||d.default.normal,S.log("packPdu->",n),n}},{key:"unPackPdu",value:function(e,t,n){if(null==e||null==t||null==n)return this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),null;try{var r=h.default.RCAudioChannelInfoPdu.decode(n);return S.log("unPackPdu->",r),r}catch(e){S.log("unPackPdu error->itemIdx="+t+" err:"+e.message)}return null}}]),t}(l.default),A=I;t.default=A;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(S,"loger","D:/work/McuClient/src/apes/AudioApe.js"),__REACT_HOT_LOADER__.register(I,"AudioApe","D:/work/McuClient/src/apes/AudioApe.js"),__REACT_HOT_LOADER__.register(A,"default","D:/work/McuClient/src/apes/AudioApe.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 a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=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(8),l=r(u),f=n(2),d=r(f),c=n(6),h=r(c),p=n(1),_=r(p),E=n(3),g=r(E),y=n(4),R=r(y),m=_.default.getLoger("ChatApe"),v=function(e){function t(){i(this,t);var e=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,d.default.CHAT_SESSION_ID,d.default.CHAT_SESSION_NAME,d.default.CHAT_SESSION_TAG));return e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(h.default.RCPDU_REG_REGISTER_TABLE,d.default.CHAT_OBJ_TABLE_ID,d.default.CHAT_OBJ_TABLE_NAME,d.default.CHAT_OBJ_TABLE_TAG,0,new ArrayBuffer),e.on(h.default.RCPDU_SEND_CHAT_DATA_REQUEST,e.chatMsgIncomingHandler.bind(e)),e}return o(t,e),s(t,[{key:"sendChatMsg",value:function(e){if(null===this._classInfo||R.default.isEmptyObject(this._classInfo)){if(m.log("不能发送聊天消息.McuClient还未初始化数据!"),0==GlobalConfig.getCurrentStatus().code||1==GlobalConfig.getCurrentStatus().code)return void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_SEND_FAILED_NO_JOIN)}else{m.log("发送聊天消息.",e.to,e.message);var t=new h.default.RCChatSendDataRequestPdu;t.type=h.default.RCPDU_SEND_CHAT_DATA_REQUEST,t.initiator=this._classInfo.nodeId,t.peer=parseInt(e.to),t.userData=this._rCArrayBufferUtil.strToUint8Array("h5"+e.message),t.fromName=this._rCArrayBufferUtil.strToUint8Array("h5"+this._classInfo.userName),t.fromRole=this._classInfo.userRole,t.isPublic=!0,t.isPublic||0==t.peer?this.sendChatUniform(t):this.send(t)}}},{key:"chatMsgIncomingHandler",value:function(e){var t=h.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,m.log("接收聊天消息.",n),this._emit(g.default.CHAT_RECEIVE,n)}}]),t}(l.default),T=v;t.default=T;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(m,"loger","D:/work/McuClient/src/apes/ChatApe.js"),__REACT_HOT_LOADER__.register(v,"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 a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=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(8),l=r(u),f=n(2),d=r(f),c=n(6),h=r(c),p=n(1),_=r(p),E=n(3),g=r(E),y=n(5),R=r(y),m=n(4),v=r(m),T=_.default.getLoger("DocApe"),C=0,S=function(e){function t(){i(this,t);var e=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,d.default.DOCSHARING_SESSION_ID,d.default.DOCSHARING_SESSION_NAME,d.default.DOCSHARING_SESSION_TAG));return e.docList={},e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(h.default.RCPDU_REG_REGISTER_TABLE,d.default.DOCSHARING_OBJ_TABLE_ID,d.default.DOCSHARING_OBJ_TABLE_NAME,d.default.DOCSHARING_OBJ_TABLE_TAG,0,new ArrayBuffer),e}return o(t,e),s(t,[{key:"documentUpload",value:function(e){if(null==e||v.default.isEmptyObject(e))return T.warn("上传文档->失败->参数错误->",e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG);if(this.checkDocId(e.docId))return void T.warn("上传文档->失败->文档档的docId无效或已经存在相同的docId不需要上传");C=v.default.creatSoleNumberFromTimestamp();var t=this.packPdu(e,C);if(null==t)return T.log("上传文档->失败->数据无效"),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG);var n=new h.default.RCRegistryTableItemPdu;n.itemIdx=C,n.registerObjId=d.default.DOCSHARING_OBJ_TABLE_ID,n.owner=0,n.itemData=t.toArrayBuffer();var r=new h.default.RCRegistryTableInsertItemPdu;r.type=h.default.RCPDU_REG_TABLE_INSERT_PDU,r.items.push(n);var i=new h.default.RCRegistryUpdateObjPdu;i.objId=d.default.DOCSHARING_OBJ_TABLE_ID,i.subType=r.type,i.userData=r.toArrayBuffer();var a=new h.default.RCAdapterItemPdu;a.type=h.default.RCPDU_REG_UPDATE_OBJ,a.itemData=i.toArrayBuffer();var o=new h.default.RCAdapterPdu;o.type=h.default.RCPDU_REG_ADAPTER,o.item.push(a),T.log("上传文档->发送->itemIdx="+n.itemIdx),this.sendUniform(o,!0)}},{key:"updaterDoc",value:function(e,t){if(null==e||null==t)return this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),null;T.log("文档->updaterDoc ",e);var n=this.packPdu(e,t),r=new h.default.RCRegistryTableItemPdu;r.itemIdx=t,r.owner=0,r.itemData=n.toArrayBuffer();var i=new h.default.RCRegistryTableUpdateItemPdu;i.type=h.default.RCPDU_REG_TABLE_UPDATE_PDU,i.items.push(r);var a=new h.default.RCRegistryUpdateObjPdu;a.objId=d.default.DOCSHARING_OBJ_TABLE_ID,a.subType=i.type,a.userData=i.toArrayBuffer();var o=new h.default.RCAdapterItemPdu;o.type=h.default.RCPDU_REG_UPDATE_OBJ,o.itemData=a.toArrayBuffer();var s=new h.default.RCAdapterPdu;s.type=h.default.RCPDU_REG_ADAPTER,s.item.push(o),T.log("发送更新文档.itemIdx="+r.itemIdx),this.sendUniform(s,!0)}},{key:"getDocFullAddress",value:function(e){if(null==e||null==e.url||null==e.itemIdx)return T.warn("获取文档完整地址->传递的参数不正确->",e),{code:d.default.RETURN_FAILED,data:"获取文档时传递的参数不对"};var t="",n=1,r="",i="",a=this.docList[e.itemIdx];a?(t=a.url||"",n=a.pageNum||1,i=a.fileType||""):t=e.url,r=this._getDocType(t);var o=this._getDocPath(t),s=[],u="",l="";if("jpg"==r||"png"==r||"swf"==r||"pdf"==r||"doc"==r||"pptx"==r)for(var f=1;f<=n;f++)s.push(o+"/"+f+".jpg");return"swf"!=r&&"pdf"!=r&&"doc"!=r&&"pptx"!=r||(l=t.replace(/\.swf/g,".pdf")||""),"html"==r&&(u=t),{code:d.default.RETURN_SUCCESS,data:"",docFullAddress:{images:s,pdf:l,html:u}}}},{key:"_getDocType",value:function(e){return e?e.lastIndexOf(".jpg")>=0?"jpg":e.lastIndexOf(".png")>=0?"png":e.lastIndexOf(".swf")>=0?"swf":e.lastIndexOf(".pdf")>=0?"pdf":e.lastIndexOf(".doc")>=0?"doc":e.lastIndexOf(".html")>=0?"html":e.lastIndexOf(".pptx")>=0?"pptx":"":""}},{key:"_getDocPath",value:function(e){if(!e)return"";var t=e.lastIndexOf("/");return t>0?e.substr(0,t):e}},{key:"getDocImageFullPath",value:function(e){if(null==e||null==e.relativeUrl||""==e.relativeUrl)return T.warn("获取文档完整地址,传递的参数不对.",e),[];var t=""==R.default.DOCServerPort||null==R.default.DOCServerPort?"":":"+R.default.DOCServerPort,n=R.default.DOCServerIP+t+e.relativeUrl;n&&n.indexOf("http://")<0&&(n="http://"+n);var r="jpg";switch(e.type){case"jpg":r="jpg",n=this.replacePathType(n)+".jpg";break;case"png":r="png",n=this.replacePathType(n)+".png"}if(e.pageNum&&parseInt(e.pageNum)>1){var i=n.lastIndexOf("/");if(i>0){for(var a=n.substr(0,i),o=[],s=1;s<=e.pageNum;s++)o.push(a+"/"+s+"."+r);return o}return[n]}return[n]}},{key:"getDocPDFFullPath",value:function(e){if(null==e||null==e.relativeUrl||""==e.relativeUrl)return T.warn("获取文档完整地址,传递的参数不对.",e),[];var t=""==R.default.DOCServerPort||null==R.default.DOCServerPort?"":":"+R.default.DOCServerPort,n=R.default.DOCServerIP+t+e.relativeUrl;return n&&n.indexOf("http://")<0&&(n="http://"+n),n=this.replacePathType(n)+".pdf",[n]}},{key:"replacePathType",value:function(e){var t=e;return t=t.replace(/.jpg/g,""),t=t.replace(/.png/g,""),t=t.replace(/.swf/g,""),t=t.replace(/.pdf/g,"")}},{key:"_docPackFullInfo",value:function(e){var t=e,n=this.getDocFullAddress(e);return n.code==d.default.RETURN_SUCCESS?(t.images=n.docFullAddress.images||[],t.pdf=n.docFullAddress.pdf||"",t.html=n.docFullAddress.html||""):(t.images=[],t.pdf="",t.html=""),T.log("docPackFullInfo->",t),t}},{key:"updaterRecordStatus",value:function(e){R.default.isHost&&!R.default.isRecordPlayBack&&R.default.activeDocId>0&&(T.log("开启录制成功->更新当前的文档数据->docId:",R.default.activeDocId,"page:",R.default.activeDocCurPage),this.documentSwitchPage({itemIdx:R.default.activeDocId,curPageNo:R.default.activeDocCurPage}))}},{key:"clearData",value:function(){T.log("clearData->"),this.docList={},R.default.activeDocId=0,R.default.activeDocCurPage=1}},{key:"documentSwitchDoc",value:function(e){if(T.log("切换文档->",e),R.default.isRecordPlayBack)return void T.warn("录制回放状态不允许切换文档");if(null==e||null==e.itemIdx)return T.warn("切换文档失败,参数错误",e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG);if(e.itemIdx==R.default.activeDocId&&0!=R.default.activeDocId)return void T.warn("文档已经显示",e.itemIdx,R.default.activeDocId);var t=void 0;0!=R.default.activeDocId&&(t=this.docList[R.default.activeDocId],t&&(t.action=d.default.DOC_ACTION_NORMAL,t.visible=!1,t.animationStep=1));var n=this.docList[e.itemIdx];return null==n?(T.warn("切换文档失败,文档不存在",e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG)):(n.action=d.default.DOC_ACTION_SWITCH_DOC,n.visible=e.visible||!1,n.animationStep=1,T.log({oldDoc:t,nowDoc:n}),this.updaterDoc(n,n.itemIdx),void(t&&this.updaterDoc(t,t.itemIdx)))}},{key:"documentSwitchPage",value:function(e){T.log("文档翻页->",e);var t=this.docList[e.itemIdx];return null==t?(T.log("文档翻页->文档不存在",e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG)):(t.action=d.default.DOC_ACTION_SWITCH_PAGE,t.curPageNo=parseInt(e.curPageNo)||1,t.animationStep=1,t.curPageNo<1&&(t.curPageNo=1),void this.updaterDoc(t,t.itemIdx))}},{key:"documentSwitchAnimation",value:function(e){T.log("文档页面动画切换->",e);var t=this.docList[R.default.activeDocId];return null==t?(T.log("文档页面动画切换->文档不存在",R.default.activeDocId,e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG)):(t.action=d.default.DOC_ACTION_SWITCH_ANIMATION,t.animationStep=t.animationStep||1,e&&e.step==-1?t.animationStep--:t.animationStep++,(!t.animationStep||t.animationStep<1)&&(t.animationStep=1),void this.updaterDoc(t,t.itemIdx))}},{key:"documentSwitchShowModel",value:function(e){T.log("文档切换显示模式",e);var t=this.docList[e.itemIdx];return null==t?(T.log("文档切换显示模式->文档不存在",e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG)):(t.action=d.default.DOC_ACTION_SWITCH_PAGE,t.curPageNo=parseInt(e.curPageNo)||1,t.curPageNo<1&&(t.curPageNo=1),void this.updaterDoc(t,t.itemIdx))}},{key:"documentCommand",value:function(e){var t=this.docList[e.itemIdx];return null==t?(T.log("documentCommand失败,文档不存在",e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG)):(t.action=d.default.DOC_ACTION_COMMAND,t.showType=parseInt(e.showType)||0,void this.updaterDoc(t,t.itemIdx))}},{key:"documentDeleteAll",value:function(e){for(var t in this.docList)T.log("删除文档数据->itemIdx:"+t),this.documentDelete({itemIdx:t})}},{key:"documentDelete",value:function(e){var t=new h.default.RCRegistryTableDeleteItemPdu;t.type=h.default.RCPDU_REG_TABLE_DELETE_PDU,t.itemIdx=parseInt(e.itemIdx);var n=new h.default.RCRegistryUpdateObjPdu;n.objId=d.default.DOCSHARING_OBJ_TABLE_ID,n.subType=t.type,n.userData=t.toArrayBuffer();var r=new h.default.RCAdapterItemPdu;r.type=h.default.RCPDU_REG_UPDATE_OBJ,r.itemData=n.toArrayBuffer();var i=new h.default.RCAdapterPdu;i.type=h.default.RCPDU_REG_ADAPTER,i.item.push(r),T.log("文档发送删除数据=============>"+t.itemIdx),this.sendUniform(i,!0)}},{key:"tableInsertHandler",value:function(e,t,n){}},{key:"tableInsertApeHandler",value:function(e,t){var n=e,r=n.length;T.log("添加文档->","activeDocId->",R.default.activeDocId,"tableUpdateItemsLen->",r);for(var i=0;i<r;++i){var a=n[i],o=this.unPackPdu(a.owner,a.itemIdx,a.itemData);if(o){this.docList[a.itemIdx]=o,"true"!=o.visible&&1!=o.visible||(R.default.activeDocId=o.itemIdx,R.default.activeDocCurPage=o.curPageNo,T.log("添加文档->设置当前激活的文档id"));var s=this._docPackFullInfo(o);this._emit(g.default.DOC_UPDATE,s)}}this._showDefaultDoc()}},{key:"tableDeleteHandler",value:function(e,t){if(T.log("删除文档数据->",e,t),t&&t.itemIdx)for(var n=t.itemIdx.length,r=t.itemIdx,i=0;i<n;i++)if(this.docList[r[i]]){T.log("删除文档数据:",r[i]);var a=this.docList[r[i]];!a||"true"!=a.visible&&1!=a.visible||(R.default.activeDocId=0,R.default.activeDocCurPage=1,T.log("删除文档数据->清除当前显示的文档")),this._emit(g.default.DOC_DELETE,{itemIdx:r[i]}),delete this.docList[r[i]]}}},{key:"tableUpdateHandler",value:function(e,t,n){}},{key:"tableUpdateApeHandler",value:function(e,t){var n=e.length;T.log("更新文档->","activeDocId->",R.default.activeDocId,"更新的数量->",n);for(var r=0;r<n;++r){var i=e[r],a=this.unPackPdu(i.owner,i.itemIdx,i.itemData);if(null!=a){this.docList[i.itemIdx]=a,!a||"true"!=a.visible&&1!=a.visible||(R.default.activeDocId=a.itemIdx, +R.default.activeDocCurPage=a.curPageNo,T.log("更新文档->设置当前激活的文档id->",R.default.activeDocId,"curPageNum->",R.default.activeDocCurPage));var o=this._docPackFullInfo(a);this._emit(g.default.DOC_UPDATE,o)}else T.log("更新文档-> 数据无效--> itemIdx",C)}this._showDefaultDoc()}},{key:"_showDefaultDoc",value:function(){if(!(R.default.isRecordPlayBack||!R.default.isHost||R.default.activeDocId>0)){var e=void 0;for(var t in this.docList)if(e=this.docList[t]){T.log("选择一个文档作为默认文档显示->",e);var n={itemIdx:e.itemIdx,visible:!0};return void this.documentSwitchDoc(n)}}}},{key:"onJoinChannelHandlerSuccess",value:function(){var e=this;T.log(this._session_name+" onJoinChannelHandlerSuccess==========================="),this._apeDelayed?setTimeout(function(){e._emit(t.DOC_JOIN_CHANNEL_SUCCESS)},R.default.mcuDelay+R.default.docDelay||12e3+R.default.docDelay):setTimeout(function(){e._emit(t.DOC_JOIN_CHANNEL_SUCCESS)},R.default.docDelay)}},{key:"checkDocId",value:function(e){if(null==e)return T.warn("查找文档->失败->参数为null"),!0;for(var t in this.docList){var n=this.docList[t];if(n&&n.docId==e)return T.log("查找文档->已经存在->",e),!0}return T.log("查找文档->没有查找到文档->",e),!1}},{key:"packPdu",value:function(e,t){if(T.log("文档->packPdu"),null==e||null==t)return this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),null;var n=new h.default.RCDocSendDataModelPdu;return n.itemIdx=t,n.owner=R.default.nodeId,n.from=R.default.nodeId,n.curPageNo=e.curPageNo||1,n.pageNum=e.pageNum||1,n.fileType=e.fileType||"",n.creatUserId=e.creatUserId||"0",n.url=e.url||"",n.relativeUrl=e.relativeUrl||"",n.curV=e.curV||0,n.curH=e.curH||0,n.scale=e.scale||100,n.visible=e.visible||!1,n.action=e.action||d.default.DOC_ACTION_NORMAL,n.docId=e.docId||"",n.md5=e.md5||"",n.fileName=e.fileName||"doc_"+t,n.dynamicTS=e.dynamicTS||"0",n.showType=e.showType||0,n.animationStep=e.animationStep||1,n}},{key:"unPackPdu",value:function(e,t,n){if(null==e||null==t||null==n)return this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),null;try{var r=h.default.RCDocSendDataModelPdu.decode(n);return T.log("文档===>unPackPdu"),r}catch(e){T.log("文档===>unPackPdu->Pdu解析错误->itemIdx="+t+"->err:"+e.message)}return null}}]),t}(l.default);S.prototype.DOC_JOIN_CHANNEL_SUCCESS=S.DOC_JOIN_CHANNEL_SUCCESS="docServer.join.channel.success";var I=S;t.default=I;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(T,"loger","D:/work/McuClient/src/apes/DocApe.js"),__REACT_HOT_LOADER__.register(C,"itemIdx","D:/work/McuClient/src/apes/DocApe.js"),__REACT_HOT_LOADER__.register(S,"DocApe","D:/work/McuClient/src/apes/DocApe.js"),__REACT_HOT_LOADER__.register(I,"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 a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=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(8),l=r(u),f=n(2),d=r(f),c=n(6),h=r(c),p=n(1),_=r(p),E=n(3),g=r(E),y=n(5),R=r(y),m=n(4),v=r(m),T=n(21),C=r(T),S=_.default.getLoger("VideoApe"),I=function(e){function t(){i(this,t);var e=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,d.default.VIDEO_SESSION_ID,d.default.VIDEO_SESSION_NAME,d.default.VIDEO_SESSION_TAG));return e.mediaModule=new C.default,e.mediaModule.MEDIA_OBJ_TABLE_ID=d.default.VIDEO_OBJ_TABLE_ID,e.mediaModule.mediaChannels={},e.mediaModule.mediaType=d.default.MEDIA_TYPE_VIDEO,e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(h.default.RCPDU_REG_REGISTER_TABLE,d.default.VIDEO_OBJ_TABLE_ID,d.default.VIDEO_OBJ_TABLE_NAME,d.default.VIDEO_OBJ_TABLE_TAG,0,new ArrayBuffer),e.on(h.default.RCPDU_SEND_VIDEO_DATA_REQUEST,e.receiveVideoCommandHandler.bind(e)),e}return o(t,e),s(t,[{key:"onJoinChannelHandlerSuccess",value:function(){this.mediaModule.maxMediaChannel=R.default.maxVideoChannels}},{key:"getPlayVideoPath",value:function(e){return S.log("getPlayVideoPath"),this.mediaModule.getMediaPlayPath(e)}},{key:"getPublishVideoPath",value:function(e){if(S.log("获取推流地址->"),!this.mcu.connected)return S.warn(R.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};var t=0,n=C.default.allMediaChannelsList;for(var r in n){var i=n[r];i&&i.status==d.default.CHANNEL_STATUS_OPENING&&t++}if(t>=R.default.maxMediaChannels)return S.warn("不能再打开设备->当前开启的设备数量->",t),{code:d.default.RETURN_FAILED,data:"不能再打开设备,当前开启的设备数量"};var a=this.mediaModule.getMediaPublishPath(e);return this._emit(g.default.VIDEO_GET_PUBLISH_PATH,a),a}},{key:"getAllChannelInfo",value:function(e){return S.log("获取当前所有频道信息->"),this.mediaModule.getAllMediaChannelInfo()}},{key:"publishVideo",value:function(e){if(!this.mcu.connected)return S.warn(R.default.getCurrentStatus()),this._emit(g.default.VIDEO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"已经断开连接!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"已经断开连接"};if(null==e||null==e.publishUrl)return S.warn("推流->参数错误",e),this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),this._emit(g.default.VIDEO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"参数错误!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"参数错误"};var t=this.mediaModule.getNeedPublishMediaChannel(e.publishUrl);if(null==t)return S.warn("推流->推流数据已经无效",e),this._emit(g.default.VIDEO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"推流数据已经无效!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"推流数据已经无效"};var n=this.mediaModule.getFreeMediaChannel();if(0==n)return S.warn("推流->不能再打开更多的设备 "),this._emit(g.default.VIDEO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"不能再打开更多的设备!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"不能再打开更多的设备",mediaChannels:this.mediaModule.mediaChannels};if(this.mediaModule.checkChannelIsOpening(t.channelId))return t.nodeId==R.default.nodeId?(S.warn(t.channelId,"已经推送过消息,不需要再次推送"),this._emit(g.default.VIDEO_PUBLISH_RESULT,{code:d.default.RETURN_SUCCESS,data:"已经推送过消息,不需要再次推送!",mediaId:t.channelId}),{code:d.default.RETURN_SUCCESS,data:"已经推送过消息,不需要再次推送!",mediaId:t.channelId}):(S.warn(t.channelId,"频道已经被占用"),this._emit(g.default.VIDEO_PUBLISH_RESULT,{code:d.default.RETURN_FAILED,data:"频道已经被占用!",mediaId:0}),{code:d.default.RETURN_FAILED,data:"频道已经被占用!",mediaChannels:this.mediaModule.mediaChannels});var r=this.mediaModule.getDefaultChannelInfo();return r.owner=R.default.nodeId,r.status=d.default.CHANNEL_STATUS_OPENING,r.channelId=t.channelId,r.streamId=t.streamId,r.timestamp=t.timestamp,r.mediaType=d.default.MEDIA_TYPE_VIDEO,this.sendTableUpdateHandler(r),this._emit(g.default.VIDEO_PUBLISH_RESULT,{code:d.default.RETURN_SUCCESS,data:"推流成功!",mediaId:t.channelId}),{code:d.default.RETURN_SUCCESS,data:"推流成功!",mediaId:t.channelId}}},{key:"stopPublishVideo",value:function(e){if(S.log("停止推流->",e),!this.mcu.connected)return S.warn(R.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};var t=R.default.nodeId;e&&parseInt(e.nodeId)>0&&(t=parseInt(e.nodeId));var n=0;e&&parseInt(e.mediaId)>0&&(n=parseInt(e.mediaId)),n>0?this._releaseChannelForNodeId(t,n):this._releaseNodeIdAllChannel(t)}},{key:"_releaseChannelForNodeId",value:function(e,t){S.log(e,"_releaseChannelForNodeId-->channelId",t);var n=this.mediaModule.mediaChannels[t];if(n&&n.status==d.default.CHANNEL_STATUS_OPENING)if(n.fromNodeId==e){var r=this.mediaModule.getDefaultChannelInfo();r.status=d.default.CHANNEL_STATUS_RELEASED,r.channelId=t,this.sendTableUpdateHandler(r)}else S.warn(t,"不属于nodeId",e,"不能释放",n);else S.warn(e,"要释放的channel不存在或者已经释放-->channelId",n)}},{key:"_releaseNodeIdAllChannel",value:function(e){if(S.log(e,"_releaseNodeIdAllChannel",this.mcu.connected),!this.mcu.connected)return clearTimeout(this.releaseTimeId),S.warn(R.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};var t=this.mediaModule.getOpeningMediaChannel(e);if(0==t)return S.warn(e,"没有占用channel不需要处理"),{code:d.default.RETURN_FAILED,data:"没有占用channel不需要处理"};var n=this.mediaModule.getDefaultChannelInfo();n.status=d.default.CHANNEL_STATUS_RELEASED,n.channelId=t,this.sendTableUpdateHandler(n),this.releaseTimeId=setTimeout(function(){S.warn(e,"检查频道是否占用"),this._releaseNodeIdAllChannel(e)}.bind(this),800)}},{key:"sendVideoBroadcastMsg",value:function(e){if(!this.mcu.connected)return S.warn(R.default.getCurrentStatus()),{code:d.default.RETURN_FAILED,data:"已经断开连接"};if(null===this._classInfo||v.default.isEmptyObject(this._classInfo))return S.log("不能发送Video消息.McuClient还未初始化数据!"),0==R.default.getCurrentStatus().code||1==R.default.getCurrentStatus().code?(this._emit(g.default.MCU_ERROR,g.default.ERR_APE_SEND_FAILED_NO_JOIN),{code:1,data:"不能发送Video消息.McuClient还未初始化数据"}):{code:d.default.RETURN_FAILED,data:"不能发送Video消息.McuClient还未初始化数据"};if(null==e)return S.warn("sendVideoCommandMsg失败,参数错误",e),this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),{code:d.default.RETURN_FAILED,data:"sendVideoCommandMsg失败,参数错误"};if(S.log("发送Video消息.",e),null!=e.actionType&&e.actionType==d.default.MEDIA_ACTION_OPEN_CAMERA){var t=this.mediaModule.getFreeMediaChannel();if(0==t)return S.warn("sendVideoCommandMsg,不能再打开更多的设备",e),{code:d.default.RETURN_FAILED,data:"不能再打开更多的设备",mediaChannels:this.mediaModule.mediaChannels}}var n=new h.default.RCVideoSendDataRequestPdu;n.type=h.default.RCPDU_SEND_VIDEO_DATA_REQUEST,n.isPublic=!0,n.fromNodeId=R.default.nodeId,n.toNodeId=parseInt(e.toNodeId)||0,n.actionType=parseInt(e.actionType)||d.default.MEDIA_ACTION_DEFAULT;var r="";try{r=JSON.stringify(e.data)}catch(t){S.warn("控制消息->JSON转换失败"),r=e.data}return n.data=this._rCArrayBufferUtil.strToUint8Array("h5"+r),n.isPublic||0==n.toNodeId?this.sendChatUniform(n):this.send(n),{code:d.default.RETURN_SUCCESS,data:""}}},{key:"sendTableUpdateHandler",value:function(e){S.log("video===sendTableUpdateHandler ");var t=this.packPdu(e,e.channelId);if(null==t)return void S.warn("sendTableUpdateHandler error,updateModelPdu=null");var n=new h.default.RCRegistryTableItemPdu;n.itemIdx=e.channelId,n.owner=e.owner,n.itemData=t.toArrayBuffer();var r=new h.default.RCRegistryTableUpdateItemPdu;r.type=h.default.RCPDU_REG_TABLE_UPDATE_PDU,r.items.push(n);var i=new h.default.RCRegistryUpdateObjPdu;i.objId=d.default.VIDEO_OBJ_TABLE_ID,i.subType=r.type,i.userData=r.toArrayBuffer();var a=new h.default.RCAdapterItemPdu;a.type=h.default.RCPDU_REG_UPDATE_OBJ,a.itemData=i.toArrayBuffer();var o=new h.default.RCAdapterPdu;o.type=h.default.RCPDU_REG_ADAPTER,o.item.push(a),S.log("发送更新VIDEO.itemIdx="+n.itemIdx),this.sendUniform(o,!0)}},{key:"receiveVideoCommandHandler",value:function(e){var t=h.default.RCVideoSendDataRequestPdu.decode(e);if(null==t)return void S.warn("视频控制消息处理,收到的消息为null,不做处理");t.data=this._rCArrayBufferUtil.uint8ArrayToStr(t.data,2);var n={};try{n=JSON.parse(t.data)}catch(e){S.warn("控制消息->JSON转换失败"),n=t.data}t.data=n,0!=t.toNodeId&&t.toNodeId!=R.default.nodeId?S.log("视频消息不处理 toNodeId=",t.toNodeId,"my nodeId=",R.default.nodeId):(S.log("视频控制消息处理 .",t),this._emit(g.default.VIDEO_BROADCAST,t))}},{key:"tableUpdateHandler",value:function(e,t,n,r){var i=this.unPackPdu(e,t,n);if(S.log("tableUpdateHandler->channel",t,"status->",i.status,"seek->",r),0==e&&(S.log("释放占用的频道,channel",t),i.status=d.default.CHANNEL_STATUS_RELEASED,i.streamId=""),this.mediaModule.mediaChannels[t]=i,i&&i.fromNodeId!=R.default.nodeId){var a={};if(a.mediaId=i.channelId,a.fromNodeId=i.fromNodeId,a.userName=i.userName||"",a.userRole=i.userRole||d.default.normal,i.status==d.default.CHANNEL_STATUS_OPENING){a.m3u8Url="",a.rtmpUrl="",a.replay="",a.seek=r||0;var o=this.mediaModule.getMediaPlayPath({type:"m3u8",streamId:i.streamId}),s=this.mediaModule.getMediaPlayPath({type:"rtmp",streamId:i.streamId}),u=this.mediaModule.getMediaRecordPlaybackPath({type:"m3u8",streamId:i.streamId});0==o.code&&(a.m3u8Url=o.playUrl),0==s.code&&(a.rtmpUrl=s.playUrl),0==u.code&&(a.replay=u.playUrl),S.log("VIDEO_PLAY",a),this._emit(g.default.VIDEO_PLAY,a)}else S.log("VIDEO_STOP",a),this._emit(g.default.VIDEO_STOP,a)}else S.warn("视频消息是自己发送的或者是视频消息无效,不需要处理,消息内容如下:"),S.log(i),i.status==d.default.CHANNEL_STATUS_OPENING?(R.default.openCamera=v.default.creatTimestamp(),R.default.openMicrophones=R.default.openCamera):(R.default.openCamera=0,R.default.openMicrophones=0),this._emit(g.default.USER_DEVICE_STATUS_CHAANGE,{nodeId:R.default.nodeId,userRole:R.default.userRole,userName:R.default.userName,userId:R.default.userId,openCamera:R.default.openCamera,openMicrophones:R.default.openMicrophones});C.default.allMediaChannelsList[t]=i,console.log("MediaModule.allMediaChannelsList",C.default.allMediaChannelsList),this._emit(g.default.VIDEO_UPDATE,i)}},{key:"packPdu",value:function(e,t){if(S.log("packPdu "),null==e||null==t)return this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),null;var n=new h.default.RCVideoChannelInfoPdu;return n.status=e.status||d.default.CHANNEL_STATUS_RELEASED,n.channelId=t,n.streamId=e.streamId||"",n.siteId=e.siteId||R.default.siteId,n.classId=parseInt(e.classId)||parseInt(R.default.classId),n.userId=e.userId||"0",n.mediaType=e.mediaType||d.default.MEDIA_TYPE_VIDEO,n.timestamp=e.timestamp||0,n.fromNodeId=R.default.nodeId,n.userName=R.default.userName||"",n.toNodeId=0,n.userRole=R.default.userRole||d.default.normal,S.log(n),n}},{key:"unPackPdu",value:function(e,t,n){if(S.log("unPackPdu->owner:",e,"itemIdx->",t),null==e||null==t||null==n)return this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),null;try{var r=h.default.RCVideoChannelInfoPdu.decode(n);return S.log(r),r}catch(e){S.log("unPackPdu error,itemIdx="+t+" err:"+e.message)}return null}}]),t}(l.default),A=I;t.default=A;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(S,"loger","D:/work/McuClient/src/apes/VideoApe.js"),__REACT_HOT_LOADER__.register(I,"VideoApe","D:/work/McuClient/src/apes/VideoApe.js"),__REACT_HOT_LOADER__.register(A,"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 a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=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(8),l=r(u),f=n(2),d=r(f),c=n(6),h=r(c),p=n(1),_=r(p),E=n(3),g=r(E),y=(n(31),n(14)),R=(r(y),n(5)),m=r(R),v=n(4),T=r(v),C=_.default.getLoger("WhiteBoardApe"),S=0,I=0,A=1,b=2,w=3,D=4,P=function(e){function t(){i(this,t);var e=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,d.default.WHITEBOARD_SESSION_ID,d.default.WHITEBOARD_SESSION_NAME,d.default.WHITEBOARD_SESSION_TAG));return e.annoInfos={},e.insertHistory=[],e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(h.default.RCPDU_REG_REGISTER_TABLE,d.default.WHITEBOARD_OBJ_TABLE_ID,d.default.WHITEBOARD_OBJ_TABLE_NAME,d.default.WHITEBOARD_OBJ_TABLE_TAG,0,new ArrayBuffer),e.on(h.default.RCPDU_SESSION_JOIN_RESPONSE,e._joinSessionHandler.bind(e)),e}return o(t,e),s(t,[{key:"_joinSessionHandler",value:function(e){C.log("RCPDU_SESSION_JOIN_RESPONSE"),this.insertHistory=[]}},{key:"clearData",value:function(){C.log("clearData->"),this.annoInfos={},this.insertHistory=[]}},{key:"updaterRecordStatus",value:function(e){if(m.default.isHost&&!m.default.isRecordPlayBack){var t={};for(var n in this.annoInfos){var r=this.annoInfos[n];r&&r.parentId==m.default.activeDocId&&r.curPageNo==m.default.activeDocCurPage&&(t[n]=r)}Object.keys(t).length>0?(C.log("开启录制成功->更新当前的标注数据->docId:",m.default.activeDocId,"page:",m.default.activeDocCurPage),this.sendUpdaterAnnotaion({itemIdxArr:t})):C.log("开启录制成功->当前没有标注数据需要更新->docId:",m.default.activeDocId,"page:",m.default.activeDocCurPage)}}},{key:"sendInsetAnnotaion",value:function(e){if(null==e||T.default.isEmptyObject(e))return C.warn("添加标注失败->参数错误->",e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG);S=T.default.creatSoleNumberFromTimestamp();var t=this.packPdu(e,S);if(null==t)return C.warn("添加标注失败-->参数错误->",e),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG);this.insertHistory.push(t);var n=new h.default.RCRegistryTableItemPdu;n.itemIdx=S,n.registerObjId=d.default.WHITEBOARD_OBJ_TABLE_ID,n.owner=0,n.itemData=t.toArrayBuffer();var r=new h.default.RCRegistryTableInsertItemPdu;r.type=h.default.RCPDU_REG_TABLE_INSERT_PDU,r.items.push(n);var i=new h.default.RCRegistryUpdateObjPdu;i.objId=d.default.WHITEBOARD_OBJ_TABLE_ID,i.subType=r.type,i.userData=r.toArrayBuffer();var a=new h.default.RCAdapterItemPdu;a.type=h.default.RCPDU_REG_UPDATE_OBJ,a.itemData=i.toArrayBuffer();var o=new h.default.RCAdapterPdu;o.type=h.default.RCPDU_REG_ADAPTER,o.item.push(a),C.log("添加标注->itemIdx="+n.itemIdx),this.sendUniform(o,!0)}},{key:"sendGotoPrev",value:function(){if(C.log("撤销上一步"),null==this.insertHistory||this.insertHistory.length<1)return void C.warn("无法继续上一步操作,已经没有可以撤销的数据");var e=this.insertHistory.pop();if(e){var t={};t[e.itemIdx]=e,this.sendDeleteAnnotaion({itemIdxArr:t})}}},{key:"sendDeleteCurPageAnnotation",value:function(e){this.insertHistory=[];var t={};for(var n in this.annoInfos){var r=this.annoInfos[n];r&&r.parentId==m.default.activeDocId&&r.curPageNo==m.default.activeDocCurPage&&(t[n]=r)}this.sendDeleteAnnotaion({itemIdxArr:t})}},{key:"sendDeleteAllAnnotation",value:function(e){this.insertHistory=[],this.sendDeleteAnnotaion({itemIdxArr:this.annoInfos})}},{key:"sendDeleteAnnotaion",value:function(e){if(null==e||null==e.itemIdxArr)return void C.warn("要删除的数据不存在->",e);var t=new h.default.RCAdapterPdu;t.type=h.default.RCPDU_REG_ADAPTER;for(var n in e.itemIdxArr){var r=new h.default.RCRegistryTableDeleteItemPdu;r.type=h.default.RCPDU_REG_TABLE_DELETE_PDU,r.itemIdx=parseInt(n);var i=new h.default.RCRegistryUpdateObjPdu;i.objId=d.default.WHITEBOARD_OBJ_TABLE_ID,i.subType=r.type,i.userData=r.toArrayBuffer();var a=new h.default.RCAdapterItemPdu;a.type=h.default.RCPDU_REG_UPDATE_OBJ,a.itemData=i.toArrayBuffer(),t.item.push(a)}C.log("发送删除白板标注数据->长度:"+t.item.length),this.sendUniform(t,!0)}},{key:"sendUpdaterAnnotaion",value:function(e){if(null==e||null==e.itemIdxArr)return C.log("更新标注数据->失败->参数错误"),void this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG);var t=new h.default.RCAdapterPdu;t.type=h.default.RCPDU_REG_ADAPTER;for(var n in e.itemIdxArr){var r=parseInt(n),i=e.itemIdxArr[n],a=this.packPdu(i,r);if(null!=a){var o=new h.default.RCRegistryTableItemPdu;o.itemIdx=r,o.owner=0,o.registerObjId=d.default.WHITEBOARD_OBJ_TABLE_ID,o.itemData=a.toArrayBuffer();var s=new h.default.RCRegistryTableUpdateItemPdu;s.type=h.default.RCPDU_REG_TABLE_UPDATE_PDU,s.items.push(o);var u=new h.default.RCRegistryUpdateObjPdu;u.objId=d.default.WHITEBOARD_OBJ_TABLE_ID,u.subType=s.type,u.userData=s.toArrayBuffer();var l=new h.default.RCAdapterItemPdu;l.type=h.default.RCPDU_REG_UPDATE_OBJ,l.itemData=u.toArrayBuffer(),t.item.push(l)}else C.log("更新标注数据->失败->数据无效"),this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG)}var f=t.item.length;f>0?(C.log("更新标注数据->发送数量->",t.item.length),this.sendUniform(t,!0)):C.log("更新标注数据->没有可更新的数据")}},{key:"tableInsertHandler",value:function(e,t,n){var r=this.unPackPdu(e,t,n);C.log("tableInsertHandler","activeDocId->",m.default.activeDocId,"parentId->",r.parentId),C.log(r),r&&m.default.activeDocId==r.parentId&&m.default.activeDocCurPage==r.curPageNo&&this.insertAandShowAnnotaion(r)}},{key:"tableUpdateHandler",value:function(e,t,n){}},{key:"tableUpdateApeHandler",value:function(e,t){var n=e.length;C.log("白板标注更新->","activeDocId->",m.default.activeDocId,"数量->",n);for(var r=0;r<n;++r){var i=e[r];this.unPackPdu(i.owner,i.itemIdx,i.itemData)}this.updateAandShowAnnotaion()}},{key:"tableDeleteHandler",value:function(e,t){if(C.log("删除白板数据->",e,t),t&&t.itemIdx)for(var n=t.itemIdx.length,r=t.itemIdx,i=0;i<n;i++)this.annoInfos[r[i]]&&(C.log("删除白板数据:",r[i]),delete this.annoInfos[r[i]]);this.updateAandShowAnnotaion()}},{key:"docUpdateHandler",value:function(e){C.log("白板收到文档更新的消息"),e.action!=d.default.DOC_ACTION_SWITCH_DOC&&e.action!=d.default.DOC_ACTION_SWITCH_PAGE||(this.insertHistory=[]),this.updateAandShowAnnotaion()}},{key:"docDeleteHandler",value:function(e){C.log("白板收到文档删除的消息->",e);for(var t in this.annoInfos){var n=this.annoInfos[t];n&&n.parentId==e&&(C.log("文档删除->白板数据也删除,itemIdx:"+t,"_parentId:",e),this.sendDeleteAnnotaion({itemIdx:t}))}0==m.default.activeDocId&&(this.insertHistory=[],this.updateAandShowAnnotaion())}},{key:"insertAandShowAnnotaion",value:function(e){var t=[e],n={isFresh:!1,annotaionItems:t};C.log("新增一条标注数据->显示到界面"),this._emit(g.default.WHITEBOARD_ANNOTATION_UPDATE,n)}},{key:"updateAandShowAnnotaion",value:function(){var e=[];for(var t in this.annoInfos){var n=this.annoInfos[t];n&&n.parentId==m.default.activeDocId&&n.curPageNo==m.default.activeDocCurPage&&e.push(n)}var r={isFresh:!0,annotaionItems:e};C.log("清除当前显示的标注---->重绘标注数量--->",e.length,"当前文档信息--->DocId->",m.default.activeDocId,"curPageNo->",m.default.activeDocCurPage),this._emit(g.default.WHITEBOARD_ANNOTATION_UPDATE,r)}},{key:"packPdu",value:function(e,t){if(null==e.pointGroup||e.pointGroup.length<1)return this._emit(g.default.MCU_ERROR,g.default.ERR_APE_INTERFACE_PARAM_WRONG),null;var n=new h.default.RCWhiteBoardDataModelPdu;switch(e.type){case I:break;case A:break;case b:break;case w:n.radius=parseInt(e.radius);break;case D:n.fontSize=parseInt(e.fontSize),n.fontName=e.fontName||null,n.text=e.text||null;break;default:return null}return n.type=e.type,n.itemIdx=t,n.initiator=m.default.nodeId,n.parentId=m.default.activeDocId,n.curPageNo=m.default.activeDocCurPage,n.pointGroup=T.default.arrayToJsonString(e.pointGroup),n.color=e.color||"#000000",n.thickness=e.thickness||1,n}},{key:"unPackPdu",value:function(e,t,n){try{C.log("白板标注数据->unPackPdu");var r=h.default.RCWhiteBoardDataModelPdu.decode(n),i=T.default.arrayFromJsonString(r.pointGroup);return r.pointGroup=i,this.annoInfos[t]=r,r}catch(e){C.log("白板标注数据->unPackPdu->Pdu解析错误,itemIdx="+t+" err:"+e.message)}return null}}]),t}(l.default),O=P;t.default=O;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(C,"loger","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(S,"itemIdx","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(I,"TYPE_BIGHT","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(A,"TYPE_LINE","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(b,"TYPE_RECT","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(w,"TYPE_CIRCLE","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(D,"TYPE_TEXT","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(P,"WhiteBoardApe","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(O,"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")}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}}(),o=n(1),s=r(o),u=n(2),l=(r(u),n(4)),f=(r(l),s.default.getLoger("Server")),d=function(){function e(){i(this,e)}return a(e,null,[{key:"serverList",get:function(){return{MS:{},MCU:{}}}}]),e}(),c=d;t.default=c;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(f,"loger","D:/work/McuClient/src/config/Server.js"),__REACT_HOT_LOADER__.register(d,"Server","D:/work/McuClient/src/config/Server.js"),__REACT_HOT_LOADER__.register(c,"default","D:/work/McuClient/src/config/Server.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 a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=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(7),l=r(u),f=n(1),d=r(f),c=d.default.getLoger("EverSocket"),h=4,p=function(e){function t(){i(this,t);var e=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._connected=!1,e._lastActiveTime=0,e._enableEverSocket=!1,e.reConnectionCounter=0,e}return o(t,e),s(t,[{key:"begin",value:function(e,t){this._clearHistory(),c.log("开始WebSocket应用."),this._enableEverSocket=!0,this.wsURL="ws://"+e+":"+t,this._newConnection()}},{key:"end",value:function(){c.log("停止WebSocket应用."),this._clear()}},{key:"switchSocketIp",value:function(e,t){t?this.wsURL="ws://"+e+":"+t:this.wsURL="ws://"+e}},{key:"send",value:function(e){this._connected?(e?c.log("SEND MESSAGE-->byteLength->",e.byteLength):c.log("SEND MESSAGE---->"),this.websocket.send(e)):c.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(),window.clearTimeout(this.reConnectionTimeout),this.reConnectionCounter++,this.reConnectionCounter>h&&(c.warn("MCU断线重连->已经达到最大重连次数!"),this._emit(t.ERROR,t.ERR_SOCKET_RECONNECT_FAILED),this.reConnectionCounter=0),this.reConnectionTimeout=window.setTimeout(function(){c.log("MCU断线重连->",e.reConnectionCounter),window.clearTimeout(e.reConnectionTimeout),e._newConnection()},t.RECONN_INTERVAL)}},{key:"_clear",value:function(){if(c.log("WebSocket,Timers销毁"),window.clearInterval(this.pingTimer),window.clearInterval(this.pongTimer),window.clearInterval(this.reConnectionTimeout),this._setConnected(!1),this._enableEverSocket=!1,null==this.websocket)return void c.log("WebSocket,Timers已经销毁");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){c.log("ignore errors")}this.websocket=void 0}},{key:"_clearHistory",value:function(){if(c.log("WebSocket->清除记录"),window.clearInterval(this.pingTimer),window.clearInterval(this.pongTimer),window.clearInterval(this.reConnectionTimeout),this._connected=!1,this._enableEverSocket=!1,null==this.websocket)return void c.log("WebSocket->已经销毁");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){c.log("ignore errors")}this.websocket=void 0}},{key:"_onOpen",value:function(){c.log("WebSocket建立成功",this.wsURL),this.reConnectionCounter=0,this.pingTimer=window.setInterval(this._sendPingHandler.bind(this),t.PING_INTERVAL),this.pongTimer=window.setInterval(this._checkPongHandler.bind(this),t.PONG_INTERVAL),this._setConnected()}},{key:"_onClose",value:function(e){c.log("WebSocket连接断开 CODE:"+e.code+" REASON:"+e.reason+" CLEAN: "+e.wasClean,this.wsURL),this._reConnection()}},{key:"_onError",value:function(){c.log("WebSocket错误出现"),this._connected=!1,this._reConnection()}},{key:"_onMessage",value:function(e){this._lastActiveTime=Date.now();var n=e.data;c.log("RECEIVE MESSAGE-->byteLength->",n.byteLength),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||(c.warn("---服务器PINGPONG超时-----"),this._reConnection())}},{key:"connected",get:function(){return this._connected}}]),t}(l.default);p.prototype.PONG_INTERVAL=p.PONG_INTERVAL=21e3,p.prototype.PING_INTERVAL=p.PING_INTERVAL=1e4,p.prototype.RECONN_INTERVAL=p.RECONN_INTERVAL=5e3,p.prototype.ERR_SOCKET_RECONNECT_FAILED=p.ERR_SOCKET_RECONNECT_FAILED=20001,p.prototype.CONNECTING=p.CONNECTING=0,p.prototype.OPEN=p.OPEN=1,p.prototype.CLOSING=p.CLOSING=2,p.prototype.CLOSED=p.CLOSED=3,p.prototype.MESSAGE=p.MESSAGE=4,p.prototype.ERROR=p.ERROR=5;var _=new p;t.default=_;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(c,"loger","D:/work/McuClient/src/everSocket.js"),__REACT_HOT_LOADER__.register(h,"MCU_MAX_RECONNECTION","D:/work/McuClient/src/everSocket.js"),__REACT_HOT_LOADER__.register(p,"EverSocket","D:/work/McuClient/src/everSocket.js"),__REACT_HOT_LOADER__.register(_,"default","D:/work/McuClient/src/everSocket.js"))})()},function(e,t,n){var r,i,a,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(o,s){i=[n(16)],r=s,a="function"==typeof r?r.apply(t,i):r,!(void 0!==a&&(e.exports=a))}(void 0,function(e){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("")+l.apply(String,e):(1024<e.length+arguments.length&&(t.push(l.apply(String,e)),e.length=0),void Array.prototype.push.apply(e,arguments))}}function r(e,t,n,r,i){var a;a=8*i-r-1;var o=(1<<a)-1,s=o>>1,u=-7;i=n?i-1:0;var l=n?-1:1,f=e[t+i];for(i+=l,n=f&(1<<-u)-1,f>>=-u,u+=a;0<u;n=256*n+e[t+i],i+=l,u-=8);for(a=n&(1<<-u)-1,n>>=-u,u+=r;0<u;a=256*a+e[t+i],i+=l,u-=8);if(0===n)n=1-s;else{if(n===o)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),n-=s}return(f?-1:1)*a*Math.pow(2,n-r)}function i(e,t,n,r,i,a){var o,s=8*a-i-1,u=(1<<s)-1,l=u>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0;a=r?0:a-1;var d=r?1:-1,c=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(t=isNaN(t)?1:0,r=u):(r=Math.floor(Math.log(t)/Math.LN2), +1>t*(o=Math.pow(2,-r))&&(r--,o*=2),t=1<=r+l?t+f/o:t+f*Math.pow(2,1-l),2<=t*o&&(r++,o/=2),r+l>=u?(t=0,r=u):1<=r+l?(t=(t*o-1)*Math.pow(2,i),r+=l):(t=t*Math.pow(2,l-1)*Math.pow(2,i),r=0));8<=i;e[n+a]=255&t,a+=d,t/=256,i-=8);for(r=r<<i|t,s+=i;0<s;e[n+a]=255&r,a+=d,r/=256,s-=8);e[n+a-d]|=128*c}var a=function e(t,n,r){if("undefined"==typeof t&&(t=e.DEFAULT_CAPACITY),"undefined"==typeof n&&(n=e.DEFAULT_ENDIAN),"undefined"==typeof r&&(r=e.DEFAULT_NOASSERT),!r){if(t|=0,0>t)throw RangeError("Illegal capacity");n=!!n,r=!!r}this.buffer=0===t?u:new ArrayBuffer(t),this.view=0===t?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=t,this.littleEndian=n,this.noAssert=r};a.VERSION="5.0.1",a.LITTLE_ENDIAN=!0,a.BIG_ENDIAN=!1,a.DEFAULT_CAPACITY=16,a.DEFAULT_ENDIAN=a.BIG_ENDIAN,a.DEFAULT_NOASSERT=!1,a.Long=e||null;var s=a.prototype;Object.defineProperty(s,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var u=new ArrayBuffer(0),l=String.fromCharCode;a.accessor=function(){return Uint8Array},a.allocate=function(e,t,n){return new a(e,t,n)},a.concat=function(e,t,n,r){"boolean"!=typeof t&&"string"==typeof t||(r=n,n=t,t=void 0);for(var i,o=0,s=0,u=e.length;s<u;++s)a.isByteBuffer(e[s])||(e[s]=a.wrap(e[s],t)),i=e[s].limit-e[s].offset,0<i&&(o+=i);if(0===o)return new a(0,n,r);for(t=new a(o,n,r),s=0;s<u;)n=e[s++],i=n.limit-n.offset,0>=i||(t.view.set(n.view.subarray(n.offset,n.limit),t.offset),t.offset+=i);return t.limit=t.offset,t.offset=0,t},a.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},a.type=function(){return ArrayBuffer},a.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 a.fromBase64(e,n);case"hex":return a.fromHex(e,n);case"binary":return a.fromBinary(e,n);case"utf8":return a.fromUTF8(e,n);case"debug":return a.fromDebug(e,n);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!==("undefined"==typeof e?"undefined":o(e)))throw TypeError("Illegal buffer");if(a.isByteBuffer(e))return t=s.clone.call(e),t.markedOffset=-1,t;if(e instanceof Uint8Array)t=new a(0,n,r),0<e.length&&(t.buffer=e.buffer,t.offset=e.byteOffset,t.limit=e.byteOffset+e.byteLength,t.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)t=new a(0,n,r),0<e.byteLength&&(t.buffer=e,t.offset=0,t.limit=e.byteLength,t.view=0<e.byteLength?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");for(t=new a(e.length,n,r),t.limit=e.length,n=0;n<e.length;++n)t.view[n]=e[n]}return t},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||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,i=t,a=e.length,o=a>>3,s=0;for(t+=this.writeVarint32(a,t);o--;)r=1&!!e[s++]|(1&!!e[s++])<<1|(1&!!e[s++])<<2|(1&!!e[s++])<<3|(1&!!e[s++])<<4|(1&!!e[s++])<<5|(1&!!e[s++])<<6|(1&!!e[s++])<<7,this.writeByte(r,t++);if(s<a){for(r=o=0;s<a;)r|=(1&!!e[s++])<<o++;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=this.readVarint32(e),r=n.value,i=r>>3,a=0,o=[];for(e+=n.length;i--;)n=this.readByte(e++),o[a++]=!!(1&n),o[a++]=!!(2&n),o[a++]=!!(4&n),o[a++]=!!(8&n),o[a++]=!!(16&n),o[a++]=!!(32&n),o[a++]=!!(64&n),o[a++]=!!(128&n);if(a<r)for(i=0,n=this.readByte(e++);a<r;)o[a++]=!!(n>>i++&1);return t&&(this.offset=e),o},s.readBytes=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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||0!==e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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),this.view[t-1]=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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return e=this.view[e],128===(128&e)&&(e=-(255-e+1)),t&&(this.offset+=1),e},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||0!==e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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),this.view[t-1]=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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return e=this.view[e],t&&(this.offset+=1),e},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||0!==e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||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||0!==e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||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||0!==e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||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),0|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||0!==e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||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||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||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 i=t.low,a=t.high;return 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,n+=4,this.view[n+3]=a>>>24&255,this.view[n+2]=a>>>16&255,this.view[n+1]=a>>>8&255,this.view[n]=255&a):(this.view[n]=a>>>24&255,this.view[n+1]=a>>>16&255,this.view[n+2]=a>>>8&255,this.view[n+3]=255&a,n+=4,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),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||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=0,i=0;return 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),t=new e(r,i,!1),n&&(this.offset+=8),t},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||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||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 i=t.low,a=t.high;return 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,n+=4,this.view[n+3]=a>>>24&255,this.view[n+2]=a>>>16&255,this.view[n+1]=a>>>8&255,this.view[n]=255&a):(this.view[n]=a>>>24&255,this.view[n+1]=a>>>16&255,this.view[n+2]=a>>>8&255,this.view[n+3]=255&a,n+=4,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),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||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=0,i=0;return 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),t=new e(r,i,!0),n&&(this.offset+=8),t},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||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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),i(this.view,e,t-4,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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return e=r(this.view,e,this.littleEndian,23,4),t&&(this.offset+=4),e},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||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||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),i(this.view,e,t-8,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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}return e=r(this.view,e,this.littleEndian,52,8),t&&(this.offset+=8),e},s.readDouble=s.readFloat64,a.MAX_VARINT32_BYTES=5,a.calculateVarint32=function(e){return e>>>=0,128>e?1:16384>e?2:2097152>e?3:268435456>e?4:5},a.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},a.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||0!==e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,i=a.calculateVarint32(e);for(t+=i,r=this.buffer.byteLength,t>r&&this.resize((r*=2)>t?r:t),t-=i,e>>>=0;128<=e;)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(a.zigZagEncode32(e),t)},s.readVarint32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||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)throw e=Error("Truncated"),e.truncated=!0,e;n=this.view[e++],5>r&&(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){return e=this.readVarint32(e),"object"===("undefined"==typeof e?"undefined":o(e))?e.value=a.zigZagDecode32(e.value):e=a.zigZagDecode32(e),e},e&&(a.MAX_VARINT64_BYTES=10,a.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;return t=t.shiftRightUnsigned(56).toInt()>>>0,0==t?0==r?16384>n?128>n?1:2:2097152>n?3:4:16384>r?128>r?5:6:2097152>r?7:8:128>t?9:10},a.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},a.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(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||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||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):!1!==t.unsigned&&(t=t.toSigned());var i=a.calculateVarint64(t),o=t.toInt()>>>0,s=t.shiftRightUnsigned(28).toInt()>>>0,u=t.shiftRightUnsigned(56).toInt()>>>0;n+=i;var l=this.buffer.byteLength;switch(n>l&&this.resize((l*=2)>n?l: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?s>>>21|128:s>>>21&127;case 7:this.view[n+6]=7!==i?s>>>14|128:s>>>14&127;case 6:this.view[n+5]=6!==i?s>>>7|128:s>>>7&127;case 5:this.view[n+4]=5!==i?128|s:127&s;case 4:this.view[n+3]=4!==i?o>>>21|128:o>>>21&127;case 3:this.view[n+2]=3!==i?o>>>14|128:o>>>14&127;case 2:this.view[n+1]=2!==i?o>>>7|128:o>>>7&127;case 1:this.view[n]=1!==i?128|o:127&o}return r?(this.offset+=i,this):i},s.writeVarint64ZigZag=function(e,t){return this.writeVarint64(a.zigZagEncode64(e),t)},s.readVarint64=function(t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||0!==t%1)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,0>t||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r=t,i=0,a=0,o=0,s=0,s=this.view[t++],i=127&s;if(128&s&&(s=this.view[t++],i|=(127&s)<<7,128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],i|=(127&s)<<14,128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],i|=(127&s)<<21,128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],a=127&s,128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],a|=(127&s)<<7,128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],a|=(127&s)<<14,128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],a|=(127&s)<<21,128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],o=127&s,128&s||this.noAssert&&"undefined"==typeof s)&&(s=this.view[t++],o|=(127&s)<<7,128&s||this.noAssert&&"undefined"==typeof s))throw Error("Buffer overrun");return i=e.fromBits(i|a<<28,a>>>4|o<<24,!1),n?(this.offset=t,i):{value:i,length:t-r}},s.readVarint64ZigZag=function(t){return(t=this.readVarint64(t))&&t.value instanceof e?t.value=a.zigZagDecode64(t.value):t=a.zigZagDecode64(t),t}),s.writeCString=function(e,n){var r="undefined"==typeof n;r&&(n=this.offset);var i,a=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(i=0;i<a;++i)if(0===e.charCodeAt(i))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof n||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return a=d.calculateUTF16asUTF8(t(e))[1],n+=a+1,i=this.buffer.byteLength,n>i&&this.resize((i*=2)>n?i:n),n-=a+1,d.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),this.view[n++]=0,r?(this.offset=n,this):a},s.readCString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,i=e,a=-1;return d.decodeUTF8toUTF16(function(){if(0===a)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return a=this.view[e++],0===a?null:a}.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||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,a=n;i=d.calculateUTF16asUTF8(t(e),this.noAssert)[1],n+=4+i;var o=this.buffer.byteLength;if(n>o&&this.resize((o*=2)>n?o: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,d.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==a+4+i)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+4+i));return r?(this.offset=n,this):n-a},s.readIString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=e,r=this.readUint32(e),r=this.readUTF8String(r,a.METRICS_BYTES,e+=4);return e+=r.length,t?(this.offset=e,r.string):{string:r.string,length:e-n}},a.METRICS_CHARS="c",a.METRICS_BYTES="b",s.writeUTF8String=function(e,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,a=n;i=d.calculateUTF16asUTF8(t(e))[1],n+=i;var o=this.buffer.byteLength;return n>o&&this.resize((o*=2)>n?o:n),n-=i,d.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),r?(this.offset=n,this):n-a},s.writeString=s.writeUTF8String,a.calculateUTF8Chars=function(e){return d.calculateUTF16asUTF8(t(e))[0]},a.calculateUTF8Bytes=function(e){return d.calculateUTF16asUTF8(t(e))[1]},a.calculateString=a.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=a.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||0!==e%1)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||0!==r%1)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,0>r||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var o,s=0,u=r;if(t===a.METRICS_CHARS){if(o=n(),d.decodeUTF8(function(){return s<e&&r<this.limit?this.view[r++]:null}.bind(this),function(e){++s,d.UTF8toUTF16(e,o)}),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return i?(this.offset=r,o()):{string:o(),length:r-u}}if(t===a.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||0!==r%1)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,0>r||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}var l=r+e;if(d.decodeUTF8toUTF16(function(){return r<l?this.view[r++]:null}.bind(this),o=n(),this.noAssert),r!==l)throw RangeError("Illegal range: Truncated data, "+r+" == "+l);return i?(this.offset=r,o()):{string:o(),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||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,o,s=n;i=d.calculateUTF16asUTF8(t(e),this.noAssert)[1],o=a.calculateVarint32(i),n+=o+i;var u=this.buffer.byteLength;if(n>u&&this.resize((u*=2)>n?u:n),n-=o+i,n+=this.writeVarint32(i,n),d.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==s+i+o)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+i+o));return r?(this.offset=n,this):n-s},s.readVString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=e,r=this.readVarint32(e),r=this.readUTF8String(r.value,a.METRICS_BYTES,e+=r.length);return e+=r.length,t?(this.offset=e,r.string):{string:r.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||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(e instanceof a||(e=a.wrap(e,t)),t=e.limit-e.offset,0>=t)return this;n+=t;var i=this.buffer.byteLength;return n>i&&this.resize((i*=2)>n?i:n),n-=t,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=t,r&&(this.offset+=t),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 a(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||0!==e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||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=u,this.view=null,0<=this.markedOffset&&(this.markedOffset-=e),this.limit=this.offset=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,0<=this.markedOffset&&(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||0!==e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new a(0,this.littleEndian,this.noAssert);var n=t-e,r=new a(n,this.littleEndian,this.noAssert);return r.offset=0,r.limit=n,0<=r.markedOffset&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},s.copyTo=function(e,t,n,r){var i,o;if(!this.noAssert&&!a.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(o="undefined"==typeof t)?e.offset:0|t,n=(i="undefined"==typeof n)?this.offset:0|n,r="undefined"==typeof r?this.limit:0|r,0>t||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(0>n||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);var s=r-n;return 0===s?e:(e.ensureCapacity(t+s),e.view.set(this.view.subarray(n,r),t),i&&(this.offset+=s),o&&(e.offset+=s),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&&0<e.length&&(e=e.charCodeAt(0)),"undefined"==typeof t&&(t=this.offset),"undefined"==typeof n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||0!==e%1)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||0!==n%1)throw TypeError("Illegal end: Not an integer");if(n>>>=0,0>t||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||0!==e%1)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,0>e||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||0!==n%1)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,0>n||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(e instanceof a||(e=a.wrap(e,t)),t=e.limit-e.offset,0>=t)return this;var i=t-n;if(0<i){var o=new ArrayBuffer(this.buffer.byteLength+i),s=new Uint8Array(o);s.set(this.view.subarray(n,this.buffer.byteLength),t),this.buffer=o,this.view=s,this.offset+=i,0<=this.markedOffset&&(this.markedOffset+=i),this.limit+=i,n+=i}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),n-t),e.offset=e.limit,r&&(this.offset-=t),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 0<=this.markedOffset?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},s.resize=function(e){if(!this.noAssert){if("number"!=typeof e||0!==e%1)throw TypeError("Illegal capacity: "+e+" (not an integer)");if(e|=0,0>e)throw RangeError("Illegal capacity: 0 <= "+e)}if(this.buffer.byteLength<e){e=new ArrayBuffer(e);var t=new Uint8Array(e);t.set(this.view),this.buffer=e,this.view=t}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||0!==e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||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||0!==e%1)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(0>t||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||0!==e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||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||0!==t%1)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof n||0!==n%1)throw TypeError("Illegal limit: Not an integer");if(n>>>=0,0>t||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}return e||0!==t||n!==this.buffer.byteLength?t===n?u:(e=new ArrayBuffer(n-t),new Uint8Array(e).set(new Uint8Array(this.buffer).subarray(t,n),0),e):this.buffer},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&&(n=t=e="utf8"),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,a,o;null!==(i=e());)if(a=n[i],"undefined"==typeof a&&r(i),null!==(i=e())&&(o=n[i],"undefined"==typeof o&&r(i),t(a<<2>>>0|(48&o)>>4),null!==(i=e()))){if(a=n[i],"undefined"==typeof a){if(61===i)break;r(i)}if(t((15&o)<<4>>>0|(60&a)>>2),null!==(i=e())){if(o=n[i],"undefined"==typeof o){if(61===i)break;r(i)}t((3&a)<<6>>>0|o)}}},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,0>e||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()},a.fromBase64=function(e,n){if("string"!=typeof e)throw TypeError("str");var r=new a(e.length/4*3,n),i=0;return f.decode(t(e),function(e){r.view[i++]=e}),r.limit=i,r},a.btoa=function(e){return a.fromBinary(e).toBase64()},a.atob=function(e){return a.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,0>e||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var n=[],r=[];e<t;)n.push(this.view[e++]),1024<=n.length&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},a.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var n,r=0,i=e.length,o=new a(i,t);r<i;){if(n=e.charCodeAt(r),255<n)throw RangeError("illegal char code: "+n);o.view[r++]=n}return o.limit=i,o},s.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",a="",o="";n<r;){if(-1!==n&&(t=this.view[n],i=16>t?i+("0"+t.toString(16).toUpperCase()):i+t.toString(16).toUpperCase(),e&&(a+=32<t&&127>t?String.fromCharCode(t):".")),++n,e&&0<n&&0===n%16&&n!==r){for(;51>i.length;)i+=" ";o+=i+a+"\n",i=a=""}i=n===this.offset&&n===this.limit?i+(n===this.markedOffset?"!":"|"):n===this.offset?i+(n===this.markedOffset?"[":"<"):n===this.limit?i+(n===this.markedOffset?"]":">"):i+(n===this.markedOffset?"'":e||0!==n&&n!==r?" ":"")}if(e&&" "!==i){for(;51>i.length;)i+=" ";o+=i+a+"\n"}return e?o:i},a.fromDebug=function(e,t,n){var r=e.length;t=new a((r+1)/3|0,t,n);for(var i,o=0,s=0,u=!1,l=!1,f=!1,d=!1,c=!1;o<r;){switch(i=e.charAt(o++)){case"!":if(!n){if(l||f||d){c=!0;break}l=f=d=!0}t.offset=t.markedOffset=t.limit=s,u=!1;break;case"|":if(!n){if(l||d){c=!0;break}l=d=!0}t.offset=t.limit=s,u=!1;break;case"[":if(!n){if(l||f){c=!0;break}l=f=!0}t.offset=t.markedOffset=s,u=!1;break;case"<":if(!n){if(l){c=!0;break}l=!0}t.offset=s,u=!1;break;case"]":if(!n){if(d||f){c=!0;break}d=f=!0}t.limit=t.markedOffset=s,u=!1;break;case">":if(!n){if(d){c=!0;break}d=!0}t.limit=s,u=!1;break;case"'":if(!n){if(f){c=!0;break}f=!0}t.markedOffset=s,u=!1;break;case" ":u=!1;break;default:if(!n&&u){c=!0;break}if(i=parseInt(i+e.charAt(o++),16),!n&&(isNaN(i)||0>i||255<i))throw TypeError("Illegal str: Not a debug encoded string");t.view[s++]=i,u=!0}if(c)throw TypeError("Illegal str: Invalid symbol at "+o)}if(!n){if(!l||!d)throw TypeError("Illegal str: Missing offset or limit");if(s<t.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+s+" < "+r)}return t},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||0!==e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var n,r=Array(t-e);e<t;)n=this.view[e++],16>n?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},a.fromHex=function(e,t,n){if(!n){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(0!==e.length%2)throw TypeError("Illegal str: Length not a multiple of 2")}var r=e.length;t=new a(r/2|0,t);for(var i,o=0,s=0;o<r;o+=2){if(i=parseInt(e.substring(o,o+2),16),!n&&(!isFinite(i)||0>i||255<i))throw TypeError("Illegal str: Contains non-hex characters");t.view[s++]=i}return t.limit=s,t};var d=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)128>n?t(127&n):(2048>n?t(n>>6&31|192):(65536>n?t(n>>12&15|224):(t(n>>18&7|240),t(n>>12&63|128)),t(n>>6&63|128)),t(63&n|128)),n=null},decodeUTF8:function(e,t){for(var n,r,i,a,o=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())&&o([n,r]),t((31&n)<<6|63&r);else if(224===(240&n))null!==(r=e())&&null!==(i=e())||o([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!==(a=e())||o([n,r,i,a]),t((7&n)<<18|(63&r)<<12|(63&i)<<6|63&a)}},UTF16toUTF8:function(e,t){for(var n,r=null;null!==(n=null!==r?r:e());)55296<=n&&57343>=n&&null!==(r=e())&&56320<=r&&57343>=r?(t(1024*(n-55296)+r-56320+65536),r=null):t(n);null!==r&&t(r)},UTF8toUTF16:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)65535>=n?t(n):(n-=65536,t((n>>10)+55296),t(n%1024+56320)),n=null},encodeUTF16toUTF8:function(t,n){e.UTF16toUTF8(t,function(t){e.encodeUTF8(t,n)})},decodeUTF8toUTF16:function(t,n){e.decodeUTF8(t,function(t){e.UTF8toUTF16(t,n)})},calculateCodePoint:function(e){return 128>e?1:2048>e?2:65536>e?3:4},calculateUTF8:function(e){for(var t,n=0;null!==(t=e());)n+=128>t?1:2048>t?2:65536>t?3:4;return n},calculateUTF16asUTF8:function(t){var n=0,r=0;return e.UTF16toUTF8(t,function(e){++n,r+=128>e?1:2048>e?2:65536>e?3:4}),[n,r]}};return 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||0!==e%1)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||0!==t%1)throw TypeError("Illegal end: Not an integer");if(t>>>=0,0>e||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;try{d.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()},a.fromUTF8=function(e,n,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new a(d.calculateUTF16asUTF8(t(e),!0)[1],n,r),o=0;return d.encodeUTF16toUTF8(t(e),function(e){i.view[o++]=e}),i.limit=o,i},a});(function(){"undefined"==typeof __REACT_HOT_LOADER__})()},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 RCPDU_CONFERENCE_RECORD_REQUEST = 270;\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\n\n\n //new data\n RCPDU_SEND_CONFERENCE_DATA_REQUEST =500;\n RCPDU_SEND_VIDEO_DATA_REQUEST = 501;\n RCPDU_SEND_AUDIO_DATA_REQUEST = 502;\n RCPDU_SEND_GIFT_DATA_REQUEST = 503;\n RCPDU_SEND_CHAT_DATA_REQUEST = 504;\n RCPDU_THIRD_BROADCAST_DATA_REQUEST = 505;\n RCPDU_SEND_DOC_BROADCAST_DATA_REQUEST = 506;\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 string name = 2;\n optional bytes description = 3;\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 optional uint32 register_obj_id=4;\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}\nmessage RCRegistryWBItemPdu {\n required uint32 node_id = 1;\n required bytes node_data = 2;\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 class_description = 4;//conf_desc\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 class_description = 4;\n}\n\nmessage RCConferenceInviteRequestPdu {\n optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_INVITE_REQUEST];\n required uint32 initiator = 2;\n required RCConferenceDescriptorPdu class_description = 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 optional uint32 action_type = 5;//消息的指令类型\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 string from_role = 5;\n required bytes from_name = 6;\n}\n\nmessage RCDocSendDataModelPdu {\n required uint32 item_idx=1;//唯一标识\n required uint32 owner=2;\n optional uint32 from=3;\n optional uint32 cur_page_no=4;\n optional uint32 page_num =5;\n optional string file_type=6;\n optional string creat_user_id=7;//创建文档userid\n optional string relative_url=8;//文档相对地址\n optional string url =9;//文档地址\n optional uint32 cur_V=10;\n optional uint32 cur_H=11;\n optional uint32 scale=12;\n optional bool visible=13;\n optional uint32 action=14;//0,无操作, 1翻页、2.显示/隐藏\n optional string doc_id=15;//文档在服务器数据库中的唯一id\n optional string file_name=16;//文档的名字\n optional string dynamic_TS=17;//"dynamicTransferStatic": "0"\n optional string md5=18;//md5\n optional uint32 show_type=19;//文档显示模式\n optional uint32 animation_step=20 [default =1];//当前页码的动画步数\n\n}\n\nmessage RCDocBroadcastDataRequestPdu {\n optional uint32 from_node_id = 1;//发起人\n optional uint32 to_node_id = 2;//接收人,如果是0就是所有人都接收\n optional uint32 actionType = 3;//消息指令类型;\n optional bytes data = 4;//其他数据,这个根据actionType来确定数据的结构\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 RCAudioSendDataRequestPdu1 {\n optional uint32 initiator = 1;\n required bytes user_data = 2;\n}\nmessage RCAudioSendDataRequestPdu {\n required uint32 from_node_id = 1;//发起人\n optional uint32 to_node_id = 2;//接收人,如果是0就是所有人都接收\n optional uint32 actionType = 3;//消息指令类型;\n optional bytes data = 4;//其他数据,这个根据actionType来确定数据的结构\n}\n\nmessage RCVideoSendDataRequestPdu {\n required uint32 from_node_id = 1;//发起人\n optional uint32 to_node_id = 2;//接收人,如果是0就是所有人都接收\n optional uint32 actionType = 3;//消息指令类型;\n optional bytes data = 4;//其他数据,这个根据actionType来确定数据的结构\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}\nmessage RCAudioChannelInfoPdu {\n optional uint32 status = 1;//开启的状态\n optional uint32 channel_id = 2;//唯一的频道id\n optional uint32 timestamp = 3;//更新的时间戳\n optional uint32 from_node_id = 4;//发起者的id\n optional uint32 to_node_id = 5;//接收者的id,(如果是0,所有人都接收)\n optional uint32 media_type = 6;//媒体类型:视频(包含音频)或音频\n optional uint32 class_id = 7;//课堂号\n optional string site_id = 8;//站点号\n optional string user_id = 9;//用户的userId\n optional string stream_id = 10;//流名称\n optional string user_name = 11;//用户的名字\n optional string user_role = 12;//用户的身份\n}\n\nmessage RCVideoChannelInfoPdu {\n optional uint32 status = 1;//开启的状态\n optional uint32 channel_id = 2;//唯一的频道id\n optional uint32 timestamp = 3;//更新的时间戳\n optional uint32 from_node_id = 4;//发起者的id\n optional uint32 to_node_id = 5;//接收者的id,(如果是0,所有人都接收)\n optional uint32 media_type = 6;//媒体类型:视频(包含音频)或音频\n optional uint32 class_id = 7;//课堂号\n optional string site_id = 8;//站点号\n optional string user_id = 9;//用户的userId\n optional string stream_id = 10;//流名称\n optional string user_name = 11;//用户的名字\n optional string user_role = 12;//用户的身份\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 repeated string microphones = 13;\n repeated string cameras = 14;\n optional uint32 openCamera=15;\n optional uint32 openMicrophones=16;\n optional uint32 videoQuality=17;//设置分辨率的\n optional string userIp=18;\n optional uint32 curVideoQuality=19;\n optional uint32 micGain=20;\n optional uint32 speakerVolume=21;\n optional uint32 micCode=22;\n optional string curCamera=23;\n optional string curMicrophone=24;\n optional string country=25;\n optional string city=26;\n optional string province=27;\n optional string isp=28;\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 device = 1;//设备名称\n optional bool has_camera = 2;//是否有摄像头可用\n optional bool has_microphone = 3;//麦克风是否可用\n optional string browser = 4;//浏览器\n optional string qq = 5;//qq\n optional string skype = 6;//skype\n}\n\nmessage RCTabUpdateDataRequestPdu {\n optional uint32 id = 1;\n optional bytes action = 2;\n optional uint32 uncomprLen =3;\n}\n\nmessage RCWhiteBoardDataModelPdu {\n required uint32 type= 1;//白板类型\n required uint32 itemIdx= 2;//itemIdx 每一次绘制的唯一标识\n required uint32 initiator=3; //绘制来自谁\n required uint32 parentId=4; //父级的id\n required uint32 cur_page_no= 5;//页码\n optional string pointGroup=6; //坐标点集数组的JSON字符串\n optional string color=7 [default = "#000000"]; //颜色\n optional uint32 thickness= 8 ;//线条粗细\n optional uint32 radius= 9;//园的半径\n optional uint32 fontSize= 10;//字体大小\n optional string fontName= 11;//字体名称\n optional string text= 12;//文本内容\n optional bytes data = 13;//暂时预留的参数\n}\nmessage RCClassSendDataModelPdu {\n optional uint32 item_idx=1;\n optional uint32 from=2;\n optional uint32 owner=3;\n optional uint32 action_type=4;//状态改变的类型\n optional RCClassStatusInfoPdu class_status_info=5;//当前课堂状态的信息\n}\nmessage RCClassStatusInfoPdu {\n optional uint32 node_id=1;//mcu中的唯一ID\n optional string user_id=2;\n optional string user_name=3;\n optional string site_id=4;//站点号\n optional uint32 class_id=5;\n optional string class_name=6;\n required uint32 class_type=7;//课堂类型\n required uint32 class_status=9;//课堂的状态\n optional string class_startTime=10;//课堂点击开始时间\n optional string class_stopTime=11;//最后一次停止的时间(点暂停或结束),每次发送数据都获取当前时间戳\n optional uint32 class_timestamp=12;//相对于点开始课堂的时间戳\n optional string class_beginTime=13;//课堂创建的时间,这个是Sass返回的\n optional string class_endTime=14;//课堂结束的时间,这个是Sass返回的\n optional bool record_status=15;//当前录制状态\n optional uint32 record_timestamp=16;//相对于首次开始录制的时间戳\n optional string record_fileName=17;//录制的文件名\n optional string record_downloadUrl=18;//下载地址\n optional uint32 server_timestamp=19;//当前的系统时间戳\n optional uint32 active_doc_id=20;//当前激活的文档id\n optional uint32 active_doc_cur_page=21;//当前激活的文档的当前页\n}\n\nmessage RCConferenceRecordRequestPdu {\n \toptional uint32 initiator = 1;\t// 发起录像指令的node id\n\t\toptional bool record = 2;\t\t// 录像指令 true:开始录像, false:停止录像\n \toptional uint32 class_time = 3;\t// 课堂进行时间(秒)\n\t\toptional string filename = 4;\t// 录像文件名称,filename中增加目录部分\n}\n\n//end\n'; +t.default=n;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&__REACT_HOT_LOADER__.register(n,"default","D:/work/McuClient/src/pdus/pro.js")})()},function(e,t){!function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],r=0;r<e.length;r+=3)for(var i=e[r]<<16|e[r+1]<<8|e[r+2],a=0;a<4;a++)8*r+6*a<=8*e.length?n.push(t.charAt(i>>>6*(3-a)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r<e.length;i=++r%4)0!=i&&n.push((t.indexOf(e.charAt(r-1))&Math.pow(2,-2*i+8)-1)<<2*i|t.indexOf(e.charAt(r))>>>6-2*i);return n}};e.exports=n}()},function(e,t,n){var r;(function(e,i,a){(function(){"use strict";function o(e){return"function"==typeof e||"object"==typeof e&&null!==e}function s(e){return"function"==typeof e}function u(e){z=e}function l(e){ee=e}function f(){return function(){e.nextTick(_)}}function d(){return function(){K(_)}}function c(){var e=0,t=new re(_),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function h(){var e=new MessageChannel;return e.port1.onmessage=_,function(){e.port2.postMessage(0)}}function p(){return function(){setTimeout(_,1)}}function _(){for(var e=0;e<X;e+=2){var t=oe[e],n=oe[e+1];t(n),oe[e]=void 0,oe[e+1]=void 0}X=0}function E(){try{var e=n(53);return K=e.runOnLoop||e.runOnContext,d()}catch(e){return p()}}function g(e,t){var n=this,r=new this.constructor(R);void 0===r[le]&&B(r);var i=n._state;if(i){var a=arguments[i-1];ee(function(){k(i,r,a,n._result)})}else O(n,r,e,t);return r}function y(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(R);return b(n,e),n}function R(){}function m(){return new TypeError("You cannot resolve a promise with itself")}function v(){return new TypeError("A promises callback cannot return that same promise.")}function T(e){try{return e.then}catch(e){return he.error=e,he}}function C(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}function S(e,t,n){ee(function(e){var r=!1,i=C(n,t,function(n){r||(r=!0,t!==n?b(e,n):D(e,n))},function(t){r||(r=!0,P(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&i&&(r=!0,P(e,i))},e)}function I(e,t){t._state===de?D(e,t._result):t._state===ce?P(e,t._result):O(t,void 0,function(t){b(e,t)},function(t){P(e,t)})}function A(e,t,n){t.constructor===e.constructor&&n===se&&constructor.resolve===ue?I(e,t):n===he?P(e,he.error):void 0===n?D(e,t):s(n)?S(e,t,n):D(e,t)}function b(e,t){e===t?P(e,m()):o(t)?A(e,t,T(t)):D(e,t)}function w(e){e._onerror&&e._onerror(e._result),N(e)}function D(e,t){e._state===fe&&(e._result=t,e._state=de,0!==e._subscribers.length&&ee(N,e))}function P(e,t){e._state===fe&&(e._state=ce,e._result=t,ee(w,e))}function O(e,t,n,r){var i=e._subscribers,a=i.length;e._onerror=null,i[a]=t,i[a+de]=n,i[a+ce]=r,0===a&&e._state&&ee(N,e)}function N(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r,i,a=e._result,o=0;o<t.length;o+=3)r=t[o],i=t[o+n],r?k(n,r,i,a):i(a);e._subscribers.length=0}}function U(){this.error=null}function L(e,t){try{return e(t)}catch(e){return pe.error=e,pe}}function k(e,t,n,r){var i,a,o,u,l=s(n);if(l){if(i=L(n,r),i===pe?(u=!0,a=i.error,i=null):o=!0,t===i)return void P(t,v())}else i=r,o=!0;t._state!==fe||(l&&o?b(t,i):u?P(t,a):e===de?D(t,i):e===ce&&P(t,i))}function M(e,t){try{t(function(t){b(e,t)},function(t){P(e,t)})}catch(t){P(e,t)}}function x(){return _e++}function B(e){e[le]=_e++,e._state=void 0,e._result=void 0,e._subscribers=[]}function F(e){return new me(this,e).promise}function H(e){var t=this;return new t(Z(e)?function(n,r){for(var i=e.length,a=0;a<i;a++)t.resolve(e[a]).then(n,r)}:function(e,t){t(new TypeError("You must pass an array to race."))})}function j(e){var t=this,n=new t(R);return P(n,e),n}function G(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function q(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function V(e){this[le]=x(),this._result=this._state=void 0,this._subscribers=[],R!==e&&("function"!=typeof e&&G(),this instanceof V?M(this,e):q())}function Y(e,t){this._instanceConstructor=e,this.promise=new e(R),this.promise[le]||B(this.promise),Z(t)?(this._input=t,this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?D(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&D(this.promise,this._result))):P(this.promise,J())}function J(){return new Error("Array Methods must be provided an Array")}function W(){var e;if("undefined"!=typeof i)e=i;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;t&&"[object Promise]"===Object.prototype.toString.call(t.resolve())&&!t.cast||(e.Promise=Re)}var Q;Q=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var K,z,$,Z=Q,X=0,ee=function(e,t){oe[X]=e,oe[X+1]=t,X+=2,2===X&&(z?z(_):$())},te="undefined"!=typeof window?window:void 0,ne=te||{},re=ne.MutationObserver||ne.WebKitMutationObserver,ie="undefined"==typeof self&&"undefined"!=typeof e&&"[object process]"==={}.toString.call(e),ae="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,oe=new Array(1e3);$=ie?f():re?c():ae?h():void 0===te?E():p();var se=g,ue=y,le=Math.random().toString(36).substring(16),fe=void 0,de=1,ce=2,he=new U,pe=new U,_e=0,Ee=F,ge=H,ye=j,Re=V;V.all=Ee,V.race=ge,V.resolve=ue,V.reject=ye,V._setScheduler=u,V._setAsap=l,V._asap=ee,V.prototype={constructor:V,then:se,catch:function(e){return this.then(null,e)}};var me=Y;Y.prototype._enumerate=function(){for(var e=this.length,t=this._input,n=0;this._state===fe&&n<e;n++)this._eachEntry(t[n],n)},Y.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===ue){var i=T(e);if(i===se&&e._state!==fe)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(n===Re){var a=new n(R);A(a,e,i),this._willSettleAt(a,t)}else this._willSettleAt(new n(function(t){t(e)}),t)}else this._willSettleAt(r(e),t)},Y.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===fe&&(this._remaining--,e===ce?P(r,n):this._result[t]=n),0===this._remaining&&D(r,this._result)},Y.prototype._willSettleAt=function(e,t){var n=this;O(e,void 0,function(e){n._settledAt(de,t,e)},function(e){n._settledAt(ce,t,e)})};var ve=W,Te={Promise:Re,polyfill:ve};n(12).amd?(r=function(){return Te}.call(t,n,t,a),!(void 0!==r&&(a.exports=r))):"undefined"!=typeof a&&a.exports?a.exports=Te:"undefined"!=typeof this&&(this.ES6Promise=Te),ve()}).call(this)}).call(t,n(23),function(){return this}(),n(9)(e))},function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function r(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}e.exports=function(e){return null!=e&&(n(e)||r(e)||!!e._isBuffer)}},function(e,t,n){var r,i,a;!function(o){n(24)&&n(24).jQuery?(i=[n(29)],r=o,a="function"==typeof r?r.apply(t,i):r,!(void 0!==a&&(e.exports=a))):o("undefined"!=typeof e&&e.exports?n(29):jQuery)}(function(e){function t(t){return!t||void 0!==t.allowPageScroll||void 0===t.swipe&&void 0===t.swipeStatus||(t.allowPageScroll=f),void 0!==t.click&&void 0===t.tap&&(t.tap=t.click),t||(t={}),t=e.extend({},e.fn.swipe.defaults,t),this.each(function(){var r=e(this),i=r.data(w);i||(i=new n(this,t),r.data(w,i))})}function n(t,n){function r(t){if(!(le()||e(t.target).closest(n.excludedElements,Ve).length>0)){var r,i=t.originalEvent?t.originalEvent:t,a=i.touches,o=a?a[0]:i;return Ye=v,a?Je=a.length:n.preventDefaultEvents!==!1&&t.preventDefault(),Le=0,ke=null,Me=null,Ge=null,xe=0,Be=0,Fe=0,He=1,je=0,qe=Ee(),se(),de(0,o),!a||Je===n.fingers||n.fingers===R||q()?(Qe=Ie(),2==Je&&(de(1,a[1]),Be=Fe=Re(We[0].start,We[1].start)),(n.swipeStatus||n.pinchStatus)&&(r=k(i,Ye))):r=!1,r===!1?(Ye=S,k(i,Ye),r):(n.hold&&(et=setTimeout(e.proxy(function(){Ve.trigger("hold",[i.target]),n.hold&&(r=n.hold.call(Ve,i,i.target))},this),n.longTapThreshold)),fe(!0),null)}}function D(e){var t=e.originalEvent?e.originalEvent:e;if(Ye!==C&&Ye!==S&&!ue()){var r,i=t.touches,a=i?i[0]:t,o=ce(a);if(Ke=Ie(),i&&(Je=i.length),n.hold&&clearTimeout(et),Ye=T,2==Je&&(0==Be?(de(1,i[1]),Be=Fe=Re(We[0].start,We[1].start)):(ce(i[1]),Fe=Re(We[0].end,We[1].end),Ge=ve(We[0].end,We[1].end)),He=me(Be,Fe),je=Math.abs(Be-Fe)),Je===n.fingers||n.fingers===R||!i||q()){if(ke=Se(o.start,o.end),Me=Se(o.last,o.end),j(e,Me),Le=Te(o.start,o.end),xe=ye(),pe(ke,Le),r=k(t,Ye),!n.triggerOnTouchEnd||n.triggerOnTouchLeave){var s=!0;if(n.triggerOnTouchLeave){var u=Ae(this);s=be(o.end,u)}!n.triggerOnTouchEnd&&s?Ye=L(T):n.triggerOnTouchLeave&&!s&&(Ye=L(C)),Ye!=S&&Ye!=C||k(t,Ye)}}else Ye=S,k(t,Ye);r===!1&&(Ye=S,k(t,Ye))}}function P(e){var t=e.originalEvent?e.originalEvent:e,r=t.touches;if(r){if(r.length&&!ue())return oe(t),!0;if(r.length&&ue())return!0}return ue()&&(Je=$e),Ke=Ie(),xe=ye(),B()||!x()?(Ye=S,k(t,Ye)):n.triggerOnTouchEnd||0==n.triggerOnTouchEnd&&Ye===T?(n.preventDefaultEvents!==!1&&e.preventDefault(),Ye=C,k(t,Ye)):!n.triggerOnTouchEnd&&z()?(Ye=C,M(t,Ye,p)):Ye===T&&(Ye=S,k(t,Ye)),fe(!1),null}function O(){Je=0,Ke=0,Qe=0,Be=0,Fe=0,He=1,se(),fe(!1)}function N(e){var t=e.originalEvent?e.originalEvent:e;n.triggerOnTouchLeave&&(Ye=L(C),k(t,Ye))}function U(){Ve.unbind(De,r),Ve.unbind(Ue,O),Ve.unbind(Pe,D),Ve.unbind(Oe,P),Ne&&Ve.unbind(Ne,N),fe(!1)}function L(e){var t=e,r=H(),i=x(),a=B();return!r||a?t=S:!i||e!=T||n.triggerOnTouchEnd&&!n.triggerOnTouchLeave?!i&&e==C&&n.triggerOnTouchLeave&&(t=S):t=C,t}function k(e,t){var n,r=e.touches;return(W()||J())&&(n=M(e,t,c)),(V()||q())&&n!==!1&&(n=M(e,t,h)),ie()&&n!==!1?n=M(e,t,_):ae()&&n!==!1?n=M(e,t,E):re()&&n!==!1&&(n=M(e,t,p)),t===S&&(J()&&(n=M(e,t,c)),q()&&(n=M(e,t,h)),O(e)),t===C&&(r?r.length||O(e):O(e)),n}function M(t,r,f){var d;if(f==c){if(Ve.trigger("swipeStatus",[r,ke||null,Le||0,xe||0,Je,We,Me]),n.swipeStatus&&(d=n.swipeStatus.call(Ve,t,r,ke||null,Le||0,xe||0,Je,We,Me),d===!1))return!1;if(r==C&&Y()){if(clearTimeout(Xe),clearTimeout(et),Ve.trigger("swipe",[ke,Le,xe,Je,We,Me]),n.swipe&&(d=n.swipe.call(Ve,t,ke,Le,xe,Je,We,Me),d===!1))return!1;switch(ke){case i:Ve.trigger("swipeLeft",[ke,Le,xe,Je,We,Me]),n.swipeLeft&&(d=n.swipeLeft.call(Ve,t,ke,Le,xe,Je,We,Me));break;case a:Ve.trigger("swipeRight",[ke,Le,xe,Je,We,Me]),n.swipeRight&&(d=n.swipeRight.call(Ve,t,ke,Le,xe,Je,We,Me));break;case o:Ve.trigger("swipeUp",[ke,Le,xe,Je,We,Me]),n.swipeUp&&(d=n.swipeUp.call(Ve,t,ke,Le,xe,Je,We,Me));break;case s:Ve.trigger("swipeDown",[ke,Le,xe,Je,We,Me]),n.swipeDown&&(d=n.swipeDown.call(Ve,t,ke,Le,xe,Je,We,Me))}}}if(f==h){if(Ve.trigger("pinchStatus",[r,Ge||null,je||0,xe||0,Je,He,We]),n.pinchStatus&&(d=n.pinchStatus.call(Ve,t,r,Ge||null,je||0,xe||0,Je,He,We),d===!1))return!1;if(r==C&&G())switch(Ge){case u:Ve.trigger("pinchIn",[Ge||null,je||0,xe||0,Je,He,We]),n.pinchIn&&(d=n.pinchIn.call(Ve,t,Ge||null,je||0,xe||0,Je,He,We));break;case l:Ve.trigger("pinchOut",[Ge||null,je||0,xe||0,Je,He,We]),n.pinchOut&&(d=n.pinchOut.call(Ve,t,Ge||null,je||0,xe||0,Je,He,We))}}return f==p?r!==S&&r!==C||(clearTimeout(Xe),clearTimeout(et),$()&&!ee()?(Ze=Ie(),Xe=setTimeout(e.proxy(function(){Ze=null,Ve.trigger("tap",[t.target]),n.tap&&(d=n.tap.call(Ve,t,t.target))},this),n.doubleTapThreshold)):(Ze=null,Ve.trigger("tap",[t.target]),n.tap&&(d=n.tap.call(Ve,t,t.target)))):f==_?r!==S&&r!==C||(clearTimeout(Xe),clearTimeout(et),Ze=null,Ve.trigger("doubletap",[t.target]),n.doubleTap&&(d=n.doubleTap.call(Ve,t,t.target))):f==E&&(r!==S&&r!==C||(clearTimeout(Xe),Ze=null,Ve.trigger("longtap",[t.target]),n.longTap&&(d=n.longTap.call(Ve,t,t.target)))),d}function x(){var e=!0;return null!==n.threshold&&(e=Le>=n.threshold),e}function B(){var e=!1;return null!==n.cancelThreshold&&null!==ke&&(e=_e(ke)-Le>=n.cancelThreshold),e}function F(){return null===n.pinchThreshold||je>=n.pinchThreshold}function H(){var e;return e=!n.maxTimeThreshold||!(xe>=n.maxTimeThreshold)}function j(e,t){if(n.preventDefaultEvents!==!1)if(n.allowPageScroll===f)e.preventDefault();else{var r=n.allowPageScroll===d;switch(t){case i:(n.swipeLeft&&r||!r&&n.allowPageScroll!=g)&&e.preventDefault();break;case a:(n.swipeRight&&r||!r&&n.allowPageScroll!=g)&&e.preventDefault();break;case o:(n.swipeUp&&r||!r&&n.allowPageScroll!=y)&&e.preventDefault();break;case s:(n.swipeDown&&r||!r&&n.allowPageScroll!=y)&&e.preventDefault()}}}function G(){var e=Q(),t=K(),n=F();return e&&t&&n}function q(){return!!(n.pinchStatus||n.pinchIn||n.pinchOut)}function V(){return!(!G()||!q())}function Y(){var e=H(),t=x(),n=Q(),r=K(),i=B(),a=!i&&r&&n&&t&&e;return a}function J(){return!!(n.swipe||n.swipeStatus||n.swipeLeft||n.swipeRight||n.swipeUp||n.swipeDown)}function W(){return!(!Y()||!J())}function Q(){return Je===n.fingers||n.fingers===R||!I}function K(){return 0!==We[0].end.x}function z(){return!!n.tap}function $(){return!!n.doubleTap}function Z(){return!!n.longTap}function X(){if(null==Ze)return!1;var e=Ie();return $()&&e-Ze<=n.doubleTapThreshold}function ee(){return X()}function te(){return(1===Je||!I)&&(isNaN(Le)||Le<n.threshold)}function ne(){return xe>n.longTapThreshold&&Le<m}function re(){return!(!te()||!z())}function ie(){return!(!X()||!$())}function ae(){return!(!ne()||!Z())}function oe(e){ze=Ie(),$e=e.touches.length+1}function se(){ze=0,$e=0}function ue(){var e=!1;if(ze){var t=Ie()-ze;t<=n.fingerReleaseThreshold&&(e=!0)}return e}function le(){return!(Ve.data(w+"_intouch")!==!0)}function fe(e){Ve&&(e===!0?(Ve.bind(Pe,D),Ve.bind(Oe,P),Ne&&Ve.bind(Ne,N)):(Ve.unbind(Pe,D,!1),Ve.unbind(Oe,P,!1),Ne&&Ve.unbind(Ne,N,!1)),Ve.data(w+"_intouch",e===!0))}function de(e,t){var n={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return n.start.x=n.last.x=n.end.x=t.pageX||t.clientX,n.start.y=n.last.y=n.end.y=t.pageY||t.clientY,We[e]=n,n}function ce(e){var t=void 0!==e.identifier?e.identifier:0,n=he(t);return null===n&&(n=de(t,e)),n.last.x=n.end.x,n.last.y=n.end.y,n.end.x=e.pageX||e.clientX,n.end.y=e.pageY||e.clientY,n}function he(e){return We[e]||null}function pe(e,t){t=Math.max(t,_e(e)),qe[e].distance=t}function _e(e){if(qe[e])return qe[e].distance}function Ee(){var e={};return e[i]=ge(i),e[a]=ge(a),e[o]=ge(o),e[s]=ge(s),e}function ge(e){return{direction:e,distance:0}}function ye(){return Ke-Qe}function Re(e,t){var n=Math.abs(e.x-t.x),r=Math.abs(e.y-t.y);return Math.round(Math.sqrt(n*n+r*r))}function me(e,t){var n=t/e*1;return n.toFixed(2)}function ve(){return He<1?l:u}function Te(e,t){return Math.round(Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)))}function Ce(e,t){var n=e.x-t.x,r=t.y-e.y,i=Math.atan2(r,n),a=Math.round(180*i/Math.PI);return a<0&&(a=360-Math.abs(a)),a}function Se(e,t){var n=Ce(e,t);return n<=45&&n>=0?i:n<=360&&n>=315?i:n>=135&&n<=225?a:n>45&&n<135?s:o}function Ie(){var e=new Date;return e.getTime()}function Ae(t){t=e(t);var n=t.offset(),r={left:n.left,right:n.left+t.outerWidth(),top:n.top,bottom:n.top+t.outerHeight()};return r}function be(e,t){return e.x>t.left&&e.x<t.right&&e.y>t.top&&e.y<t.bottom}var n=e.extend({},n),we=I||b||!n.fallbackToMouseEvents,De=we?b?A?"MSPointerDown":"pointerdown":"touchstart":"mousedown",Pe=we?b?A?"MSPointerMove":"pointermove":"touchmove":"mousemove",Oe=we?b?A?"MSPointerUp":"pointerup":"touchend":"mouseup",Ne=we?b?"mouseleave":null:"mouseleave",Ue=b?A?"MSPointerCancel":"pointercancel":"touchcancel",Le=0,ke=null,Me=null,xe=0,Be=0,Fe=0,He=1,je=0,Ge=0,qe=null,Ve=e(t),Ye="start",Je=0,We={},Qe=0,Ke=0,ze=0,$e=0,Ze=0,Xe=null,et=null;try{Ve.bind(De,r),Ve.bind(Ue,O)}catch(t){e.error("events not supported "+De+","+Ue+" on jQuery.swipe")}this.enable=function(){return Ve.bind(De,r),Ve.bind(Ue,O),Ve},this.disable=function(){return U(),Ve},this.destroy=function(){U(),Ve.data(w,null),Ve=null},this.option=function(t,r){if("object"==typeof t)n=e.extend(n,t);else if(void 0!==n[t]){if(void 0===r)return n[t];n[t]=r}else{if(!t)return n;e.error("Option "+t+" does not exist on jQuery.swipe.options")}return null}}var r="1.6.15",i="left",a="right",o="up",s="down",u="in",l="out",f="none",d="auto",c="swipe",h="pinch",p="tap",_="doubletap",E="longtap",g="horizontal",y="vertical",R="all",m=10,v="start",T="move",C="end",S="cancel",I="ontouchstart"in window,A=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled&&!I,b=(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&!I,w="TouchSwipe",D={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:"auto",fallbackToMouseEvents:!0,excludedElements:"label, button, input, select, textarea, a, .noSwipe",preventDefaultEvents:!0};e.fn.swipe=function(n){var r=e(this),i=r.data(w);if(i&&"string"==typeof n){if(i[n])return i[n].apply(this,Array.prototype.slice.call(arguments,1));e.error("Method "+n+" does not exist on jQuery.swipe")}else if(i&&"object"==typeof n)i.option.apply(this,arguments);else if(!(i||"object"!=typeof n&&n))return t.apply(this,arguments);return r},e.fn.swipe.version=r,e.fn.swipe.defaults=D,e.fn.swipe.phases={PHASE_START:v,PHASE_MOVE:T,PHASE_END:C,PHASE_CANCEL:S},e.fn.swipe.directions={LEFT:i,RIGHT:a,UP:o,DOWN:s,IN:u,OUT:l},e.fn.swipe.pageScroll={NONE:f,HORIZONTAL:g,VERTICAL:y,AUTO:d},e.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:R}})},function(e,t,n){var r,i,a;(function(e,o){!function(e,s){n(12).amd?(i=[n(25)],r=s,a="function"==typeof r?r.apply(t,i):r,!(void 0!==a&&(o.exports=a))):"object"==typeof o&&o&&o.exports?o.exports=s(n(25),!0):(e.dcodeIO=e.dcodeIO||{}).ProtoBuf=s(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(54);if(r)i.readFile(e,function(e,t){r(e?null:""+t)});else try{return i.readFileSync(e)}catch(e){return null}}else{var a=t.XHR();if(a.open("GET",e,!!r),a.setRequestHeader("Accept","text/plain"),"function"==typeof a.overrideMimeType&&a.overrideMimeType("text/plain"),!r)return a.send(null),200==a.status||0==a.status&&"string"==typeof a.responseText?a.responseText:null;if(a.onreadystatechange=function(){4==a.readyState&&r(200==a.status||0==a.status&&"string"==typeof a.responseText?a.responseText:null)},4==a.readyState)return;a.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 a={},o=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},s=o.prototype;s._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]},s.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 a=t.DELIM.test(this.source.charAt(i++));if(!a)for(;i<this.source.length&&!t.DELIM.test(this.source.charAt(i));)++i;var o=this.source.substring(this.index,this.index=i);return'"'!==o&&"'"!==o||(this._stringOpen=o),o},s.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},s.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},s.omit=function(e){return this.peek()===e&&(this.next(),!0)},s.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},a.Tokenizer=o;var u=function(e){this.tn=new o(e),this.proto3=!1},l=u.prototype;return l.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()},l._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},l._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)},l._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 a=r;i&&(this.tn.skip(")"),a="("+a+")",r=this.tn.peek(),t.FQTYPEREF.test(r)&&(a+=r,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,a),n||this.tn.skip(";")},l._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)}},l._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)},l._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,a={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};if(this.tn.skip("("),r=this.tn.next(),"stream"===r.toLowerCase()&&(a.request_stream=!0,r=this.tn.next()),!t.TYPEREF.test(r))throw Error("illegal rpc service request type: "+r);if(a.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()&&(a.response_stream=!0,r=this.tn.next()),a.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(a)}this.tn.omit(";")}else this.tn.skip(";");"undefined"==typeof e[n]&&(e[n]={}),e[n][i]=a},l._parseMessage=function(e,r){var i=!!r,a=this.tn.next(),o={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(a))throw Error("illegal "+(i?"group":"message")+" name: "+a);for(o.name=a,i&&(this.tn.skip("="),r.id=n(this.tn.next()),o.isGroup=!0),a=this.tn.peek(),"["===a&&r&&this._parseFieldOptions(r),this.tn.skip("{");"}"!==(a=this.tn.next());)if(t.RULE.test(a))this._parseMessageField(o,a);else if("oneof"===a)this._parseMessageOneOf(o);else if("enum"===a)this._parseEnum(o);else if("message"===a)this._parseMessage(o);else if("option"===a)this._parseOption(o);else if("service"===a)this._parseService(o);else if("extensions"===a)o.extensions=this._parseExtensionRanges();else if("reserved"===a)this._parseIgnored();else if("extend"===a)this._parseExtend(o);else{if(!t.TYPEREF.test(a))throw Error("illegal message token: "+a);if(!this.proto3)throw Error("illegal field rule: "+a);this._parseMessageField(o,"optional",a)}return this.tn.omit(";"),e.messages.push(o),o},l._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},l._parseMessageField=function(e,r,i){if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);var a,o={rule:r,type:"",name:"",options:{},id:0};if("map"===r){if(i)throw Error("illegal type: "+i);if(this.tn.skip("<"),a=this.tn.next(),!t.TYPE.test(a)&&!t.TYPEREF.test(a))throw Error("illegal message field type: "+a);if(o.keytype=a,this.tn.skip(","),a=this.tn.next(),!t.TYPE.test(a)&&!t.TYPEREF.test(a))throw Error("illegal message field: "+a);if(o.type=a,this.tn.skip(">"),a=this.tn.next(),!t.NAME.test(a))throw Error("illegal message field name: "+a);o.name=a,this.tn.skip("="),o.id=n(this.tn.next()),a=this.tn.peek(),"["===a&&this._parseFieldOptions(o),this.tn.skip(";")}else if(i="undefined"!=typeof i?i:this.tn.next(),"group"===i){var s=this._parseMessage(e,o);if(!/^[A-Z]/.test(s.name))throw Error("illegal group name: "+s.name);o.type=s.name,o.name=s.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(o.type=i,a=this.tn.next(),!t.NAME.test(a))throw Error("illegal message field name: "+a);o.name=a,this.tn.skip("="),o.id=n(this.tn.next()),a=this.tn.peek(),"["===a&&this._parseFieldOptions(o),this.tn.skip(";")}return e.fields.push(o),o},l._parseMessageOneOf=function(e){var n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal oneof name: "+n);var r,i=n,a=[];for(this.tn.skip("{");"}"!==(n=this.tn.next());)r=this._parseMessageField(e,"optional",n),r.oneof=i,a.push(r.id);this.tn.omit(";"),e.oneofs[i]=a},l._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()},l._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 a={name:i,id:n(this.tn.next(),!0)};i=this.tn.peek(),"["===i&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),r.values.push(a)}this.tn.omit(";"),e.enums.push(r)},l._parseExtensionRanges=function(){var t,n,i,a=[];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()}a.push(n)}while(this.tn.omit(","));return this.tn.skip(";"),a},l._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},l.toString=function(){return"Parser at line "+this.tn.line},a.Parser=u,a}(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(),a=7&r,o=r>>>3;switch(a){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(o,n);break;case e.WIRE_TYPES.ENDGROUP:if(o===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+o+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:n.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+a)}return!0}var a={},o=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},s=o.prototype;s.fqn=function(){for(var e=this.name,t=this;;){if(t=t.parent,null==t)break;e=t.name+"."+e}return e},s.toString=function(e){return(e?this.className+" ":"")+this.fqn()},s.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},a.T=o;var u=function(e,t,n,r,i){o.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=i||"proto2"},l=u.prototype=Object.create(o.prototype);l.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},l.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof c.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof c.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)},l.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},l.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 o;do{do{if(!(r instanceof a.Namespace)){r=null;break}if(o=r.getChild(n[i]),!o||!(o instanceof a.T)||t&&!(o instanceof a.Namespace)){r=null;break}r=o,i++}while(i<n.length);if(null!=r)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=r);return r},l.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 a.Namespace))return i.join(".")}return e.fqn()},l.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},l.buildOpt=function(){for(var e={},t=Object.keys(this.options),n=0,r=t.length;n<r;++n){var i=t[n],a=this.options[t[n]];e[i]=a}return e},l.getOption=function(e){return"undefined"==typeof e?this.options:"undefined"!=typeof this.options[e]?this.options[e]:null},a.Namespace=u;var f=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)},d=f.prototype;f.defaultFieldValue=n,d.verifyValue=function(n){function i(e,t){throw Error("Illegal value for "+a.toString(!0)+" of type "+a.type.name+": "+e+" ("+t+")")}var a=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 o=this.resolvedType.getChildren(e.Reflect.Enum.Value);for(u=0;u<o.length;u++){if(o[u].name==n)return o[u].id;if(o[u].id==n)return o[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 s={};for(var u in n)n.hasOwnProperty(u)&&(s[u]=n[u]);n=s}return new this.resolvedType.clazz(n)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+n+" (undefined type "+this.type+")")},d.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)")},d.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 a=r.offset;i.writeVarint32(r.remaining()),i.append(r),r.offset=a;break;case e.TYPES.message:var o=(new t).LE();this.resolvedType.encode(r,o),i.writeVarint32(o.offset),i.append(o.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},d.decode=function(t,n,r){if(n!=this.type.wireType)throw Error("Unexpected wire type for element");var i,a;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(a=t.readVarint32(),t.remaining()<a)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+a+" required but got only "+t.remaining());return i=t.clone(),i.limit=i.offset+a,t.offset+=a,i;case e.TYPES.message:return a=t.readVarint32(),this.resolvedType.decode(t,a);case e.TYPES.group:return this.resolvedType.decode(t,-1,r)}throw Error("[INTERNAL] Illegal decode type")},d.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)}},d.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()},a.Element=f;var c=function(e,t,n,r,i,a){u.call(this,e,t,n,r,a),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},h=c.prototype=Object.create(u.prototype);h.build=function(n){if(this.clazz&&!n)return this.clazz;var r=function(e,n){function r(n,i,a,o){if(null===n||"object"!=typeof n){if(o&&o instanceof e.Reflect.Enum){var s=e.Reflect.Enum.getName(o.object,n);if(null!==s)return s}return n}if(t.isByteBuffer(n))return i?n.toBase64():n.toBuffer();if(e.Long.isLong(n))return a?n.toString():e.Long.fromValue(n);var u;if(Array.isArray(n))return u=[],n.forEach(function(e,t){u[t]=r(e,i,a,o)}),u;if(u={},n instanceof e.Map){for(var l=n.entries(),f=l.next();!f.done;f=l.next())u[n.keyElem.valueToString(f.value[0])]=r(f.value[1],i,a,n.valueElem.resolvedType);return u}var d=n.$type,c=void 0;for(var h in n)n.hasOwnProperty(h)&&(d&&(c=d.getChild(h))?u[h]=r(n[h],i,a,c.resolvedType):u[h]=r(n[h],i,a));return u}var i=n.getChildren(e.Reflect.Message.Field),a=n.getChildren(e.Reflect.Message.OneOf),o=function(r,s){e.Builder.Message.call(this);for(var u=0,l=a.length;u<l;++u)this[a[u].name]=null;for(u=0,l=i.length;u<l;++u){var f=i[u];this[f.name]=f.repeated?[]:f.map?new e.Map(f):null,!f.required&&"proto3"!==n.syntax||null===f.defaultValue||(this[f.name]=f.defaultValue)}if(arguments.length>0){var d;if(1!==arguments.length||null===r||"object"!=typeof r||!("function"!=typeof r.encode||r instanceof o)||Array.isArray(r)||r instanceof e.Map||t.isByteBuffer(r)||r instanceof ArrayBuffer||e.Long&&r instanceof e.Long)for(u=0,l=arguments.length;u<l;++u)"undefined"!=typeof(d=arguments[u])&&this.$set(i[u].name,d);else this.$set(r)}},s=o.prototype=Object.create(e.Builder.Message.prototype);s.add=function(t,r,i){var a=n._fieldsByName[t];if(!i){if(!a)throw Error(this+"#"+t+" is undefined");if(!(a instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+a.toString(!0));if(!a.repeated)throw Error(this+"#"+t+" is not a repeated field");r=a.verifyValue(r,!0)}return null===this[t]&&(this[t]=[]),this[t].push(r),this},s.$add=s.add,s.set=function(t,r,i){if(t&&"object"==typeof t){i=r;for(var a in t)t.hasOwnProperty(a)&&"undefined"!=typeof(r=t[a])&&this.$set(a,r,i);return this}var o=n._fieldsByName[t];if(i)this[t]=r;else{if(!o)throw Error(this+"#"+t+" is not a field: undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+o.toString(!0));this[o.name]=r=o.verifyValue(r)}if(o&&o.oneof){var s=this[o.oneof.name];null!==r?(null!==s&&s!==o.name&&(this[s]=null),this[o.oneof.name]=o.name):s===t&&(this[o.oneof.name]=null)}return this},s.$set=s.set,s.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]},s.$get=s.get;for(var u=0;u<i.length;u++){var l=i[u];l 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},a=function(){return this[e.name]};null===n.getChild("set"+t)&&(s["set"+t]=i),null===n.getChild("set_"+r)&&(s["set_"+r]=i),null===n.getChild("get"+t)&&(s["get"+t]=a),null===n.getChild("get_"+r)&&(s["get_"+r]=a)}(l)}s.encode=function(e,r){"boolean"==typeof e&&(r=e,e=void 0);var i=!1;e||(e=new t,i=!0);var a=e.littleEndian;try{return n.encode(this,e.LE(),r),(i?e.flip():e).LE(a)}catch(t){throw e.LE(a),t}},o.encode=function(e,t,n){return new o(e).encode(t,n)},s.calculate=function(){return n.calculate(this)},s.encodeDelimited=function(e,r){var i=!1;e||(e=new t,i=!0);var a=(new t).LE();return n.encode(this,a,r).flip(),e.writeVarint32(a.remaining()),e.append(a),i?e.flip():e},s.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},s.toArrayBuffer=s.encodeAB,s.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},s.toBuffer=s.encodeNB,s.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},s.toBase64=s.encode64,s.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},s.toHex=s.encodeHex,s.toRaw=function(e,t){return r(this,!!e,!!t,this.$type)},s.encodeJSON=function(){return JSON.stringify(r(this,!0,!0,this.$type))},o.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 a=e.littleEndian;try{var o=n.decode(e.LE());return e.LE(a),o}catch(t){throw e.LE(a),t}},o.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,a=e.readVarint32();if(e.remaining()<a)return e.offset=i,null;try{var o=n.decode(e.slice(e.offset,e.offset+a).LE());return e.offset+=a,o}catch(t){throw e.offset+=a,t}},o.decode64=function(e){return o.decode(e,"base64")},o.decodeHex=function(e){return o.decode(e,"hex")},o.decodeJSON=function(e){return new o(JSON.parse(e))},s.toString=function(){return n.toString()};return Object.defineProperty&&(Object.defineProperty(o,"$options",{value:n.buildOpt()}),Object.defineProperty(s,"$options",{value:o.$options}),Object.defineProperty(o,"$type",{value:n}),Object.defineProperty(s,"$type",{value:n})),o}(e,this);this._fields=[],this._fieldsById={},this._fieldsByName={};for(var i,a=0,o=this.children.length;a<o;a++)if(i=this.children[a],i instanceof y||i instanceof c||i instanceof T){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 c.Field)i.build(),this._fields.push(i),this._fieldsById[i.id]=i,this._fieldsByName[i.name]=i;else if(!(i instanceof c.OneOf||i instanceof v))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[a].toString(!0));return this.clazz=r},h.encode=function(e,t,n){for(var r,i,a=null,o=0,s=this._fields.length;o<s;++o)r=this._fields[o],i=e[r.name],r.required&&null===i?null===a&&(a=r):r.encode(n?i:r.verifyValue(i),t,e);if(null!==a){var u=Error("Missing at least one required field for "+this.toString(!0)+": "+a);throw u.encoded=t,u}return t},h.calculate=function(e){for(var t,n,r=0,i=0,a=this._fields.length;i<a;++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},h.decode=function(t,n,r){n="number"==typeof n?n:-1;for(var a,o,s,u,l=t.offset,f=new this.clazz;t.offset<l+n||n===-1&&t.remaining()>0;){if(a=t.readVarint32(),o=7&a,s=a>>>3,o===e.WIRE_TYPES.ENDGROUP){if(s!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+s+" ("+(r?r+" expected":"not a group")+")");break}if(u=this._fieldsById[s]){if(u.repeated&&!u.options.packed)f[u.name].push(u.decode(o,t));else if(u.map){var d=u.decode(o,t);f[u.name].set(d[0],d[1])}else if(f[u.name]=u.decode(o,t),u.oneof){var c=f[u.oneof.name];null!==c&&c!==u.name&&(f[c]=null),f[u.oneof.name]=u.name}}else switch(o){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 h=t.readVarint32();t.offset+=h;break;case e.WIRE_TYPES.STARTGROUP:for(;i(s,t););break;default:throw Error("Illegal wire type for unknown field "+s+" in "+this.toString(!0)+"#decode: "+o)}}for(var p=0,_=this._fields.length;p<_;++p)if(u=this._fields[p],null===f[u.name])if("proto3"===this.syntax)f[u.name]=u.defaultValue;else{if(u.required){var E=Error("Missing at least one required field for "+this.toString(!0)+": "+u.name);throw E.decoded=f,E}e.populateDefaults&&null!==u.defaultValue&&(f[u.name]=u.defaultValue)}return f},a.Message=c;var p=function(t,n,r,i,a,s,u,l,f,d){o.call(this,t,n,s),this.className="Message.Field",this.required="required"===r,this.repeated="repeated"===r,this.map="map"===r,this.keyType=i||null,this.type=a,this.resolvedType=null,this.id=u,this.options=l||{},this.defaultValue=null,this.oneof=f||null,this.syntax=d||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof c.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},_=p.prototype=Object.create(o.prototype);_.build=function(){this.element=new f(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new f(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=f.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 a;if(this.repeated&&!n){Array.isArray(t)||(t=[t]);var o=[];for(a=0;a<t.length;a++)o.push(this.element.verifyValue(t[a]));return o}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 a;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 o=r.offset;for(a=0;a<n.length;a++)this.element.encodeValue(this.id,n[a],r);var s=r.offset-o,u=t.calculateVarint32(s);if(u>1){var l=r.slice(o,r.offset);o+=u-1,r.offset=o,r.append(l)}r.writeVarint32(s,o-u)}else for(a=0;a<n.length;a++)r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,n[a],r)}else this.map?n.forEach(function(n,i,a){var o=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(o),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 a,o;if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(i+=t.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),o=0,a=0;a<n.length;a++)o+=this.element.calculateLength(this.id,n[a]);i+=t.calculateVarint32(o),i+=o}else for(a=0;a<n.length;a++)i+=t.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,n[a])}else this.map?n.forEach(function(n,r,a){var o=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(o),i+=o},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,a,o=!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(!o)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){a=n.readVarint32(),a=n.offset+a;for(var s=[];n.offset<a;)s.push(this.decode(this.type.wireType,n,!0));return s}if(this.map){var u=f.defaultFieldValue(this.keyType);if(i=f.defaultFieldValue(this.type),a=n.readVarint32(),n.remaining()<a)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+a+" required but got only "+n.remaining());var l=n.clone();for(l.limit=l.offset+a,n.offset+=a;l.remaining()>0;){var d=l.readVarint32();t=7&d;var c=d>>>3;if(1===c)u=this.keyElement.decode(l,t,c);else{if(2!==c)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(l,t,c)}}return[u,i]}return this.element.decode(n,t,this.id)},a.Message.Field=p;var E=function(e,t,n,r,i,a,o){p.call(this,e,t,n,null,r,i,a,o),this.extension};E.prototype=Object.create(p.prototype),a.Message.ExtensionField=E;var g=function(e,t,n){o.call(this,e,t,n),this.fields=[]};a.Message.OneOf=g;var y=function(e,t,n,r,i){u.call(this,e,t,n,r,i),this.className="Enum",this.object=null};y.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 R=y.prototype=Object.create(u.prototype);R.build=function(t){if(this.object&&!t)return this.object;for(var n=new e.Builder.Enum,r=this.getChildren(y.Value),i=0,a=r.length;i<a;++i)n[r[i].name]=r[i].id;return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=n},a.Enum=y;var m=function(e,t,n,r){o.call(this,e,t,n),this.className="Enum.Value",this.id=r};m.prototype=Object.create(o.prototype),a.Enum.Value=m;var v=function(e,t,n,r){o.call(this,e,t,n),this.field=r};v.prototype=Object.create(o.prototype),a.Extension=v;var T=function(e,t,n,r){u.call(this,e,t,n,r),this.className="Service",this.clazz=null},C=T.prototype=Object.create(u.prototype);C.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),a=n.getChildren(e.Reflect.Service.RPCMethod),o=0;o<a.length;o++)!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}))}(a[o]);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)},a.Service=T;var S=function(e,t,n,r){o.call(this,e,t,n),this.className="Service.Method",this.options=r||{}},I=S.prototype=Object.create(o.prototype);I.buildOpt=l.buildOpt,a.Service.Method=S;var A=function(e,t,n,r,i,a,o,s){S.call(this,e,t,n,s),this.className="Service.RPCMethod",this.requestName=r,this.responseName=i,this.requestStream=a,this.responseStream=o,this.resolvedRequestType=null,this.resolvedResponseType=null};return A.prototype=Object.create(S.prototype),a.Service.RPCMethod=A,a}(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 a=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||{}},o=a.prototype;return a.isMessage=function(e){return"string"==typeof e.name&&("undefined"==typeof e.values&&"undefined"==typeof e.rpc)},a.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&"undefined"!=typeof e.id},a.isEnum=function(e){return"string"==typeof e.name&&!("undefined"==typeof e.values||!Array.isArray(e.values)||0===e.values.length)},a.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},a.isExtend=function(e){return"string"==typeof e.ref},o.reset=function(){return this.ptr=this.ns,this},o.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},o.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(a.isMessage(i)){var o=new r.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax),s={};i.oneofs&&Object.keys(i.oneofs).forEach(function(e){o.addChild(s[e]=new r.Message.OneOf(this,o,e))},this),i.fields&&i.fields.forEach(function(e){if(null!==o.getChild(0|e.id))throw Error("duplicate or invalid field id in "+o.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+o.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=s[e.oneof]))throw Error("illegal oneof in "+o.name+"#"+e.name+": "+e.oneof);e=new r.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),t&&t.fields.push(e),o.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]?o.extensions=[i.extensions]:o.extensions=i.extensions),this.ptr.addChild(o),u.length>0){n.push(t),t=u,u=null,this.ptr=o,o=null;continue}u=null}else if(a.isEnum(i))o=new r.Enum(this,this.ptr,i.name,i.options,i.syntax),i.values.forEach(function(e){o.addChild(new r.Enum.Value(this,o,e.name,e.id))},this),this.ptr.addChild(o);else if(a.isService(i))o=new r.Service(this,this.ptr,i.name,i.options),Object.keys(i.rpc).forEach(function(e){var t=i.rpc[e];o.addChild(new r.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))},this),this.ptr.addChild(o);else{if(!a.isExtend(i))throw Error("not a valid definition: "+JSON.stringify(i));if(o=this.ptr.resolve(i.ref,!0))i.fields.forEach(function(t){if(null!==o.getChild(0|t.id))throw Error("duplicate extended field id in "+o.name+": "+t.id);if(o.extensions){var n=!1;if(o.extensions.forEach(function(e){t.id>=e[0]&&t.id<=e[1]&&(n=!0)}),!n)throw Error("illegal extended field id in "+o.name+": "+t.id+" (not within valid ranges)")}var i=t.name;this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i));var a=new r.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),s=new r.Extension(this,this.ptr,t.name,a);a.extension=s,this.ptr.addChild(s),o.addChild(a)},this);else if(!/\.?google\.protobuf\./.test(i.ref))throw Error("extended message "+i.ref+" is not defined"); +}i=null,o=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},o.import=function(t,r){var a="/";if("string"==typeof r){if(e.Util.IS_NODE&&(r=n(32).resolve(r)),this.files[r]===!0)return this.reset();this.files[r]=!0}else if("object"==typeof r){var o=r.root;e.Util.IS_NODE&&(o=n(32).resolve(o)),(o.indexOf("\\")>=0||r.file.indexOf("\\")>=0)&&(a="\\");var s=o+a+r.file;if(this.files[s]===!0)return this.reset();this.files[s]=!0}if(t.imports&&t.imports.length>0){var u,l=!1;"object"==typeof r?(this.importRoot=r.root,l=!0,u=this.importRoot,r=r.file,(u.indexOf("\\")>=0||r.indexOf("\\")>=0)&&(a="\\")):"string"==typeof r?this.importRoot?u=this.importRoot:r.indexOf("/")>=0?(u=r.replace(/\/[^\/]*$/,""),""===u&&(u="/")):r.indexOf("\\")>=0?(u=r.replace(/\\[^\\]*$/,""),a="\\"):u=".":u=null;for(var f=0;f<t.imports.length;f++)if("string"==typeof t.imports[f]){if(!u)throw Error("cannot determine import root");var d=t.imports[f];if("google/protobuf/descriptor.proto"===d)continue;if(d=u+a+d,this.files[d]===!0)continue;/\.proto$/i.test(d)&&!e.DotProto&&(d=d.replace(/\.proto$/,".json"));var c=e.Util.fetch(d);if(null===c)throw Error("failed to import '"+d+"' in '"+r+"': file not found");/\.json$/i.test(d)?this.import(JSON.parse(c+""),d):this.import(e.DotProto.Parser.parse(c),d)}else r?/\.(\w+)$/.test(r)?this.import(t.imports[f],r.replace(/^(.+)\.(\w+)$/,function(e,t,n){return t+"_import"+f+"."+n})):this.import(t.imports[f],r+"_import"+f):this.import(t.imports[f]);l&&(this.importRoot=null)}t.package&&this.define(t.package),t.syntax&&i(t);var h=this.ptr;return t.options&&Object.keys(t.options).forEach(function(e){h.options[e]=t.options[e]}),t.messages&&(this.create(t.messages),this.ptr=h),t.enums&&(this.create(t.enums),this.ptr=h),t.services&&(this.create(t.services),this.ptr=h),t.extends&&this.create(t.extends),this.reset()},o.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()},o.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},o.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},o.toString=function(){return"Builder"},a.Message=function(){},a.Enum=function(){},a.Service=function(){},a}(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 a=this.keyElem.valueFromString(r[i]),o=this.valueElem.verifyValue(n[r[i]]);this.map[this.keyElem.valueToString(a)]={key:a,value:o}}},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(23),n(9)(e))},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,a=t.charCodeAt(r);return a>=55296&&a<=56319&&n>r+1&&(i=t.charCodeAt(r+1),i>=56320&&i<=57343)?1024*(a-55296)+i-56320+65536:a}};e?e(String.prototype,"codePointAt",{value:t,configurable:!0,writable:!0}):String.prototype.codePointAt=t}()},function(e,t){!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function r(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return _.iterable&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(e,t){this.append(t,e)},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function a(e){return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function o(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function s(e){var t=new FileReader;return t.readAsArrayBuffer(e),o(t)}function u(e){var t=new FileReader;return t.readAsText(e),o(t)}function l(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,"string"==typeof e)this._bodyText=e;else if(_.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(_.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(_.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(e){if(!_.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e))throw new Error("unsupported BodyInit type")}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):_.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},_.blob?(this.blob=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(s)},this.text=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return u(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var e=a(this);return e?e:Promise.resolve(this._bodyText)},_.formData&&(this.formData=function(){return this.text().then(c)}),this.json=function(){return this.text().then(JSON.parse)},this}function f(e){var t=e.toUpperCase();return E.indexOf(t)>-1?t:e}function d(e,t){t=t||{};var n=t.body;if(d.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,n||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=e;if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new i(t.headers)),this.method=f(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function c(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function h(e){var t=new i,n=(e.getAllResponseHeaders()||"").trim().split("\n");return n.forEach(function(e){var n=e.trim().split(":"),r=n.shift().trim(),i=n.join(":").trim();t.append(r,i)}),t}function p(e,t){t||(t={}),this.type="default",this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof i?t.headers:new i(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var _={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};i.prototype.append=function(e,r){e=t(e),r=n(r);var i=this.map[e];i||(i=[],this.map[e]=i),i.push(r)},i.prototype.delete=function(e){delete this.map[t(e)]},i.prototype.get=function(e){var n=this.map[t(e)];return n?n[0]:null},i.prototype.getAll=function(e){return this.map[t(e)]||[]},i.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},i.prototype.set=function(e,r){this.map[t(e)]=[n(r)]},i.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach(function(n){this.map[n].forEach(function(r){e.call(t,r,n,this)},this)},this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),r(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),r(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),r(e)},_.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);var E=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];d.prototype.clone=function(){return new d(this)},l.call(d.prototype),l.call(p.prototype),p.prototype.clone=function(){return new p(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},p.error=function(){var e=new p(null,{status:0,statusText:""});return e.type="error",e};var g=[301,302,303,307,308];p.redirect=function(e,t){if(g.indexOf(t)===-1)throw new RangeError("Invalid status code");return new p(null,{status:t,headers:{location:e}})},e.Headers=i,e.Request=d,e.Response=p,e.fetch=function(e,t){return new Promise(function(n,r){function i(){return"responseURL"in o?o.responseURL:/^X-Request-URL:/m.test(o.getAllResponseHeaders())?o.getResponseHeader("X-Request-URL"):void 0}var a;a=d.prototype.isPrototypeOf(e)&&!t?e:new d(e,t);var o=new XMLHttpRequest;o.onload=function(){var e={status:o.status,statusText:o.statusText,headers:h(o),url:i()},t="response"in o?o.response:o.responseText;n(new p(t,e))},o.onerror=function(){r(new TypeError("Network request failed"))},o.ontimeout=function(){r(new TypeError("Network request failed"))},o.open(a.method,a.url,!0),"include"===a.credentials&&(o.withCredentials=!0),"responseType"in o&&_.blob&&(o.responseType="blob"),a.headers.forEach(function(e,t){o.setRequestHeader(t,e)}),o.send("undefined"==typeof a._bodyInit?null:a._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},32,32]))}); \ No newline at end of file diff --git a/src/EngineEntrance.js b/src/EngineEntrance.js index a87f6fc..0243119 100644 --- a/src/EngineEntrance.js +++ b/src/EngineEntrance.js @@ -27,7 +27,7 @@ import Server from "config/Server"; import UTF8 from 'utf-8'; let loger = Loger.getLoger('McuClient'); -let _sdkInfo = {"version": "v1.16.1.201705010", "author": "www.3mang.com"}; +let _sdkInfo = {"version": "v1.17.0.201705010", "author": "www.3mang.com"}; //APE let _sass; @@ -189,8 +189,14 @@ export default class MessageEntrance extends Emiter { this.setMessageDelay = this._setMessageDelay.bind(this);//设置是否延迟消息 this.switchServer = this._switchMcuIpHandler.bind(this);//切换mcu服务器 this.switchMediaServer = this._switchMsIpHandler.bind(this);//切换ms服务器 + this.setDebugInfo= this._setDebugInfo.bind(this);//设置debug信息 + } + _setDebugInfo(_data){ + loger.log("设置debug信息-->", _data); + if(_data){ + Loger.IS_DEBUG=_data.isDebug; + } } - //设置设备信息 _setDeviceInfo(_data) { loger.log("设置设备信息-->", _data); diff --git a/src/Loger.js b/src/Loger.js index 7f9e50c..052dfda 100644 --- a/src/Loger.js +++ b/src/Loger.js @@ -58,8 +58,10 @@ class Loger { this._log(Loger.DATA, msg); } _log(type, msg) { + if(!Loger.IS_DEBUG){ + return; + } msg = JSON.stringify(msg); - let logMsg = `${this.id} -> ${msg}`; if (type >= Loger.logLevel) { switch (type) { @@ -79,7 +81,7 @@ class Loger { } } } - +Loger.IS_DEBUG=true; Loger.LOG = 0; Loger.WARN = 1; Loger.ERROR = 2; diff --git a/src/apes/AudioApe.js b/src/apes/AudioApe.js index 57fcc2e..828bb41 100644 --- a/src/apes/AudioApe.js +++ b/src/apes/AudioApe.js @@ -53,6 +53,21 @@ class AudioApe extends Ape { loger.warn(GlobalConfig.getCurrentStatus()); return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"};; } + //需要判断当前已经使用的流路数 + let openChannel=0; + let allChannels= MediaModule.allMediaChannelsList; + for(let i in allChannels){ + let channel=allChannels[i]; + if(channel&&channel.status==ApeConsts.CHANNEL_STATUS_OPENING){ + openChannel++; + } + } + //如果已经开启的数量大于等于最大允许开启的数量,不允许再推流 + if(openChannel>=GlobalConfig.maxMediaChannels){ + loger.warn('不能再打开设备->当前开启的设备数量->',openChannel); + return {"code": ApeConsts.RETURN_FAILED, "data": "不能再打开设备,当前开启的设备数量"}; + } + let result=this.mediaModule.getMediaPublishPath(_param); this._emit( MessageTypes.AUDIO_GET_PUBLISH_PATH,result); return result; diff --git a/src/apes/MediaModule.js b/src/apes/MediaModule.js index 7f33f4f..4fcc072 100644 --- a/src/apes/MediaModule.js +++ b/src/apes/MediaModule.js @@ -209,6 +209,6 @@ class MediaModule { return channelInfo; } } - +MediaModule.allMediaChannelsList={};//当前已经创建的所有音视频通道(包含释放或未未释放的) export default MediaModule; diff --git a/src/apes/VideoApe.js b/src/apes/VideoApe.js index 618aafb..0de7924 100644 --- a/src/apes/VideoApe.js +++ b/src/apes/VideoApe.js @@ -51,8 +51,23 @@ class VideoApe extends Ape { loger.log('获取推流地址->'); if(!this.mcu.connected){ loger.warn(GlobalConfig.getCurrentStatus()); - return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"};; + return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"}; + } + //需要判断当前已经使用的流路数 + let openChannel=0; + let allChannels= MediaModule.allMediaChannelsList; + for(let i in allChannels){ + let channel=allChannels[i]; + if(channel&&channel.status==ApeConsts.CHANNEL_STATUS_OPENING){ + openChannel++; + } } + //如果已经开启的数量大于等于最大允许开启的数量,不允许再推流 + if(openChannel>=GlobalConfig.maxMediaChannels){ + loger.warn('不能再打开设备->当前开启的设备数量->',openChannel); + return {"code": ApeConsts.RETURN_FAILED, "data": "不能再打开设备,当前开启的设备数量"}; + } + let result=this.mediaModule.getMediaPublishPath(_param); this._emit( MessageTypes.VIDEO_GET_PUBLISH_PATH,result); return result; @@ -396,6 +411,8 @@ class VideoApe extends Ape { }); } + MediaModule.allMediaChannelsList[itemIdx]=unpackChannelInfo; + console.log('MediaModule.allMediaChannelsList',MediaModule.allMediaChannelsList); this._emit(MessageTypes.VIDEO_UPDATE, unpackChannelInfo); } -- libgit2 0.24.0