forked from simplewebrtc/SimpleWebRTC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlatest.js
5 lines (5 loc) · 140 KB
/
latest.js
1
2
3
4
5
!function(e){if("function"==typeof bootstrap)bootstrap("simplewebrtc",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeSimpleWebRTC=e}else"undefined"!=typeof window?window.SimpleWebRTC=e():global.SimpleWebRTC=e()}(function(){var define,ses,bootstrap,module,exports;return function(e,t,n){function o(n,r){if(!t[n]){if(!e[n]){var s="function"==typeof require&&require;if(!r&&s)return s(n,!0);if(i)return i(n,!0);throw new Error("Cannot find module '"+n+"'")}var a=t[n]={exports:{}};e[n][0].call(a.exports,function(t){var i=e[n][1][t];return o(i?i:t)},a,a.exports)}return t[n].exports}for(var i="function"==typeof require&&require,r=0;r<n.length;r++)o(n[r]);return o}({1:[function(e,t){function n(e){var t,n,u=this,p=e||{},l=this.config={url:"https://signaling.simplewebrtc.com",socketio:{},debug:!1,localVideoEl:"",remoteVideosEl:"",enableDataChannels:!0,autoRequestMedia:!1,autoRemoveVideos:!0,adjustPeerVolume:!0,peerVolumeWhenSpeaking:.25,media:{video:!0,audio:!0},localVideo:{autoplay:!0,mirror:!0,muted:!0}};this.logger=function(){return e.debug?e.logger||console:e.logger||a}();for(t in p)this.config[t]=p[t];this.capabilities=r,i.call(this),n=this.connection=c.connect(this.config.url,this.config.socketio),n.on("connect",function(){u.emit("connectionReady",n.socket.sessionid),u.sessionReady=!0,u.testReadiness()}),n.on("message",function(e){var t,n=u.webrtc.getPeers(e.from,e.roomType);"offer"===e.type?(t=n.length?n[0]:u.webrtc.createPeer({id:e.from,type:e.roomType,enableDataChannels:u.config.enableDataChannels&&"screen"!==e.roomType,sharemyscreen:"screen"===e.roomType&&!e.broadcaster,broadcaster:"screen"!==e.roomType||e.broadcaster?null:u.connection.socket.sessionid}),t.handleMessage(e)):n.length&&n.forEach(function(t){t.handleMessage(e)})}),n.on("remove",function(e){e.id!==u.connection.socket.sessionid&&u.webrtc.removePeers(e.id,e.type)}),e.logger=this.logger,e.debug=!1,this.webrtc=new o(e),["mute","unmute","pauseVideo","resumeVideo","pause","resume","sendToAll","sendDirectlyToAll"].forEach(function(e){u[e]=u.webrtc[e].bind(u.webrtc)}),this.webrtc.on("*",function(){u.emit.apply(u,arguments)}),l.debug&&this.on("*",this.logger.log.bind(this.logger,"SimpleWebRTC event:")),this.webrtc.on("localStream",function(){u.testReadiness()}),this.webrtc.on("message",function(e){u.connection.emit("message",e)}),this.webrtc.on("peerStreamAdded",this.handlePeerStreamAdded.bind(this)),this.webrtc.on("peerStreamRemoved",this.handlePeerStreamRemoved.bind(this)),this.config.adjustPeerVolume&&(this.webrtc.on("speaking",this.setVolumeForAll.bind(this,this.config.peerVolumeWhenSpeaking)),this.webrtc.on("stoppedSpeaking",this.setVolumeForAll.bind(this,1))),n.on("stunservers",function(e){u.webrtc.config.peerConnectionConfig.iceServers=e,u.emit("stunservers",e)}),n.on("turnservers",function(e){u.webrtc.config.peerConnectionConfig.iceServers=u.webrtc.config.peerConnectionConfig.iceServers.concat(e),u.emit("turnservers",e)}),this.webrtc.on("iceFailed",function(){}),this.webrtc.on("connectivityError",function(){}),this.webrtc.on("audioOn",function(){u.webrtc.sendToAll("unmute",{name:"audio"})}),this.webrtc.on("audioOff",function(){u.webrtc.sendToAll("mute",{name:"audio"})}),this.webrtc.on("videoOn",function(){u.webrtc.sendToAll("unmute",{name:"video"})}),this.webrtc.on("videoOff",function(){u.webrtc.sendToAll("mute",{name:"video"})}),this.webrtc.on("localScreen",function(e){var t=document.createElement("video"),n=u.getRemoteVideoContainer();t.oncontextmenu=function(){return!1},t.id="localScreen",s(e,t),n&&n.appendChild(t),u.emit("localScreenAdded",t),u.connection.emit("shareScreen"),u.webrtc.peers.forEach(function(e){var t;"video"===e.type&&(t=u.webrtc.createPeer({id:e.id,type:"screen",sharemyscreen:!0,enableDataChannels:!1,receiveMedia:{mandatory:{OfferToReceiveAudio:!1,OfferToReceiveVideo:!1}},broadcaster:u.connection.socket.sessionid}),t.start())})}),this.webrtc.on("localScreenStopped",function(){u.stopScreenShare()}),this.config.autoRequestMedia&&this.startLocalVideo()}var o=e("webrtc"),i=e("wildemitter"),r=e("webrtcsupport"),s=e("attachmediastream"),a=e("mockconsole"),c=e("socket.io-client");n.prototype=Object.create(i.prototype,{constructor:{value:n}}),n.prototype.leaveRoom=function(){this.roomName&&(this.connection.emit("leave"),this.webrtc.peers.forEach(function(e){e.end()}),this.getLocalScreen()&&this.stopScreenShare(),this.emit("leftRoom",this.roomName),this.roomName=void 0)},n.prototype.disconnect=function(){this.connection.disconnect(),delete this.connection},n.prototype.handlePeerStreamAdded=function(e){var t=this,n=this.getRemoteVideoContainer(),o=s(e.stream);e.videoEl=o,o.id=this.getDomId(e),n&&n.appendChild(o),this.emit("videoAdded",o,e),window.setTimeout(function(){t.webrtc.isAudioEnabled()||e.send("mute",{name:"audio"}),t.webrtc.isVideoEnabled()||e.send("mute",{name:"video"})},250)},n.prototype.handlePeerStreamRemoved=function(e){var t=this.getRemoteVideoContainer(),n=e.videoEl;this.config.autoRemoveVideos&&t&&n&&t.removeChild(n),n&&this.emit("videoRemoved",n,e)},n.prototype.getDomId=function(e){return[e.id,e.type,e.broadcaster?"broadcasting":"incoming"].join("_")},n.prototype.setVolumeForAll=function(e){this.webrtc.peers.forEach(function(t){t.videoEl&&(t.videoEl.volume=e)})},n.prototype.joinRoom=function(e,t){var n=this;this.roomName=e,this.connection.emit("join",e,function(o,i){if(o)n.emit("error",o);else{var r,s,a,c;for(r in i.clients){s=i.clients[r];for(a in s)s[a]&&(c=n.webrtc.createPeer({id:r,type:a,enableDataChannels:n.config.enableDataChannels&&"screen"!==a,receiveMedia:{mandatory:{OfferToReceiveAudio:"screen"!==a,OfferToReceiveVideo:!0}}}),c.start())}}t&&t(o,i),n.emit("joinedRoom",e)})},n.prototype.getEl=function(e){return"string"==typeof e?document.getElementById(e):e},n.prototype.startLocalVideo=function(){var e=this;this.webrtc.startLocalMedia(this.config.media,function(t,n){t?e.emit("localMediaError",t):s(n,e.getLocalVideoContainer(),e.config.localVideo)})},n.prototype.stopLocalVideo=function(){this.webrtc.stopLocalMedia()},n.prototype.getLocalVideoContainer=function(){var e=this.getEl(this.config.localVideoEl);if(e&&"VIDEO"===e.tagName)return e.oncontextmenu=function(){return!1},e;if(e){var t=document.createElement("video");return t.oncontextmenu=function(){return!1},e.appendChild(t),t}},n.prototype.getRemoteVideoContainer=function(){return this.getEl(this.config.remoteVideosEl)},n.prototype.shareScreen=function(e){this.webrtc.startScreenShare(e)},n.prototype.getLocalScreen=function(){return this.webrtc.localScreen},n.prototype.stopScreenShare=function(){this.connection.emit("unshareScreen");var e=document.getElementById("localScreen"),t=this.getRemoteVideoContainer(),n=this.getLocalScreen();this.config.autoRemoveVideos&&t&&e&&t.removeChild(e),e&&this.emit("videoRemoved",e),n&&n.stop(),this.webrtc.peers.forEach(function(e){e.broadcaster&&e.end()})},n.prototype.testReadiness=function(){var e=this;this.webrtc.localStream&&this.sessionReady&&e.emit("readyToCall",e.connection.socket.sessionid)},n.prototype.createRoom=function(e,t){2===arguments.length?this.connection.emit("create",e,t):this.connection.emit("create",e)},n.prototype.sendFile=function(){return r.dataChannel?void 0:this.emit("error",new Error("DataChannelNotSupported"))},t.exports=n},{attachmediastream:5,mockconsole:3,"socket.io-client":7,webrtc:6,webrtcsupport:4,wildemitter:2}],2:[function(e,t){function n(){this.callbacks={}}t.exports=n,n.prototype.on=function(e){var t=3===arguments.length,n=t?arguments[1]:void 0,o=t?arguments[2]:arguments[1];return o._groupName=n,(this.callbacks[e]=this.callbacks[e]||[]).push(o),this},n.prototype.once=function(e){function t(){n.off(e,t),r.apply(this,arguments)}var n=this,o=3===arguments.length,i=o?arguments[1]:void 0,r=o?arguments[2]:arguments[1];return this.on(e,i,t),this},n.prototype.releaseGroup=function(e){var t,n,o,i;for(t in this.callbacks)for(i=this.callbacks[t],n=0,o=i.length;o>n;n++)i[n]._groupName===e&&(i.splice(n,1),n--,o--);return this},n.prototype.off=function(e,t){var n,o=this.callbacks[e];return o?1===arguments.length?(delete this.callbacks[e],this):(n=o.indexOf(t),o.splice(n,1),this):this},n.prototype.emit=function(e){var t,n,o,i=[].slice.call(arguments,1),r=this.callbacks[e],s=this.getWildcardCallbacks(e);if(r)for(o=r.slice(),t=0,n=o.length;n>t&&o[t];++t)o[t].apply(this,i);if(s)for(n=s.length,o=s.slice(),t=0,n=o.length;n>t&&o[t];++t)o[t].apply(this,[e].concat(i));return this},n.prototype.getWildcardCallbacks=function(e){var t,n,o=[];for(t in this.callbacks)n=t.split("*"),("*"===t||2===n.length&&e.slice(0,n[0].length)===n[0])&&(o=o.concat(this.callbacks[t]));return o}},{}],3:[function(e,t){for(var n="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),o=n.length,i=function(){},r={};o--;)r[n[o]]=i;t.exports=r},{}],4:[function(e,t){var n,o=!1,i=!1,r=window.navigator.userAgent.toLowerCase();-1!==r.indexOf("firefox")?(n="moz",i=!0):-1!==r.indexOf("chrome")&&(n="webkit",o=!0);var s=window.mozRTCPeerConnection||window.webkitRTCPeerConnection,a=window.mozRTCIceCandidate||window.RTCIceCandidate,c=window.mozRTCSessionDescription||window.RTCSessionDescription,u=window.webkitMediaStream||window.MediaStream,p="https:"===window.location.protocol&&(window.navigator.userAgent.match("Chrome")&&parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1],10)>=26||window.navigator.userAgent.match("Firefox")&&parseInt(window.navigator.userAgent.match(/Firefox\/(.*)/)[1],10)>=33),l=window.webkitAudioContext||window.AudioContext;t.exports={support:!!s,dataChannel:o||i||s&&s.prototype&&s.prototype.createDataChannel,prefix:n,webAudio:!(!l||!l.prototype.createMediaStreamSource),mediaStream:!(!u||!u.prototype.removeTrack),screenSharing:!!p,AudioContext:l,PeerConnection:s,SessionDescription:c,IceCandidate:a,MediaStream:u}},{}],5:[function(e,t){t.exports=function(e,t,n){var o,i=window.URL,r={autoplay:!0,mirror:!1,muted:!1},s=t||document.createElement("video");if(n)for(o in n)r[o]=n[o];if(r.autoplay&&(s.autoplay="autoplay"),r.muted&&(s.muted=!0),r.mirror&&["","moz","webkit","o","ms"].forEach(function(e){var t=e?e+"Transform":"transform";s.style[t]="scaleX(-1)"}),i&&i.createObjectURL)s.src=i.createObjectURL(e);else if(s.srcObject)s.srcObject=e;else{if(!s.mozSrcObject)return!1;s.mozSrcObject=e}return s}},{}],7:[function(require,module,exports){var io="undefined"==typeof module?{}:module.exports;!function(){if(function(e,t){var n=e;n.version="0.9.16",n.protocol=1,n.transports=[],n.j=[],n.sockets={},n.connect=function(e,o){var i,r,s=n.util.parseUri(e);t&&t.location&&(s.protocol=s.protocol||t.location.protocol.slice(0,-1),s.host=s.host||(t.document?t.document.domain:t.location.hostname),s.port=s.port||t.location.port),i=n.util.uniqueUri(s);var a={host:s.host,secure:"https"==s.protocol,port:s.port||("https"==s.protocol?443:80),query:s.query||""};return n.util.merge(a,o),(a["force new connection"]||!n.sockets[i])&&(r=new n.Socket(a)),!a["force new connection"]&&r&&(n.sockets[i]=r),r=r||n.sockets[i],r.of(s.path.length>1?s.path:"")}}("object"==typeof module?module.exports:this.io={},this),function(e,t){var n=e.util={},o=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,i=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];n.parseUri=function(e){for(var t=o.exec(e||""),n={},r=14;r--;)n[i[r]]=t[r]||"";return n},n.uniqueUri=function(e){var n=e.protocol,o=e.host,i=e.port;return"document"in t?(o=o||document.domain,i=i||("https"==n&&"https:"!==document.location.protocol?443:document.location.port)):(o=o||"localhost",i||"https"!=n||(i=443)),(n||"http")+"://"+o+":"+(i||80)},n.query=function(e,t){var o=n.chunkQuery(e||""),i=[];n.merge(o,n.chunkQuery(t||""));for(var r in o)o.hasOwnProperty(r)&&i.push(r+"="+o[r]);return i.length?"?"+i.join("&"):""},n.chunkQuery=function(e){for(var t,n={},o=e.split("&"),i=0,r=o.length;r>i;++i)t=o[i].split("="),t[0]&&(n[t[0]]=t[1]);return n};var r=!1;n.load=function(e){return"document"in t&&"complete"===document.readyState||r?e():(n.on(t,"load",e,!1),void 0)},n.on=function(e,t,n,o){e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener&&e.addEventListener(t,n,o)},n.request=function(e){if(e&&"undefined"!=typeof XDomainRequest&&!n.ua.hasCORS)return new XDomainRequest;if("undefined"!=typeof XMLHttpRequest&&(!e||n.ua.hasCORS))return new XMLHttpRequest;if(!e)try{return new(window[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}return null},"undefined"!=typeof window&&n.load(function(){r=!0}),n.defer=function(e){return n.ua.webkit&&"undefined"==typeof importScripts?(n.load(function(){setTimeout(e,100)}),void 0):e()},n.merge=function(e,t,o,i){var r,s=i||[],a="undefined"==typeof o?2:o;for(r in t)t.hasOwnProperty(r)&&n.indexOf(s,r)<0&&("object"==typeof e[r]&&a?n.merge(e[r],t[r],a-1,s):(e[r]=t[r],s.push(t[r])));return e},n.mixin=function(e,t){n.merge(e.prototype,t.prototype)},n.inherit=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n},n.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},n.intersect=function(e,t){for(var o=[],i=e.length>t.length?e:t,r=e.length>t.length?t:e,s=0,a=r.length;a>s;s++)~n.indexOf(i,r[s])&&o.push(r[s]);return o},n.indexOf=function(e,t,n){for(var o=e.length,n=0>n?0>n+o?0:n+o:n||0;o>n&&e[n]!==t;n++);return n>=o?-1:n},n.toArray=function(e){for(var t=[],n=0,o=e.length;o>n;n++)t.push(e[n]);return t},n.ua={},n.ua.hasCORS="undefined"!=typeof XMLHttpRequest&&function(){try{var e=new XMLHttpRequest}catch(t){return!1}return void 0!=e.withCredentials}(),n.ua.webkit="undefined"!=typeof navigator&&/webkit/i.test(navigator.userAgent),n.ua.iDevice="undefined"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)}("undefined"!=typeof io?io:module.exports,this),function(e,t){function n(){}e.EventEmitter=n,n.prototype.on=function(e,n){return this.$events||(this.$events={}),this.$events[e]?t.util.isArray(this.$events[e])?this.$events[e].push(n):this.$events[e]=[this.$events[e],n]:this.$events[e]=n,this},n.prototype.addListener=n.prototype.on,n.prototype.once=function(e,t){function n(){o.removeListener(e,n),t.apply(this,arguments)}var o=this;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,n){if(this.$events&&this.$events[e]){var o=this.$events[e];if(t.util.isArray(o)){for(var i=-1,r=0,s=o.length;s>r;r++)if(o[r]===n||o[r].listener&&o[r].listener===n){i=r;break}if(0>i)return this;o.splice(i,1),o.length||delete this.$events[e]}else(o===n||o.listener&&o.listener===n)&&delete this.$events[e]}return this},n.prototype.removeAllListeners=function(e){return void 0===e?(this.$events={},this):(this.$events&&this.$events[e]&&(this.$events[e]=null),this)},n.prototype.listeners=function(e){return this.$events||(this.$events={}),this.$events[e]||(this.$events[e]=[]),t.util.isArray(this.$events[e])||(this.$events[e]=[this.$events[e]]),this.$events[e]},n.prototype.emit=function(e){if(!this.$events)return!1;var n=this.$events[e];if(!n)return!1;var o=Array.prototype.slice.call(arguments,1);if("function"==typeof n)n.apply(this,o);else{if(!t.util.isArray(n))return!1;for(var i=n.slice(),r=0,s=i.length;s>r;r++)i[r].apply(this,o)}return!0}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(exports,nativeJSON){"use strict";function f(e){return 10>e?"0"+e:e}function date(e){return isFinite(e.valueOf())?e.getUTCFullYear()+"-"+f(e.getUTCMonth()+1)+"-"+f(e.getUTCDate())+"T"+f(e.getUTCHours())+":"+f(e.getUTCMinutes())+":"+f(e.getUTCSeconds())+"Z":null}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,o,i,r,s,a=gap,c=t[e];switch(c instanceof Date&&(c=date(e)),"function"==typeof rep&&(c=rep.call(t,e,c)),typeof c){case"string":return quote(c);case"number":return isFinite(c)?String(c):"null";case"boolean":case"null":return String(c);case"object":if(!c)return"null";if(gap+=indent,s=[],"[object Array]"===Object.prototype.toString.apply(c)){for(r=c.length,n=0;r>n;n+=1)s[n]=str(n,c)||"null";return i=0===s.length?"[]":gap?"[\n"+gap+s.join(",\n"+gap)+"\n"+a+"]":"["+s.join(",")+"]",gap=a,i}if(rep&&"object"==typeof rep)for(r=rep.length,n=0;r>n;n+=1)"string"==typeof rep[n]&&(o=rep[n],i=str(o,c),i&&s.push(quote(o)+(gap?": ":":")+i));else for(o in c)Object.prototype.hasOwnProperty.call(c,o)&&(i=str(o,c),i&&s.push(quote(o)+(gap?": ":":")+i));return i=0===s.length?"{}":gap?"{\n"+gap+s.join(",\n"+gap)+"\n"+a+"}":"{"+s.join(",")+"}",gap=a,i}}if(nativeJSON&&nativeJSON.parse)return exports.JSON={parse:nativeJSON.parse,stringify:nativeJSON.stringify};var JSON=exports.JSON={},cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;JSON.stringify=function(e,t,n){var o;if(gap="",indent="","number"==typeof n)for(o=0;n>o;o+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str("",{"":e})},JSON.parse=function(text,reviver){function walk(e,t){var n,o,i=e[t];if(i&&"object"==typeof i)for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(o=walk(i,n),void 0!==o?i[n]=o:delete i[n]);return reviver.call(e,t,i)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof JSON?JSON:void 0),function(e,t){var n=e.parser={},o=n.packets=["disconnect","connect","heartbeat","message","json","event","ack","error","noop"],i=n.reasons=["transport not supported","client not handshaken","unauthorized"],r=n.advice=["reconnect"],s=t.JSON,a=t.util.indexOf;n.encodePacket=function(e){var t=a(o,e.type),n=e.id||"",c=e.endpoint||"",u=e.ack,p=null;switch(e.type){case"error":var l=e.reason?a(i,e.reason):"",h=e.advice?a(r,e.advice):"";(""!==l||""!==h)&&(p=l+(""!==h?"+"+h:""));break;case"message":""!==e.data&&(p=e.data);break;case"event":var f={name:e.name};e.args&&e.args.length&&(f.args=e.args),p=s.stringify(f);break;case"json":p=s.stringify(e.data);break;case"connect":e.qs&&(p=e.qs);break;case"ack":p=e.ackId+(e.args&&e.args.length?"+"+s.stringify(e.args):"")}var d=[t,n+("data"==u?"+":""),c];return null!==p&&void 0!==p&&d.push(p),d.join(":")},n.encodePayload=function(e){var t="";if(1==e.length)return e[0];for(var n=0,o=e.length;o>n;n++){var i=e[n];t+="�"+i.length+"�"+e[n]}return t};var c=/([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/;n.decodePacket=function(e){var t=e.match(c);if(!t)return{};var n=t[2]||"",e=t[5]||"",a={type:o[t[1]],endpoint:t[4]||""};switch(n&&(a.id=n,a.ack=t[3]?"data":!0),a.type){case"error":var t=e.split("+");a.reason=i[t[0]]||"",a.advice=r[t[1]]||"";break;case"message":a.data=e||"";break;case"event":try{var u=s.parse(e);a.name=u.name,a.args=u.args}catch(p){}a.args=a.args||[];break;case"json":try{a.data=s.parse(e)}catch(p){}break;case"connect":a.qs=e||"";break;case"ack":var t=e.match(/^([0-9]+)(\+)?(.*)/);if(t&&(a.ackId=t[1],a.args=[],t[3]))try{a.args=t[3]?s.parse(t[3]):[]}catch(p){}break;case"disconnect":case"heartbeat":}return a},n.decodePayload=function(e){if("�"==e.charAt(0)){for(var t=[],o=1,i="";o<e.length;o++)"�"==e.charAt(o)?(t.push(n.decodePacket(e.substr(o+1).substr(0,i))),o+=Number(i)+1,i=""):i+=e.charAt(o);return t}return[n.decodePacket(e)]}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(e,t){function n(e,t){this.socket=e,this.sessid=t}e.Transport=n,t.util.mixin(n,t.EventEmitter),n.prototype.heartbeats=function(){return!0},n.prototype.onData=function(e){if(this.clearCloseTimeout(),(this.socket.connected||this.socket.connecting||this.socket.reconnecting)&&this.setCloseTimeout(),""!==e){var n=t.parser.decodePayload(e);if(n&&n.length)for(var o=0,i=n.length;i>o;o++)this.onPacket(n[o])}return this},n.prototype.onPacket=function(e){return this.socket.setHeartbeatTimeout(),"heartbeat"==e.type?this.onHeartbeat():("connect"==e.type&&""==e.endpoint&&this.onConnect(),"error"==e.type&&"reconnect"==e.advice&&(this.isOpen=!1),this.socket.onPacket(e),this)},n.prototype.setCloseTimeout=function(){if(!this.closeTimeout){var e=this;this.closeTimeout=setTimeout(function(){e.onDisconnect()},this.socket.closeTimeout)}},n.prototype.onDisconnect=function(){return this.isOpen&&this.close(),this.clearTimeouts(),this.socket.onDisconnect(),this},n.prototype.onConnect=function(){return this.socket.onConnect(),this},n.prototype.clearCloseTimeout=function(){this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null)},n.prototype.clearTimeouts=function(){this.clearCloseTimeout(),this.reopenTimeout&&clearTimeout(this.reopenTimeout)},n.prototype.packet=function(e){this.send(t.parser.encodePacket(e))},n.prototype.onHeartbeat=function(){this.packet({type:"heartbeat"})},n.prototype.onOpen=function(){this.isOpen=!0,this.clearCloseTimeout(),this.socket.onOpen()},n.prototype.onClose=function(){this.isOpen=!1,this.socket.onClose(),this.onDisconnect()},n.prototype.prepareUrl=function(){var e=this.socket.options;return this.scheme()+"://"+e.host+":"+e.port+"/"+e.resource+"/"+t.protocol+"/"+this.name+"/"+this.sessid},n.prototype.ready=function(e,t){t.call(this)}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(e,t,n){function o(e){if(this.options={port:80,secure:!1,document:"document"in n?document:!1,resource:"socket.io",transports:t.transports,"connect timeout":1e4,"try multiple transports":!0,reconnect:!0,"reconnection delay":500,"reconnection limit":1/0,"reopen delay":3e3,"max reconnection attempts":10,"sync disconnect on unload":!1,"auto connect":!0,"flash policy port":10843,manualFlush:!1},t.util.merge(this.options,e),this.connected=!1,this.open=!1,this.connecting=!1,this.reconnecting=!1,this.namespaces={},this.buffer=[],this.doBuffer=!1,this.options["sync disconnect on unload"]&&(!this.isXDomain()||t.util.ua.hasCORS)){var o=this;t.util.on(n,"beforeunload",function(){o.disconnectSync()},!1)}this.options["auto connect"]&&this.connect()}function i(){}e.Socket=o,t.util.mixin(o,t.EventEmitter),o.prototype.of=function(e){return this.namespaces[e]||(this.namespaces[e]=new t.SocketNamespace(this,e),""!==e&&this.namespaces[e].packet({type:"connect"})),this.namespaces[e]},o.prototype.publish=function(){this.emit.apply(this,arguments);var e;for(var t in this.namespaces)this.namespaces.hasOwnProperty(t)&&(e=this.of(t),e.$emit.apply(e,arguments))},o.prototype.handshake=function(e){function n(t){t instanceof Error?(o.connecting=!1,o.onError(t.message)):e.apply(null,t.split(":"))}var o=this,r=this.options,s=["http"+(r.secure?"s":"")+":/",r.host+":"+r.port,r.resource,t.protocol,t.util.query(this.options.query,"t="+ +new Date)].join("/");if(this.isXDomain()&&!t.util.ua.hasCORS){var a=document.getElementsByTagName("script")[0],c=document.createElement("script");c.src=s+"&jsonp="+t.j.length,a.parentNode.insertBefore(c,a),t.j.push(function(e){n(e),c.parentNode.removeChild(c)})}else{var u=t.util.request();u.open("GET",s,!0),this.isXDomain()&&(u.withCredentials=!0),u.onreadystatechange=function(){4==u.readyState&&(u.onreadystatechange=i,200==u.status?n(u.responseText):403==u.status?o.onError(u.responseText):(o.connecting=!1,!o.reconnecting&&o.onError(u.responseText)))},u.send(null)}},o.prototype.getTransport=function(e){for(var n,o=e||this.transports,i=0;n=o[i];i++)if(t.Transport[n]&&t.Transport[n].check(this)&&(!this.isXDomain()||t.Transport[n].xdomainCheck(this)))return new t.Transport[n](this,this.sessionid);return null},o.prototype.connect=function(e){if(this.connecting)return this;var n=this;return n.connecting=!0,this.handshake(function(o,i,r,s){function a(e){return n.transport&&n.transport.clearTimeouts(),n.transport=n.getTransport(e),n.transport?(n.transport.ready(n,function(){n.connecting=!0,n.publish("connecting",n.transport.name),n.transport.open(),n.options["connect timeout"]&&(n.connectTimeoutTimer=setTimeout(function(){if(!n.connected&&(n.connecting=!1,n.options["try multiple transports"])){for(var e=n.transports;e.length>0&&e.splice(0,1)[0]!=n.transport.name;);e.length?a(e):n.publish("connect_failed")}},n.options["connect timeout"]))}),void 0):n.publish("connect_failed")}n.sessionid=o,n.closeTimeout=1e3*r,n.heartbeatTimeout=1e3*i,n.transports||(n.transports=n.origTransports=s?t.util.intersect(s.split(","),n.options.transports):n.options.transports),n.setHeartbeatTimeout(),a(n.transports),n.once("connect",function(){clearTimeout(n.connectTimeoutTimer),e&&"function"==typeof e&&e()})}),this},o.prototype.setHeartbeatTimeout=function(){if(clearTimeout(this.heartbeatTimeoutTimer),!this.transport||this.transport.heartbeats()){var e=this;this.heartbeatTimeoutTimer=setTimeout(function(){e.transport.onClose()},this.heartbeatTimeout)}},o.prototype.packet=function(e){return this.connected&&!this.doBuffer?this.transport.packet(e):this.buffer.push(e),this},o.prototype.setBuffer=function(e){this.doBuffer=e,!e&&this.connected&&this.buffer.length&&(this.options.manualFlush||this.flushBuffer())},o.prototype.flushBuffer=function(){this.transport.payload(this.buffer),this.buffer=[]},o.prototype.disconnect=function(){return(this.connected||this.connecting)&&(this.open&&this.of("").packet({type:"disconnect"}),this.onDisconnect("booted")),this},o.prototype.disconnectSync=function(){var e=t.util.request(),n=["http"+(this.options.secure?"s":"")+":/",this.options.host+":"+this.options.port,this.options.resource,t.protocol,"",this.sessionid].join("/")+"/?disconnect=1";e.open("GET",n,!1),e.send(null),this.onDisconnect("booted")},o.prototype.isXDomain=function(){var e=n.location.port||("https:"==n.location.protocol?443:80);return this.options.host!==n.location.hostname||this.options.port!=e},o.prototype.onConnect=function(){this.connected||(this.connected=!0,this.connecting=!1,this.doBuffer||this.setBuffer(!1),this.emit("connect"))},o.prototype.onOpen=function(){this.open=!0},o.prototype.onClose=function(){this.open=!1,clearTimeout(this.heartbeatTimeoutTimer)},o.prototype.onPacket=function(e){this.of(e.endpoint).onPacket(e)},o.prototype.onError=function(e){e&&e.advice&&"reconnect"===e.advice&&(this.connected||this.connecting)&&(this.disconnect(),this.options.reconnect&&this.reconnect()),this.publish("error",e&&e.reason?e.reason:e)},o.prototype.onDisconnect=function(e){var t=this.connected,n=this.connecting;this.connected=!1,this.connecting=!1,this.open=!1,(t||n)&&(this.transport.close(),this.transport.clearTimeouts(),t&&(this.publish("disconnect",e),"booted"!=e&&this.options.reconnect&&!this.reconnecting&&this.reconnect()))},o.prototype.reconnect=function(){function e(){if(n.connected){for(var e in n.namespaces)n.namespaces.hasOwnProperty(e)&&""!==e&&n.namespaces[e].packet({type:"connect"});n.publish("reconnect",n.transport.name,n.reconnectionAttempts)}clearTimeout(n.reconnectionTimer),n.removeListener("connect_failed",t),n.removeListener("connect",t),n.reconnecting=!1,delete n.reconnectionAttempts,delete n.reconnectionDelay,delete n.reconnectionTimer,delete n.redoTransports,n.options["try multiple transports"]=i}function t(){return n.reconnecting?n.connected?e():n.connecting&&n.reconnecting?n.reconnectionTimer=setTimeout(t,1e3):(n.reconnectionAttempts++>=o?n.redoTransports?(n.publish("reconnect_failed"),e()):(n.on("connect_failed",t),n.options["try multiple transports"]=!0,n.transports=n.origTransports,n.transport=n.getTransport(),n.redoTransports=!0,n.connect()):(n.reconnectionDelay<r&&(n.reconnectionDelay*=2),n.connect(),n.publish("reconnecting",n.reconnectionDelay,n.reconnectionAttempts),n.reconnectionTimer=setTimeout(t,n.reconnectionDelay)),void 0):void 0}this.reconnecting=!0,this.reconnectionAttempts=0,this.reconnectionDelay=this.options["reconnection delay"];var n=this,o=this.options["max reconnection attempts"],i=this.options["try multiple transports"],r=this.options["reconnection limit"];this.options["try multiple transports"]=!1,this.reconnectionTimer=setTimeout(t,this.reconnectionDelay),this.on("connect",t)}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports,this),function(e,t){function n(e,t){this.socket=e,this.name=t||"",this.flags={},this.json=new o(this,"json"),this.ackPackets=0,this.acks={}}function o(e,t){this.namespace=e,this.name=t}e.SocketNamespace=n,t.util.mixin(n,t.EventEmitter),n.prototype.$emit=t.EventEmitter.prototype.emit,n.prototype.of=function(){return this.socket.of.apply(this.socket,arguments)},n.prototype.packet=function(e){return e.endpoint=this.name,this.socket.packet(e),this.flags={},this},n.prototype.send=function(e,t){var n={type:this.flags.json?"json":"message",data:e};return"function"==typeof t&&(n.id=++this.ackPackets,n.ack=!0,this.acks[n.id]=t),this.packet(n)},n.prototype.emit=function(e){var t=Array.prototype.slice.call(arguments,1),n=t[t.length-1],o={type:"event",name:e};return"function"==typeof n&&(o.id=++this.ackPackets,o.ack="data",this.acks[o.id]=n,t=t.slice(0,t.length-1)),o.args=t,this.packet(o)},n.prototype.disconnect=function(){return""===this.name?this.socket.disconnect():(this.packet({type:"disconnect"}),this.$emit("disconnect")),this},n.prototype.onPacket=function(e){function n(){o.packet({type:"ack",args:t.util.toArray(arguments),ackId:e.id})}var o=this;switch(e.type){case"connect":this.$emit("connect");break;case"disconnect":""===this.name?this.socket.onDisconnect(e.reason||"booted"):this.$emit("disconnect",e.reason);break;case"message":case"json":var i=["message",e.data];"data"==e.ack?i.push(n):e.ack&&this.packet({type:"ack",ackId:e.id}),this.$emit.apply(this,i);break;case"event":var i=[e.name].concat(e.args);"data"==e.ack&&i.push(n),this.$emit.apply(this,i);break;case"ack":this.acks[e.ackId]&&(this.acks[e.ackId].apply(this,e.args),delete this.acks[e.ackId]);break;case"error":e.advice?this.socket.onError(e):"unauthorized"==e.reason?this.$emit("connect_failed",e.reason):this.$emit("error",e.reason)}},o.prototype.send=function(){this.namespace.flags[this.name]=!0,this.namespace.send.apply(this.namespace,arguments)},o.prototype.emit=function(){this.namespace.flags[this.name]=!0,this.namespace.emit.apply(this.namespace,arguments)}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(e,t,n){function o(){t.Transport.apply(this,arguments)}e.websocket=o,t.util.inherit(o,t.Transport),o.prototype.name="websocket",o.prototype.open=function(){var e,o=t.util.query(this.socket.options.query),i=this;return e||(e=n.MozWebSocket||n.WebSocket),this.websocket=new e(this.prepareUrl()+o),this.websocket.onopen=function(){i.onOpen(),i.socket.setBuffer(!1)},this.websocket.onmessage=function(e){i.onData(e.data)},this.websocket.onclose=function(){i.onClose(),i.socket.setBuffer(!0)},this.websocket.onerror=function(e){i.onError(e)},this},o.prototype.send=t.util.ua.iDevice?function(e){var t=this;return setTimeout(function(){t.websocket.send(e)},0),this}:function(e){return this.websocket.send(e),this
},o.prototype.payload=function(e){for(var t=0,n=e.length;n>t;t++)this.packet(e[t]);return this},o.prototype.close=function(){return this.websocket.close(),this},o.prototype.onError=function(e){this.socket.onError(e)},o.prototype.scheme=function(){return this.socket.options.secure?"wss":"ws"},o.check=function(){return"WebSocket"in n&&!("__addTask"in WebSocket)||"MozWebSocket"in n},o.xdomainCheck=function(){return!0},t.transports.push("websocket")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this),function(e,t){function n(){t.Transport.websocket.apply(this,arguments)}e.flashsocket=n,t.util.inherit(n,t.Transport.websocket),n.prototype.name="flashsocket",n.prototype.open=function(){var e=this,n=arguments;return WebSocket.__addTask(function(){t.Transport.websocket.prototype.open.apply(e,n)}),this},n.prototype.send=function(){var e=this,n=arguments;return WebSocket.__addTask(function(){t.Transport.websocket.prototype.send.apply(e,n)}),this},n.prototype.close=function(){return WebSocket.__tasks.length=0,t.Transport.websocket.prototype.close.call(this),this},n.prototype.ready=function(e,o){function i(){var t=e.options,i=t["flash policy port"],s=["http"+(t.secure?"s":"")+":/",t.host+":"+t.port,t.resource,"static/flashsocket","WebSocketMain"+(e.isXDomain()?"Insecure":"")+".swf"];n.loaded||("undefined"==typeof WEB_SOCKET_SWF_LOCATION&&(WEB_SOCKET_SWF_LOCATION=s.join("/")),843!==i&&WebSocket.loadFlashPolicyFile("xmlsocket://"+t.host+":"+i),WebSocket.__initialize(),n.loaded=!0),o.call(r)}var r=this;return document.body?i():(t.util.load(i),void 0)},n.check=function(){return"undefined"!=typeof WebSocket&&"__initialize"in WebSocket&&swfobject?swfobject.getFlashPlayerVersion().major>=10:!1},n.xdomainCheck=function(){return!0},"undefined"!=typeof window&&(WEB_SOCKET_DISABLE_AUTO_INITIALIZATION=!0),t.transports.push("flashsocket")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports),"undefined"!=typeof window)var swfobject=function(){function e(){if(!X){try{var e=P.getElementsByTagName("body")[0].appendChild(y("span"));e.parentNode.removeChild(e)}catch(t){return}X=!0;for(var n=q.length,o=0;n>o;o++)q[o]()}}function t(e){X?e():q[q.length]=e}function n(e){if(typeof L.addEventListener!=O)L.addEventListener("load",e,!1);else if(typeof P.addEventListener!=O)P.addEventListener("load",e,!1);else if(typeof L.attachEvent!=O)g(L,"onload",e);else if("function"==typeof L.onload){var t=L.onload;L.onload=function(){t(),e()}}else L.onload=e}function o(){W?i():r()}function i(){var e=P.getElementsByTagName("body")[0],t=y(j);t.setAttribute("type",R);var n=e.appendChild(t);if(n){var o=0;!function(){if(typeof n.GetVariable!=O){var i=n.GetVariable("$version");i&&(i=i.split(" ")[1].split(","),J.pv=[parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)])}else if(10>o)return o++,setTimeout(arguments.callee,10),void 0;e.removeChild(t),n=null,r()}()}else r()}function r(){var e=F.length;if(e>0)for(var t=0;e>t;t++){var n=F[t].id,o=F[t].callbackFn,i={success:!1,id:n};if(J.pv[0]>0){var r=m(n);if(r)if(!v(F[t].swfVersion)||J.wk&&J.wk<312)if(F[t].expressInstall&&a()){var p={};p.data=F[t].expressInstall,p.width=r.getAttribute("width")||"0",p.height=r.getAttribute("height")||"0",r.getAttribute("class")&&(p.styleclass=r.getAttribute("class")),r.getAttribute("align")&&(p.align=r.getAttribute("align"));for(var l={},h=r.getElementsByTagName("param"),f=h.length,d=0;f>d;d++)"movie"!=h[d].getAttribute("name").toLowerCase()&&(l[h[d].getAttribute("name")]=h[d].getAttribute("value"));c(p,l,n,o)}else u(r),o&&o(i);else w(n,!0),o&&(i.success=!0,i.ref=s(n),o(i))}else if(w(n,!0),o){var y=s(n);y&&typeof y.SetVariable!=O&&(i.success=!0,i.ref=y),o(i)}}}function s(e){var t=null,n=m(e);if(n&&"OBJECT"==n.nodeName)if(typeof n.SetVariable!=O)t=n;else{var o=n.getElementsByTagName(j)[0];o&&(t=o)}return t}function a(){return!H&&v("6.0.65")&&(J.win||J.mac)&&!(J.wk&&J.wk<312)}function c(e,t,n,o){H=!0,C=o||null,x={success:!1,id:n};var i=m(n);if(i){"OBJECT"==i.nodeName?(S=p(i),T=null):(S=i,T=n),e.id=N,(typeof e.width==O||!/%$/.test(e.width)&&parseInt(e.width,10)<310)&&(e.width="310"),(typeof e.height==O||!/%$/.test(e.height)&&parseInt(e.height,10)<137)&&(e.height="137"),P.title=P.title.slice(0,47)+" - Flash Player Installation";var r=J.ie&&J.win?["Active"].concat("").join("X"):"PlugIn",s="MMredirectURL="+L.location.toString().replace(/&/g,"%26")+"&MMplayerType="+r+"&MMdoctitle="+P.title;if(typeof t.flashvars!=O?t.flashvars+="&"+s:t.flashvars=s,J.ie&&J.win&&4!=i.readyState){var a=y("div");n+="SWFObjectNew",a.setAttribute("id",n),i.parentNode.insertBefore(a,i),i.style.display="none",function(){4==i.readyState?i.parentNode.removeChild(i):setTimeout(arguments.callee,10)}()}l(e,t,n)}}function u(e){if(J.ie&&J.win&&4!=e.readyState){var t=y("div");e.parentNode.insertBefore(t,e),t.parentNode.replaceChild(p(e),t),e.style.display="none",function(){4==e.readyState?e.parentNode.removeChild(e):setTimeout(arguments.callee,10)}()}else e.parentNode.replaceChild(p(e),e)}function p(e){var t=y("div");if(J.win&&J.ie)t.innerHTML=e.innerHTML;else{var n=e.getElementsByTagName(j)[0];if(n){var o=n.childNodes;if(o)for(var i=o.length,r=0;i>r;r++)1==o[r].nodeType&&"PARAM"==o[r].nodeName||8==o[r].nodeType||t.appendChild(o[r].cloneNode(!0))}}return t}function l(e,t,n){var o,i=m(n);if(J.wk&&J.wk<312)return o;if(i)if(typeof e.id==O&&(e.id=n),J.ie&&J.win){var r="";for(var s in e)e[s]!=Object.prototype[s]&&("data"==s.toLowerCase()?t.movie=e[s]:"styleclass"==s.toLowerCase()?r+=' class="'+e[s]+'"':"classid"!=s.toLowerCase()&&(r+=" "+s+'="'+e[s]+'"'));var a="";for(var c in t)t[c]!=Object.prototype[c]&&(a+='<param name="'+c+'" value="'+t[c]+'" />');i.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+r+">"+a+"</object>",$[$.length]=e.id,o=m(e.id)}else{var u=y(j);u.setAttribute("type",R);for(var p in e)e[p]!=Object.prototype[p]&&("styleclass"==p.toLowerCase()?u.setAttribute("class",e[p]):"classid"!=p.toLowerCase()&&u.setAttribute(p,e[p]));for(var l in t)t[l]!=Object.prototype[l]&&"movie"!=l.toLowerCase()&&h(u,l,t[l]);i.parentNode.replaceChild(u,i),o=u}return o}function h(e,t,n){var o=y("param");o.setAttribute("name",t),o.setAttribute("value",n),e.appendChild(o)}function f(e){var t=m(e);t&&"OBJECT"==t.nodeName&&(J.ie&&J.win?(t.style.display="none",function(){4==t.readyState?d(e):setTimeout(arguments.callee,10)}()):t.parentNode.removeChild(t))}function d(e){var t=m(e);if(t){for(var n in t)"function"==typeof t[n]&&(t[n]=null);t.parentNode.removeChild(t)}}function m(e){var t=null;try{t=P.getElementById(e)}catch(n){}return t}function y(e){return P.createElement(e)}function g(e,t,n){e.attachEvent(t,n),B[B.length]=[e,t,n]}function v(e){var t=J.pv,n=e.split(".");return n[0]=parseInt(n[0],10),n[1]=parseInt(n[1],10)||0,n[2]=parseInt(n[2],10)||0,t[0]>n[0]||t[0]==n[0]&&t[1]>n[1]||t[0]==n[0]&&t[1]==n[1]&&t[2]>=n[2]?!0:!1}function b(e,t,n,o){if(!J.ie||!J.mac){var i=P.getElementsByTagName("head")[0];if(i){var r=n&&"string"==typeof n?n:"screen";if(o&&(E=null,_=null),!E||_!=r){var s=y("style");s.setAttribute("type","text/css"),s.setAttribute("media",r),E=i.appendChild(s),J.ie&&J.win&&typeof P.styleSheets!=O&&P.styleSheets.length>0&&(E=P.styleSheets[P.styleSheets.length-1]),_=r}J.ie&&J.win?E&&typeof E.addRule==j&&E.addRule(e,t):E&&typeof P.createTextNode!=O&&E.appendChild(P.createTextNode(e+" {"+t+"}"))}}}function w(e,t){if(U){var n=t?"visible":"hidden";X&&m(e)?m(e).style.visibility=n:b("#"+e,"visibility:"+n)}}function k(e){var t=/[\\\"<>\.;]/,n=null!=t.exec(e);return n&&typeof encodeURIComponent!=O?encodeURIComponent(e):e}var S,T,C,x,E,_,O="undefined",j="object",A="Shockwave Flash",D="ShockwaveFlash.ShockwaveFlash",R="application/x-shockwave-flash",N="SWFObjectExprInst",I="onreadystatechange",L=window,P=document,M=navigator,W=!1,q=[o],F=[],$=[],B=[],X=!1,H=!1,U=!0,J=function(){var e=typeof P.getElementById!=O&&typeof P.getElementsByTagName!=O&&typeof P.createElement!=O,t=M.userAgent.toLowerCase(),n=M.platform.toLowerCase(),o=n?/win/.test(n):/win/.test(t),i=n?/mac/.test(n):/mac/.test(t),r=/webkit/.test(t)?parseFloat(t.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,s=!1,a=[0,0,0],c=null;if(typeof M.plugins!=O&&typeof M.plugins[A]==j)c=M.plugins[A].description,!c||typeof M.mimeTypes!=O&&M.mimeTypes[R]&&!M.mimeTypes[R].enabledPlugin||(W=!0,s=!1,c=c.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),a[0]=parseInt(c.replace(/^(.*)\..*$/,"$1"),10),a[1]=parseInt(c.replace(/^.*\.(.*)\s.*$/,"$1"),10),a[2]=/[a-zA-Z]/.test(c)?parseInt(c.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0);else if(typeof L[["Active"].concat("Object").join("X")]!=O)try{var u=new(window[["Active"].concat("Object").join("X")])(D);u&&(c=u.GetVariable("$version"),c&&(s=!0,c=c.split(" ")[1].split(","),a=[parseInt(c[0],10),parseInt(c[1],10),parseInt(c[2],10)]))}catch(p){}return{w3:e,pv:a,wk:r,ie:s,win:o,mac:i}}();return function(){J.w3&&((typeof P.readyState!=O&&"complete"==P.readyState||typeof P.readyState==O&&(P.getElementsByTagName("body")[0]||P.body))&&e(),X||(typeof P.addEventListener!=O&&P.addEventListener("DOMContentLoaded",e,!1),J.ie&&J.win&&(P.attachEvent(I,function(){"complete"==P.readyState&&(P.detachEvent(I,arguments.callee),e())}),L==top&&function(){if(!X){try{P.documentElement.doScroll("left")}catch(t){return setTimeout(arguments.callee,0),void 0}e()}}()),J.wk&&function(){return X?void 0:/loaded|complete/.test(P.readyState)?(e(),void 0):(setTimeout(arguments.callee,0),void 0)}(),n(e)))}(),function(){J.ie&&J.win&&window.attachEvent("onunload",function(){for(var e=B.length,t=0;e>t;t++)B[t][0].detachEvent(B[t][1],B[t][2]);for(var n=$.length,o=0;n>o;o++)f($[o]);for(var i in J)J[i]=null;J=null;for(var r in swfobject)swfobject[r]=null;swfobject=null})}(),{registerObject:function(e,t,n,o){if(J.w3&&e&&t){var i={};i.id=e,i.swfVersion=t,i.expressInstall=n,i.callbackFn=o,F[F.length]=i,w(e,!1)}else o&&o({success:!1,id:e})},getObjectById:function(e){return J.w3?s(e):void 0},embedSWF:function(e,n,o,i,r,s,u,p,h,f){var d={success:!1,id:n};J.w3&&!(J.wk&&J.wk<312)&&e&&n&&o&&i&&r?(w(n,!1),t(function(){o+="",i+="";var t={};if(h&&typeof h===j)for(var m in h)t[m]=h[m];t.data=e,t.width=o,t.height=i;var y={};if(p&&typeof p===j)for(var g in p)y[g]=p[g];if(u&&typeof u===j)for(var b in u)typeof y.flashvars!=O?y.flashvars+="&"+b+"="+u[b]:y.flashvars=b+"="+u[b];if(v(r)){var k=l(t,y,n);t.id==n&&w(n,!0),d.success=!0,d.ref=k}else{if(s&&a())return t.data=s,c(t,y,n,f),void 0;w(n,!0)}f&&f(d)})):f&&f(d)},switchOffAutoHideShow:function(){U=!1},ua:J,getFlashPlayerVersion:function(){return{major:J.pv[0],minor:J.pv[1],release:J.pv[2]}},hasFlashPlayerVersion:v,createSWF:function(e,t,n){return J.w3?l(e,t,n):void 0},showExpressInstall:function(e,t,n,o){J.w3&&a()&&c(e,t,n,o)},removeSWF:function(e){J.w3&&f(e)},createCSS:function(e,t,n,o){J.w3&&b(e,t,n,o)},addDomLoadEvent:t,addLoadEvent:n,getQueryParamValue:function(e){var t=P.location.search||P.location.hash;if(t){if(/\?/.test(t)&&(t=t.split("?")[1]),null==e)return k(t);for(var n=t.split("&"),o=0;o<n.length;o++)if(n[o].substring(0,n[o].indexOf("="))==e)return k(n[o].substring(n[o].indexOf("=")+1))}return""},expressInstallCallback:function(){if(H){var e=m(N);e&&S&&(e.parentNode.replaceChild(S,e),T&&(w(T,!0),J.ie&&J.win&&(S.style.display="block")),C&&C(x)),H=!1}}}}();!function(){if("undefined"!=typeof window&&!window.WebSocket){var e=window.console;if(e&&e.log&&e.error||(e={log:function(){},error:function(){}}),!swfobject.hasFlashPlayerVersion("10.0.0"))return e.error("Flash Player >= 10.0.0 is required."),void 0;"file:"==location.protocol&&e.error("WARNING: web-socket-js doesn't work in file:///... URL unless you set Flash Security Settings properly. Open the page via Web server i.e. http://..."),WebSocket=function(e,t,n,o,i){var r=this;r.__id=WebSocket.__nextId++,WebSocket.__instances[r.__id]=r,r.readyState=WebSocket.CONNECTING,r.bufferedAmount=0,r.__events={},t?"string"==typeof t&&(t=[t]):t=[],setTimeout(function(){WebSocket.__addTask(function(){WebSocket.__flash.create(r.__id,e,t,n||null,o||0,i||null)})},0)},WebSocket.prototype.send=function(e){if(this.readyState==WebSocket.CONNECTING)throw"INVALID_STATE_ERR: Web Socket connection has not been established";var t=WebSocket.__flash.send(this.__id,encodeURIComponent(e));return 0>t?!0:(this.bufferedAmount+=t,!1)},WebSocket.prototype.close=function(){this.readyState!=WebSocket.CLOSED&&this.readyState!=WebSocket.CLOSING&&(this.readyState=WebSocket.CLOSING,WebSocket.__flash.close(this.__id))},WebSocket.prototype.addEventListener=function(e,t){e in this.__events||(this.__events[e]=[]),this.__events[e].push(t)},WebSocket.prototype.removeEventListener=function(e,t){if(e in this.__events)for(var n=this.__events[e],o=n.length-1;o>=0;--o)if(n[o]===t){n.splice(o,1);break}},WebSocket.prototype.dispatchEvent=function(e){for(var t=this.__events[e.type]||[],n=0;n<t.length;++n)t[n](e);var o=this["on"+e.type];o&&o(e)},WebSocket.prototype.__handleEvent=function(e){"readyState"in e&&(this.readyState=e.readyState),"protocol"in e&&(this.protocol=e.protocol);var t;if("open"==e.type||"error"==e.type)t=this.__createSimpleEvent(e.type);else if("close"==e.type)t=this.__createSimpleEvent("close");else{if("message"!=e.type)throw"unknown event type: "+e.type;var n=decodeURIComponent(e.message);t=this.__createMessageEvent("message",n)}this.dispatchEvent(t)},WebSocket.prototype.__createSimpleEvent=function(e){if(document.createEvent&&window.Event){var t=document.createEvent("Event");return t.initEvent(e,!1,!1),t}return{type:e,bubbles:!1,cancelable:!1}},WebSocket.prototype.__createMessageEvent=function(e,t){if(document.createEvent&&window.MessageEvent&&!window.opera){var n=document.createEvent("MessageEvent");return n.initMessageEvent("message",!1,!1,t,null,null,window,null),n}return{type:e,data:t,bubbles:!1,cancelable:!1}},WebSocket.CONNECTING=0,WebSocket.OPEN=1,WebSocket.CLOSING=2,WebSocket.CLOSED=3,WebSocket.__flash=null,WebSocket.__instances={},WebSocket.__tasks=[],WebSocket.__nextId=0,WebSocket.loadFlashPolicyFile=function(e){WebSocket.__addTask(function(){WebSocket.__flash.loadManualPolicyFile(e)})},WebSocket.__initialize=function(){if(!WebSocket.__flash){if(WebSocket.__swfLocation&&(window.WEB_SOCKET_SWF_LOCATION=WebSocket.__swfLocation),!window.WEB_SOCKET_SWF_LOCATION)return e.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf"),void 0;var t=document.createElement("div");t.id="webSocketContainer",t.style.position="absolute",WebSocket.__isFlashLite()?(t.style.left="0px",t.style.top="0px"):(t.style.left="-100px",t.style.top="-100px");var n=document.createElement("div");n.id="webSocketFlash",t.appendChild(n),document.body.appendChild(t),swfobject.embedSWF(WEB_SOCKET_SWF_LOCATION,"webSocketFlash","1","1","10.0.0",null,null,{hasPriority:!0,swliveconnect:!0,allowScriptAccess:"always"},null,function(t){t.success||e.error("[WebSocket] swfobject.embedSWF failed")})}},WebSocket.__onFlashInitialized=function(){setTimeout(function(){WebSocket.__flash=document.getElementById("webSocketFlash"),WebSocket.__flash.setCallerUrl(location.href),WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG);for(var e=0;e<WebSocket.__tasks.length;++e)WebSocket.__tasks[e]();WebSocket.__tasks=[]},0)},WebSocket.__onFlashEvent=function(){return setTimeout(function(){try{for(var t=WebSocket.__flash.receiveEvents(),n=0;n<t.length;++n)WebSocket.__instances[t[n].webSocketId].__handleEvent(t[n])}catch(o){e.error(o)}},0),!0},WebSocket.__log=function(t){e.log(decodeURIComponent(t))},WebSocket.__error=function(t){e.error(decodeURIComponent(t))},WebSocket.__addTask=function(e){WebSocket.__flash?e():WebSocket.__tasks.push(e)},WebSocket.__isFlashLite=function(){if(!window.navigator||!window.navigator.mimeTypes)return!1;var e=window.navigator.mimeTypes["application/x-shockwave-flash"];return e&&e.enabledPlugin&&e.enabledPlugin.filename?e.enabledPlugin.filename.match(/flashlite/i)?!0:!1:!1},window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION||(window.addEventListener?window.addEventListener("load",function(){WebSocket.__initialize()},!1):window.attachEvent("onload",function(){WebSocket.__initialize()}))}}(),function(e,t,n){function o(e){e&&(t.Transport.apply(this,arguments),this.sendBuffer=[])}function i(){}e.XHR=o,t.util.inherit(o,t.Transport),o.prototype.open=function(){return this.socket.setBuffer(!1),this.onOpen(),this.get(),this.setCloseTimeout(),this},o.prototype.payload=function(e){for(var n=[],o=0,i=e.length;i>o;o++)n.push(t.parser.encodePacket(e[o]));this.send(t.parser.encodePayload(n))},o.prototype.send=function(e){return this.post(e),this},o.prototype.post=function(e){function t(){4==this.readyState&&(this.onreadystatechange=i,r.posting=!1,200==this.status?r.socket.setBuffer(!1):r.onClose())}function o(){this.onload=i,r.socket.setBuffer(!1)}var r=this;this.socket.setBuffer(!0),this.sendXHR=this.request("POST"),n.XDomainRequest&&this.sendXHR instanceof XDomainRequest?this.sendXHR.onload=this.sendXHR.onerror=o:this.sendXHR.onreadystatechange=t,this.sendXHR.send(e)},o.prototype.close=function(){return this.onClose(),this},o.prototype.request=function(e){var n=t.util.request(this.socket.isXDomain()),o=t.util.query(this.socket.options.query,"t="+ +new Date);if(n.open(e||"GET",this.prepareUrl()+o,!0),"POST"==e)try{n.setRequestHeader?n.setRequestHeader("Content-type","text/plain;charset=UTF-8"):n.contentType="text/plain"}catch(i){}return n},o.prototype.scheme=function(){return this.socket.options.secure?"https":"http"},o.check=function(e,o){try{var i=t.util.request(o),r=n.XDomainRequest&&i instanceof XDomainRequest,s=e&&e.options&&e.options.secure?"https:":"http:",a=n.location&&s!=n.location.protocol;if(i&&(!r||!a))return!0}catch(c){}return!1},o.xdomainCheck=function(e){return o.check(e,!0)}}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this),function(e,t){function n(){t.Transport.XHR.apply(this,arguments)}e.htmlfile=n,t.util.inherit(n,t.Transport.XHR),n.prototype.name="htmlfile",n.prototype.get=function(){this.doc=new(window[["Active"].concat("Object").join("X")])("htmlfile"),this.doc.open(),this.doc.write("<html></html>"),this.doc.close(),this.doc.parentWindow.s=this;var e=this.doc.createElement("div");e.className="socketio",this.doc.body.appendChild(e),this.iframe=this.doc.createElement("iframe"),e.appendChild(this.iframe);var n=this,o=t.util.query(this.socket.options.query,"t="+ +new Date);this.iframe.src=this.prepareUrl()+o,t.util.on(window,"unload",function(){n.destroy()})},n.prototype._=function(e,t){e=e.replace(/\\\//g,"/"),this.onData(e);try{var n=t.getElementsByTagName("script")[0];n.parentNode.removeChild(n)}catch(o){}},n.prototype.destroy=function(){if(this.iframe){try{this.iframe.src="about:blank"}catch(e){}this.doc=null,this.iframe.parentNode.removeChild(this.iframe),this.iframe=null,CollectGarbage()}},n.prototype.close=function(){return this.destroy(),t.Transport.XHR.prototype.close.call(this)},n.check=function(e){if("undefined"!=typeof window&&["Active"].concat("Object").join("X")in window)try{var n=new(window[["Active"].concat("Object").join("X")])("htmlfile");return n&&t.Transport.XHR.check(e)}catch(o){}return!1},n.xdomainCheck=function(){return!1},t.transports.push("htmlfile")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(e,t,n){function o(){t.Transport.XHR.apply(this,arguments)}function i(){}e["xhr-polling"]=o,t.util.inherit(o,t.Transport.XHR),t.util.merge(o,t.Transport.XHR),o.prototype.name="xhr-polling",o.prototype.heartbeats=function(){return!1},o.prototype.open=function(){var e=this;return t.Transport.XHR.prototype.open.call(e),!1},o.prototype.get=function(){function e(){4==this.readyState&&(this.onreadystatechange=i,200==this.status?(r.onData(this.responseText),r.get()):r.onClose())}function t(){this.onload=i,this.onerror=i,r.retryCounter=1,r.onData(this.responseText),r.get()}function o(){r.retryCounter++,!r.retryCounter||r.retryCounter>3?r.onClose():r.get()}if(this.isOpen){var r=this;this.xhr=this.request(),n.XDomainRequest&&this.xhr instanceof XDomainRequest?(this.xhr.onload=t,this.xhr.onerror=o):this.xhr.onreadystatechange=e,this.xhr.send(null)}},o.prototype.onClose=function(){if(t.Transport.XHR.prototype.onClose.call(this),this.xhr){this.xhr.onreadystatechange=this.xhr.onload=this.xhr.onerror=i;try{this.xhr.abort()}catch(e){}this.xhr=null}},o.prototype.ready=function(e,n){var o=this;t.util.defer(function(){n.call(o)})},t.transports.push("xhr-polling")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this),function(e,t,n){function o(){t.Transport["xhr-polling"].apply(this,arguments),this.index=t.j.length;var e=this;t.j.push(function(t){e._(t)})}var i=n.document&&"MozAppearance"in n.document.documentElement.style;e["jsonp-polling"]=o,t.util.inherit(o,t.Transport["xhr-polling"]),o.prototype.name="jsonp-polling",o.prototype.post=function(e){function n(){o(),i.socket.setBuffer(!1)}function o(){i.iframe&&i.form.removeChild(i.iframe);try{s=document.createElement('<iframe name="'+i.iframeId+'">')}catch(e){s=document.createElement("iframe"),s.name=i.iframeId}s.id=i.iframeId,i.form.appendChild(s),i.iframe=s}var i=this,r=t.util.query(this.socket.options.query,"t="+ +new Date+"&i="+this.index);if(!this.form){var s,a=document.createElement("form"),c=document.createElement("textarea"),u=this.iframeId="socketio_iframe_"+this.index;a.className="socketio",a.style.position="absolute",a.style.top="0px",a.style.left="0px",a.style.display="none",a.target=u,a.method="POST",a.setAttribute("accept-charset","utf-8"),c.name="d",a.appendChild(c),document.body.appendChild(a),this.form=a,this.area=c}this.form.action=this.prepareUrl()+r,o(),this.area.value=t.JSON.stringify(e);try{this.form.submit()}catch(p){}this.iframe.attachEvent?s.onreadystatechange=function(){"complete"==i.iframe.readyState&&n()}:this.iframe.onload=n,this.socket.setBuffer(!0)},o.prototype.get=function(){var e=this,n=document.createElement("script"),o=t.util.query(this.socket.options.query,"t="+ +new Date+"&i="+this.index);this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),n.async=!0,n.src=this.prepareUrl()+o,n.onerror=function(){e.onClose()};var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(n,r),this.script=n,i&&setTimeout(function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)},100)},o.prototype._=function(e){return this.onData(e),this.isOpen&&this.get(),this},o.prototype.ready=function(e,n){var o=this;return i?(t.util.load(function(){n.call(o)}),void 0):n.call(this)},o.check=function(){return"document"in n},o.xdomainCheck=function(){return!0},t.transports.push("jsonp-polling")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this),"function"==typeof define&&define.amd&&define([],function(){return io})}()},{}],8:[function(e,t,n){function o(e){return Array.isArray(e)||"object"==typeof e&&"[object Array]"===Object.prototype.toString.call(e)}function i(e){"object"==typeof e&&"[object RegExp]"===Object.prototype.toString.call(e)}function r(e){return"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}e("events"),n.isArray=o,n.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},n.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},n.print=function(){},n.puts=function(){},n.debug=function(){},n.inspect=function(e,t,c,u){function p(e,c){if(e&&"function"==typeof e.inspect&&e!==n&&(!e.constructor||e.constructor.prototype!==e))return e.inspect(c);switch(typeof e){case"undefined":return h("undefined","undefined");case"string":var u="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return h(u,"string");case"number":return h(""+e,"number");case"boolean":return h(""+e,"boolean")}if(null===e)return h("null","null");var f=s(e),d=t?a(e):f;if("function"==typeof e&&0===d.length){if(i(e))return h(""+e,"regexp");var m=e.name?": "+e.name:"";return h("[Function"+m+"]","special")}if(r(e)&&0===d.length)return h(e.toUTCString(),"date");var y,g,v;if(o(e)?(g="Array",v=["[","]"]):(g="Object",v=["{","}"]),"function"==typeof e){var b=e.name?": "+e.name:"";y=i(e)?" "+e:" [Function"+b+"]"}else y="";if(r(e)&&(y=" "+e.toUTCString()),0===d.length)return v[0]+y+v[1];if(0>c)return i(e)?h(""+e,"regexp"):h("[Object]","special");l.push(e);var w=d.map(function(t){var n,i;if(e.__lookupGetter__&&(e.__lookupGetter__(t)?i=e.__lookupSetter__(t)?h("[Getter/Setter]","special"):h("[Getter]","special"):e.__lookupSetter__(t)&&(i=h("[Setter]","special"))),f.indexOf(t)<0&&(n="["+t+"]"),i||(l.indexOf(e[t])<0?(i=null===c?p(e[t]):p(e[t],c-1),i.indexOf("\n")>-1&&(i=o(e)?i.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+i.split("\n").map(function(e){return" "+e}).join("\n"))):i=h("[Circular]","special")),"undefined"==typeof n){if("Array"===g&&t.match(/^\d+$/))return i;n=JSON.stringify(""+t),n.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(n=n.substr(1,n.length-2),n=h(n,"name")):(n=n.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),n=h(n,"string"))}return n+": "+i});l.pop();var k=0,S=w.reduce(function(e,t){return k++,t.indexOf("\n")>=0&&k++,e+t.length+1},0);return w=S>50?v[0]+(""===y?"":y+"\n ")+" "+w.join(",\n ")+" "+v[1]:v[0]+y+" "+w.join(", ")+" "+v[1]}var l=[],h=function(e,t){var n={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o={special:"cyan",number:"blue","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"}[t];return o?"["+n[o][0]+"m"+e+"["+n[o][1]+"m":e};return u||(h=function(e){return e}),p(e,"undefined"==typeof c?2:c)},n.log=function(){},n.pump=null;var s=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},a=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.hasOwnProperty.call(e,n)&&t.push(n);return t},c=Object.create||function(e,t){var n;if(null===e)n={__proto__:null};else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var o=function(){};o.prototype=e,n=new o,n.__proto__=e}return"undefined"!=typeof t&&Object.defineProperties&&Object.defineProperties(n,t),n};n.inherits=function(e,t){e.super_=t,e.prototype=c(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})};var u=/%[sdj%]/g;n.format=function(e){if("string"!=typeof e){for(var t=[],o=0;o<arguments.length;o++)t.push(n.inspect(arguments[o]));return t.join(" ")}for(var o=1,i=arguments,r=i.length,s=String(e).replace(u,function(e){if("%%"===e)return"%";if(o>=r)return e;switch(e){case"%s":return String(i[o++]);case"%d":return Number(i[o++]);case"%j":return JSON.stringify(i[o++]);default:return e}}),a=i[o];r>o;a=i[++o])s+=null===a||"object"!=typeof a?" "+a:" "+n.inspect(a);return s}},{events:9}],6:[function(e,t){function n(e){var t=this,n=e||{};this.config={debug:!1,peerConnectionConfig:{iceServers:[{url:"stun:stun.l.google.com:19302"}]},peerConnectionConstraints:{optional:[{DtlsSrtpKeyAgreement:!0}]},receiveMedia:{mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!0}},enableDataChannels:!0};var o;this.screenSharingSupport=i.screenSharing,this.logger=function(){return e.debug?e.logger||console:e.logger||r}();for(o in n)this.config[o]=n[o];i.support||this.logger.error("Your browser doesn't seem to support WebRTC"),this.peers=[],s.call(this,this.config),this.on("speaking",function(){t.hardMuted||t.peers.forEach(function(e){if(e.enableDataChannels){var t=e.getDataChannel("hark");if("open"!=t.readyState)return;t.send(JSON.stringify({type:"speaking"}))}})}),this.on("stoppedSpeaking",function(){t.hardMuted||t.peers.forEach(function(e){if(e.enableDataChannels){var t=e.getDataChannel("hark");if("open"!=t.readyState)return;t.send(JSON.stringify({type:"stoppedSpeaking"}))}})}),this.on("volumeChange",function(e){t.hardMuted||t.peers.forEach(function(t){if(t.enableDataChannels){var n=t.getDataChannel("hark");if("open"!=n.readyState)return;n.send(JSON.stringify({type:"volume",volume:e}))}})}),this.config.debug&&this.on("*",function(e,n,o){var i;i=t.config.logger===r?console:t.logger,i.log("event:",e,n,o)})}var o=e("util"),i=e("webrtcsupport");e("wildemitter");var r=e("mockconsole"),s=e("localmedia"),a=e("./peer");o.inherits(n,s),n.prototype.createPeer=function(e){var t;return e.parent=this,t=new a(e),this.peers.push(t),t},n.prototype.removePeers=function(e,t){this.getPeers(e,t).forEach(function(e){e.end()})},n.prototype.getPeers=function(e,t){return this.peers.filter(function(n){return!(e&&n.id!==e||t&&n.type!==t)})},n.prototype.sendToAll=function(e,t){this.peers.forEach(function(n){n.send(e,t)})},n.prototype.sendDirectlyToAll=function(e,t,n){this.peers.forEach(function(o){o.enableDataChannels&&o.sendDirectly(e,t,n)})},t.exports=n},{"./peer":10,localmedia:11,mockconsole:3,util:8,webrtcsupport:4,wildemitter:2}],12:[function(e,t){var n=t.exports={};n.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var o=n.shift();o()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},{}],9:[function(e,t,n){function o(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;n++)if(t===e[n])return n;return-1}var i=e("__browserify_process");i.EventEmitter||(i.EventEmitter=function(){});var r=n.EventEmitter=i.EventEmitter,s="function"==typeof Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=10;r.prototype.setMaxListeners=function(e){this._events||(this._events={}),this._events.maxListeners=e},r.prototype.emit=function(e){if("error"===e&&(!this._events||!this._events.error||s(this._events.error)&&!this._events.error.length))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");if(!this._events)return!1;var t=this._events[e];if(!t)return!1;if("function"==typeof t){switch(arguments.length){case 1:t.call(this);break;case 2:t.call(this,arguments[1]);break;case 3:t.call(this,arguments[1],arguments[2]);break;default:var n=Array.prototype.slice.call(arguments,1);t.apply(this,n)}return!0}if(s(t)){for(var n=Array.prototype.slice.call(arguments,1),o=t.slice(),i=0,r=o.length;r>i;i++)o[i].apply(this,n);return!0}return!1},r.prototype.addListener=function(e,t){if("function"!=typeof t)throw new Error("addListener only takes instances of Function");if(this._events||(this._events={}),this.emit("newListener",e,t),this._events[e])if(s(this._events[e])){if(!this._events[e].warned){var n;n=void 0!==this._events.maxListeners?this._events.maxListeners:a,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),console.trace())}this._events[e].push(t)}else this._events[e]=[this._events[e],t];else this._events[e]=t;return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){var n=this;return n.on(e,function o(){n.removeListener(e,o),t.apply(this,arguments)}),this},r.prototype.removeListener=function(e,t){if("function"!=typeof t)throw new Error("removeListener only takes instances of Function");if(!this._events||!this._events[e])return this;
var n=this._events[e];if(s(n)){var i=o(n,t);if(0>i)return this;n.splice(i,1),0==n.length&&delete this._events[e]}else this._events[e]===t&&delete this._events[e];return this},r.prototype.removeAllListeners=function(e){return 0===arguments.length?(this._events={},this):(e&&this._events&&this._events[e]&&(this._events[e]=null),this)},r.prototype.listeners=function(e){return this._events||(this._events={}),this._events[e]||(this._events[e]=[]),s(this._events[e])||(this._events[e]=[this._events[e]]),this._events[e]},r.listenerCount=function(e,t){var n;return n=e._events&&e._events[t]?"function"==typeof e._events[t]?1:e._events[t].length:0}},{__browserify_process:12}],10:[function(e,t){function n(e){var t=this;this.id=e.id,this.parent=e.parent,this.type=e.type||"video",this.oneway=e.oneway||!1,this.sharemyscreen=e.sharemyscreen||!1,this.browserPrefix=e.prefix,this.stream=e.stream,this.enableDataChannels=void 0===e.enableDataChannels?this.parent.config.enableDataChannels:e.enableDataChannels,this.receiveMedia=e.receiveMedia||this.parent.config.receiveMedia,this.channels={},this.pc=new r(this.parent.config.peerConnectionConfig,this.parent.config.peerConnectionConstraints),this.pc.on("ice",this.onIceCandidate.bind(this)),this.pc.on("addStream",this.handleRemoteStreamAdded.bind(this)),this.pc.on("addChannel",this.handleDataChannelAdded.bind(this)),this.pc.on("removeStream",this.handleStreamRemoved.bind(this)),this.pc.on("negotiationNeeded",this.emit.bind(this,"negotiationNeeded")),this.pc.on("iceConnectionStateChange",this.emit.bind(this,"iceConnectionStateChange")),this.pc.on("iceConnectionStateChange",function(){switch(t.pc.iceConnectionState){case"failed":"offer"===t.pc.pc.peerconnection.localDescription.type&&(t.parent.emit("iceFailed",t),t.send("connectivityError"))}}),this.pc.on("signalingStateChange",this.emit.bind(this,"signalingStateChange")),this.logger=this.parent.logger,"screen"===e.type?this.parent.localScreen&&this.sharemyscreen&&(this.logger.log("adding local screen stream to peer connection"),this.pc.addStream(this.parent.localScreen),this.broadcaster=e.broadcaster):this.parent.localStreams.forEach(function(e){t.pc.addStream(e)}),s.call(this),this.on("*",function(){t.parent.emit.apply(t.parent,arguments)})}var o=e("util"),i=e("webrtcsupport"),r=e("rtcpeerconnection"),s=e("wildemitter");o.inherits(n,s),n.prototype.handleMessage=function(e){var t=this;this.logger.log("getting",e.type,e),e.prefix&&(this.browserPrefix=e.prefix),"offer"===e.type?(e.payload.sdp=e.payload.sdp.replace("a=fmtp:0 profile-level-id=0x42e00c;packetization-mode=1\r\n",""),this.pc.handleOffer(e.payload,function(e){e||t.pc.answer(t.receiveMedia,function(e,n){t.send("answer",n)})})):"answer"===e.type?this.pc.handleAnswer(e.payload):"candidate"===e.type?this.pc.processIce(e.payload):"connectivityError"===e.type?this.parent.emit("connectivityError",t):"mute"===e.type?this.parent.emit("mute",{id:e.from,name:e.payload.name}):"unmute"===e.type&&this.parent.emit("unmute",{id:e.from,name:e.payload.name})},n.prototype.send=function(e,t){var n={to:this.id,broadcaster:this.broadcaster,roomType:this.type,type:e,payload:t,prefix:i.prefix};this.logger.log("sending",e,n),this.parent.emit("message",n)},n.prototype.sendDirectly=function(e,t,n){var o={type:t,payload:n};this.logger.log("sending via datachannel",e,t,o);var i=this.getDataChannel(e);return"open"!=i.readyState?!1:(i.send(JSON.stringify(o)),!0)},n.prototype._observeDataChannel=function(e){var t=this;e.onclose=this.emit.bind(this,"channelClose",e),e.onerror=this.emit.bind(this,"channelError",e),e.onmessage=function(n){t.emit("channelMessage",t,e.label,JSON.parse(n.data),e,n)},e.onopen=this.emit.bind(this,"channelOpen",e)},n.prototype.getDataChannel=function(e,t){if(!i.dataChannel)return this.emit("error",new Error("createDataChannel not supported"));var n=this.channels[e];return t||(t={}),n?n:(n=this.channels[e]=this.pc.createDataChannel(e,t),this._observeDataChannel(n),n)},n.prototype.onIceCandidate=function(e){this.closed||(e?this.send("candidate",e):this.logger.log("End of candidates."))},n.prototype.start=function(){var e=this;this.enableDataChannels&&this.getDataChannel("simplewebrtc"),this.pc.offer(this.receiveMedia,function(t,n){e.send("offer",n)})},n.prototype.end=function(){this.closed||(this.pc.close(),this.handleStreamRemoved())},n.prototype.handleRemoteStreamAdded=function(e){var t=this;this.stream?this.logger.warn("Already have a remote stream"):(this.stream=e.stream,this.stream.onended=function(){t.end()},this.parent.emit("peerStreamAdded",this))},n.prototype.handleStreamRemoved=function(){this.parent.peers.splice(this.parent.peers.indexOf(this),1),this.closed=!0,this.parent.emit("peerStreamRemoved",this)},n.prototype.handleDataChannelAdded=function(e){this.channels[e.label]=e,this._observeDataChannel(e)},t.exports=n},{rtcpeerconnection:13,util:8,webrtcsupport:4,wildemitter:2}],14:[function(e,t){var n=window.navigator.getUserMedia||window.navigator.webkitGetUserMedia||window.navigator.mozGetUserMedia||window.navigator.msGetUserMedia;t.exports=function(e,t){var o,i=2===arguments.length,r={video:!0,audio:!0},s="PermissionDeniedError",a="ConstraintNotSatisfiedError";return i||(t=e,e=r),n?(localStorage&&"true"===localStorage.useFirefoxFakeDevice&&(e.fake=!0),n.call(window.navigator,e,function(e){t(null,e)},function(e){var n;"string"==typeof e?(n=new Error("MediaStreamError"),n.name=e===s?s:a):(n=e,n.name||(e.name=n[s]?s:a)),t(n)}),void 0):(o=new Error("MediaStreamError"),o.name="NotSupportedError",t(o))}},{}],11:[function(e,t){function n(e){c.call(this);var t,n=this.config={autoAdjustMic:!1,detectSpeakingEvents:!0,media:{audio:!0,video:!0},logger:p};for(t in e)this.config[t]=e[t];this.logger=n.logger,this._log=this.logger.log.bind(this.logger,"LocalMedia:"),this._logerror=this.logger.error.bind(this.logger,"LocalMedia:"),this.screenSharingSupport=r.screenSharing,this.localStreams=[],this.localScreens=[],r.support||this._logerror("Your browser does not support local media capture.")}var o=e("util"),i=e("hark"),r=e("webrtcsupport"),s=e("getusermedia"),a=e("getscreenmedia"),c=e("wildemitter"),u=e("mediastream-gain"),p=e("mockconsole");o.inherits(n,c),n.prototype.start=function(e,t){var n=this,o=e||this.config.media;s(o,function(e,i){return e||(o.audio&&n.config.detectSpeakingEvents&&n.setupAudioMonitor(i,n.config.harkOptions),n.localStreams.push(i),n.config.autoAdjustMic&&(n.gainController=new u(i),n.setMicIfEnabled(.5)),i.onended=function(){},n.emit("localStream",i)),t?t(e,i):void 0})},n.prototype.stop=function(e){var t=this;if(e){e.stop(),t.emit("localStreamStopped",e);var n=t.localStreams.indexOf(e);n>-1&&(t.localStreams=t.localStreams.splice(n,1))}else this.audioMonitor&&(this.audioMonitor.stop(),delete this.audioMonitor),this.localStreams.forEach(function(e){e.stop(),t.emit("localStreamStopped",e)}),this.localStreams=[]},n.prototype.startScreenShare=function(e){var t=this;a(function(n,o){return n||(t.localScreens.push(o),o.onended=function(){var e=t.localScreens.indexOf(o);e>-1&&t.localScreens.splice(e,1),t.emit("localScreenStopped",o)},t.emit("localScreen",o)),e?e(n,o):void 0})},n.prototype.stopScreenShare=function(e){e?e.stop():(this.localScreens.forEach(function(e){e.stop()}),this.localScreens=[])},n.prototype.mute=function(){this._audioEnabled(!1),this.hardMuted=!0,this.emit("audioOff")},n.prototype.unmute=function(){this._audioEnabled(!0),this.hardMuted=!1,this.emit("audioOn")},n.prototype.setupAudioMonitor=function(e,t){this._log("Setup audio");var n,o=this.audioMonitor=i(e,t),r=this;o.on("speaking",function(){r.emit("speaking"),r.hardMuted||r.setMicIfEnabled(1)}),o.on("stopped_speaking",function(){n&&clearTimeout(n),n=setTimeout(function(){r.emit("stoppedSpeaking"),r.hardMuted||r.setMicIfEnabled(.5)},1e3)}),o.on("volume_change",function(e,t){r.emit("volumeChange",e,t)})},n.prototype.setMicIfEnabled=function(e){this.config.autoAdjustMic&&this.gainController.setGain(e)},n.prototype.pauseVideo=function(){this._videoEnabled(!1),this.emit("videoOff")},n.prototype.resumeVideo=function(){this._videoEnabled(!0),this.emit("videoOn")},n.prototype.pause=function(){this.mute(),this.pauseVideo()},n.prototype.resume=function(){this.unmute(),this.resumeVideo()},n.prototype._audioEnabled=function(e){this.setMicIfEnabled(e?1:0),this.localStreams.forEach(function(t){t.getAudioTracks().forEach(function(t){t.enabled=!!e})})},n.prototype._videoEnabled=function(e){this.localStreams.forEach(function(t){t.getVideoTracks().forEach(function(t){t.enabled=!!e})})},n.prototype.isAudioEnabled=function(){var e=!0;return this.localStreams.forEach(function(t){t.getAudioTracks().forEach(function(t){e=e&&t.enabled})}),e},n.prototype.isVideoEnabled=function(){var e=!0;return this.localStreams.forEach(function(t){t.getVideoTracks().forEach(function(t){e=e&&t.enabled})}),e},n.prototype.startLocalMedia=n.prototype.start,n.prototype.stopLocalMedia=n.prototype.stop,Object.defineProperty(n.prototype,"localStream",{get:function(){return this.localStreams.length>0?this.localStreams[0]:null}}),Object.defineProperty(n.prototype,"localScreen",{get:function(){return this.localScreens.length>0?this.localScreens[0]:null}}),t.exports=n},{getscreenmedia:16,getusermedia:14,hark:15,"mediastream-gain":17,mockconsole:3,util:8,webrtcsupport:4,wildemitter:2}],18:[function(e,t,n){!function(){var e=this,o=e._,i=Array.prototype,r=Object.prototype,s=Function.prototype,a=i.push,c=i.slice,u=i.concat,p=r.toString,l=r.hasOwnProperty,h=Array.isArray,f=Object.keys,d=s.bind,m=function(e){return e instanceof m?e:this instanceof m?(this._wrapped=e,void 0):new m(e)};"undefined"!=typeof n?("undefined"!=typeof t&&t.exports&&(n=t.exports=m),n._=m):e._=m,m.VERSION="1.7.0";var y=function(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,o){return e.call(t,n,o)};case 3:return function(n,o,i){return e.call(t,n,o,i)};case 4:return function(n,o,i,r){return e.call(t,n,o,i,r)}}return function(){return e.apply(t,arguments)}};m.iteratee=function(e,t,n){return null==e?m.identity:m.isFunction(e)?y(e,t,n):m.isObject(e)?m.matches(e):m.property(e)},m.each=m.forEach=function(e,t,n){if(null==e)return e;t=y(t,n);var o,i=e.length;if(i===+i)for(o=0;i>o;o++)t(e[o],o,e);else{var r=m.keys(e);for(o=0,i=r.length;i>o;o++)t(e[r[o]],r[o],e)}return e},m.map=m.collect=function(e,t,n){if(null==e)return[];t=m.iteratee(t,n);for(var o,i=e.length!==+e.length&&m.keys(e),r=(i||e).length,s=Array(r),a=0;r>a;a++)o=i?i[a]:a,s[a]=t(e[o],o,e);return s};var g="Reduce of empty array with no initial value";m.reduce=m.foldl=m.inject=function(e,t,n,o){null==e&&(e=[]),t=y(t,o,4);var i,r=e.length!==+e.length&&m.keys(e),s=(r||e).length,a=0;if(arguments.length<3){if(!s)throw new TypeError(g);n=e[r?r[a++]:a++]}for(;s>a;a++)i=r?r[a]:a,n=t(n,e[i],i,e);return n},m.reduceRight=m.foldr=function(e,t,n,o){null==e&&(e=[]),t=y(t,o,4);var i,r=e.length!==+e.length&&m.keys(e),s=(r||e).length;if(arguments.length<3){if(!s)throw new TypeError(g);n=e[r?r[--s]:--s]}for(;s--;)i=r?r[s]:s,n=t(n,e[i],i,e);return n},m.find=m.detect=function(e,t,n){var o;return t=m.iteratee(t,n),m.some(e,function(e,n,i){return t(e,n,i)?(o=e,!0):void 0}),o},m.filter=m.select=function(e,t,n){var o=[];return null==e?o:(t=m.iteratee(t,n),m.each(e,function(e,n,i){t(e,n,i)&&o.push(e)}),o)},m.reject=function(e,t,n){return m.filter(e,m.negate(m.iteratee(t)),n)},m.every=m.all=function(e,t,n){if(null==e)return!0;t=m.iteratee(t,n);var o,i,r=e.length!==+e.length&&m.keys(e),s=(r||e).length;for(o=0;s>o;o++)if(i=r?r[o]:o,!t(e[i],i,e))return!1;return!0},m.some=m.any=function(e,t,n){if(null==e)return!1;t=m.iteratee(t,n);var o,i,r=e.length!==+e.length&&m.keys(e),s=(r||e).length;for(o=0;s>o;o++)if(i=r?r[o]:o,t(e[i],i,e))return!0;return!1},m.contains=m.include=function(e,t){return null==e?!1:(e.length!==+e.length&&(e=m.values(e)),m.indexOf(e,t)>=0)},m.invoke=function(e,t){var n=c.call(arguments,2),o=m.isFunction(t);return m.map(e,function(e){return(o?t:e[t]).apply(e,n)})},m.pluck=function(e,t){return m.map(e,m.property(t))},m.where=function(e,t){return m.filter(e,m.matches(t))},m.findWhere=function(e,t){return m.find(e,m.matches(t))},m.max=function(e,t,n){var o,i,r=-1/0,s=-1/0;if(null==t&&null!=e){e=e.length===+e.length?e:m.values(e);for(var a=0,c=e.length;c>a;a++)o=e[a],o>r&&(r=o)}else t=m.iteratee(t,n),m.each(e,function(e,n,o){i=t(e,n,o),(i>s||i===-1/0&&r===-1/0)&&(r=e,s=i)});return r},m.min=function(e,t,n){var o,i,r=1/0,s=1/0;if(null==t&&null!=e){e=e.length===+e.length?e:m.values(e);for(var a=0,c=e.length;c>a;a++)o=e[a],r>o&&(r=o)}else t=m.iteratee(t,n),m.each(e,function(e,n,o){i=t(e,n,o),(s>i||1/0===i&&1/0===r)&&(r=e,s=i)});return r},m.shuffle=function(e){for(var t,n=e&&e.length===+e.length?e:m.values(e),o=n.length,i=Array(o),r=0;o>r;r++)t=m.random(0,r),t!==r&&(i[r]=i[t]),i[t]=n[r];return i},m.sample=function(e,t,n){return null==t||n?(e.length!==+e.length&&(e=m.values(e)),e[m.random(e.length-1)]):m.shuffle(e).slice(0,Math.max(0,t))},m.sortBy=function(e,t,n){return t=m.iteratee(t,n),m.pluck(m.map(e,function(e,n,o){return{value:e,index:n,criteria:t(e,n,o)}}).sort(function(e,t){var n=e.criteria,o=t.criteria;if(n!==o){if(n>o||void 0===n)return 1;if(o>n||void 0===o)return-1}return e.index-t.index}),"value")};var v=function(e){return function(t,n,o){var i={};return n=m.iteratee(n,o),m.each(t,function(o,r){var s=n(o,r,t);e(i,o,s)}),i}};m.groupBy=v(function(e,t,n){m.has(e,n)?e[n].push(t):e[n]=[t]}),m.indexBy=v(function(e,t,n){e[n]=t}),m.countBy=v(function(e,t,n){m.has(e,n)?e[n]++:e[n]=1}),m.sortedIndex=function(e,t,n,o){n=m.iteratee(n,o,1);for(var i=n(t),r=0,s=e.length;s>r;){var a=r+s>>>1;n(e[a])<i?r=a+1:s=a}return r},m.toArray=function(e){return e?m.isArray(e)?c.call(e):e.length===+e.length?m.map(e,m.identity):m.values(e):[]},m.size=function(e){return null==e?0:e.length===+e.length?e.length:m.keys(e).length},m.partition=function(e,t,n){t=m.iteratee(t,n);var o=[],i=[];return m.each(e,function(e,n,r){(t(e,n,r)?o:i).push(e)}),[o,i]},m.first=m.head=m.take=function(e,t,n){return null==e?void 0:null==t||n?e[0]:0>t?[]:c.call(e,0,t)},m.initial=function(e,t,n){return c.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))},m.last=function(e,t,n){return null==e?void 0:null==t||n?e[e.length-1]:c.call(e,Math.max(e.length-t,0))},m.rest=m.tail=m.drop=function(e,t,n){return c.call(e,null==t||n?1:t)},m.compact=function(e){return m.filter(e,m.identity)};var b=function(e,t,n,o){if(t&&m.every(e,m.isArray))return u.apply(o,e);for(var i=0,r=e.length;r>i;i++){var s=e[i];m.isArray(s)||m.isArguments(s)?t?a.apply(o,s):b(s,t,n,o):n||o.push(s)}return o};m.flatten=function(e,t){return b(e,t,!1,[])},m.without=function(e){return m.difference(e,c.call(arguments,1))},m.uniq=m.unique=function(e,t,n,o){if(null==e)return[];m.isBoolean(t)||(o=n,n=t,t=!1),null!=n&&(n=m.iteratee(n,o));for(var i=[],r=[],s=0,a=e.length;a>s;s++){var c=e[s];if(t)s&&r===c||i.push(c),r=c;else if(n){var u=n(c,s,e);m.indexOf(r,u)<0&&(r.push(u),i.push(c))}else m.indexOf(i,c)<0&&i.push(c)}return i},m.union=function(){return m.uniq(b(arguments,!0,!0,[]))},m.intersection=function(e){if(null==e)return[];for(var t=[],n=arguments.length,o=0,i=e.length;i>o;o++){var r=e[o];if(!m.contains(t,r)){for(var s=1;n>s&&m.contains(arguments[s],r);s++);s===n&&t.push(r)}}return t},m.difference=function(e){var t=b(c.call(arguments,1),!0,!0,[]);return m.filter(e,function(e){return!m.contains(t,e)})},m.zip=function(e){if(null==e)return[];for(var t=m.max(arguments,"length").length,n=Array(t),o=0;t>o;o++)n[o]=m.pluck(arguments,o);return n},m.object=function(e,t){if(null==e)return{};for(var n={},o=0,i=e.length;i>o;o++)t?n[e[o]]=t[o]:n[e[o][0]]=e[o][1];return n},m.indexOf=function(e,t,n){if(null==e)return-1;var o=0,i=e.length;if(n){if("number"!=typeof n)return o=m.sortedIndex(e,t),e[o]===t?o:-1;o=0>n?Math.max(0,i+n):n}for(;i>o;o++)if(e[o]===t)return o;return-1},m.lastIndexOf=function(e,t,n){if(null==e)return-1;var o=e.length;for("number"==typeof n&&(o=0>n?o+n+1:Math.min(o,n+1));--o>=0;)if(e[o]===t)return o;return-1},m.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=n||1;for(var o=Math.max(Math.ceil((t-e)/n),0),i=Array(o),r=0;o>r;r++,e+=n)i[r]=e;return i};var w=function(){};m.bind=function(e,t){var n,o;if(d&&e.bind===d)return d.apply(e,c.call(arguments,1));if(!m.isFunction(e))throw new TypeError("Bind must be called on a function");return n=c.call(arguments,2),o=function(){if(!(this instanceof o))return e.apply(t,n.concat(c.call(arguments)));w.prototype=e.prototype;var i=new w;w.prototype=null;var r=e.apply(i,n.concat(c.call(arguments)));return m.isObject(r)?r:i}},m.partial=function(e){var t=c.call(arguments,1);return function(){for(var n=0,o=t.slice(),i=0,r=o.length;r>i;i++)o[i]===m&&(o[i]=arguments[n++]);for(;n<arguments.length;)o.push(arguments[n++]);return e.apply(this,o)}},m.bindAll=function(e){var t,n,o=arguments.length;if(1>=o)throw new Error("bindAll must be passed function names");for(t=1;o>t;t++)n=arguments[t],e[n]=m.bind(e[n],e);return e},m.memoize=function(e,t){var n=function(o){var i=n.cache,r=t?t.apply(this,arguments):o;return m.has(i,r)||(i[r]=e.apply(this,arguments)),i[r]};return n.cache={},n},m.delay=function(e,t){var n=c.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},m.defer=function(e){return m.delay.apply(m,[e,1].concat(c.call(arguments,1)))},m.throttle=function(e,t,n){var o,i,r,s=null,a=0;n||(n={});var c=function(){a=n.leading===!1?0:m.now(),s=null,r=e.apply(o,i),s||(o=i=null)};return function(){var u=m.now();a||n.leading!==!1||(a=u);var p=t-(u-a);return o=this,i=arguments,0>=p||p>t?(clearTimeout(s),s=null,a=u,r=e.apply(o,i),s||(o=i=null)):s||n.trailing===!1||(s=setTimeout(c,p)),r}},m.debounce=function(e,t,n){var o,i,r,s,a,c=function(){var u=m.now()-s;t>u&&u>0?o=setTimeout(c,t-u):(o=null,n||(a=e.apply(r,i),o||(r=i=null)))};return function(){r=this,i=arguments,s=m.now();var u=n&&!o;return o||(o=setTimeout(c,t)),u&&(a=e.apply(r,i),r=i=null),a}},m.wrap=function(e,t){return m.partial(t,e)},m.negate=function(e){return function(){return!e.apply(this,arguments)}},m.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,o=e[t].apply(this,arguments);n--;)o=e[n].call(this,o);return o}},m.after=function(e,t){return function(){return--e<1?t.apply(this,arguments):void 0}},m.before=function(e,t){var n;return function(){return--e>0?n=t.apply(this,arguments):t=null,n}},m.once=m.partial(m.before,2),m.keys=function(e){if(!m.isObject(e))return[];if(f)return f(e);var t=[];for(var n in e)m.has(e,n)&&t.push(n);return t},m.values=function(e){for(var t=m.keys(e),n=t.length,o=Array(n),i=0;n>i;i++)o[i]=e[t[i]];return o},m.pairs=function(e){for(var t=m.keys(e),n=t.length,o=Array(n),i=0;n>i;i++)o[i]=[t[i],e[t[i]]];return o},m.invert=function(e){for(var t={},n=m.keys(e),o=0,i=n.length;i>o;o++)t[e[n[o]]]=n[o];return t},m.functions=m.methods=function(e){var t=[];for(var n in e)m.isFunction(e[n])&&t.push(n);return t.sort()},m.extend=function(e){if(!m.isObject(e))return e;for(var t,n,o=1,i=arguments.length;i>o;o++){t=arguments[o];for(n in t)l.call(t,n)&&(e[n]=t[n])}return e},m.pick=function(e,t,n){var o,i={};if(null==e)return i;if(m.isFunction(t)){t=y(t,n);for(o in e){var r=e[o];t(r,o,e)&&(i[o]=r)}}else{var s=u.apply([],c.call(arguments,1));e=new Object(e);for(var a=0,p=s.length;p>a;a++)o=s[a],o in e&&(i[o]=e[o])}return i},m.omit=function(e,t,n){if(m.isFunction(t))t=m.negate(t);else{var o=m.map(u.apply([],c.call(arguments,1)),String);t=function(e,t){return!m.contains(o,t)}}return m.pick(e,t,n)},m.defaults=function(e){if(!m.isObject(e))return e;for(var t=1,n=arguments.length;n>t;t++){var o=arguments[t];for(var i in o)void 0===e[i]&&(e[i]=o[i])}return e},m.clone=function(e){return m.isObject(e)?m.isArray(e)?e.slice():m.extend({},e):e},m.tap=function(e,t){return t(e),e};var k=function(e,t,n,o){if(e===t)return 0!==e||1/e===1/t;if(null==e||null==t)return e===t;e instanceof m&&(e=e._wrapped),t instanceof m&&(t=t._wrapped);var i=p.call(e);if(i!==p.call(t))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!==+e?+t!==+t:0===+e?1/+e===1/t:+e===+t;case"[object Date]":case"[object Boolean]":return+e===+t}if("object"!=typeof e||"object"!=typeof t)return!1;for(var r=n.length;r--;)if(n[r]===e)return o[r]===t;var s=e.constructor,a=t.constructor;if(s!==a&&"constructor"in e&&"constructor"in t&&!(m.isFunction(s)&&s instanceof s&&m.isFunction(a)&&a instanceof a))return!1;n.push(e),o.push(t);var c,u;if("[object Array]"===i){if(c=e.length,u=c===t.length)for(;c--&&(u=k(e[c],t[c],n,o)););}else{var l,h=m.keys(e);if(c=h.length,u=m.keys(t).length===c)for(;c--&&(l=h[c],u=m.has(t,l)&&k(e[l],t[l],n,o)););}return n.pop(),o.pop(),u};m.isEqual=function(e,t){return k(e,t,[],[])},m.isEmpty=function(e){if(null==e)return!0;if(m.isArray(e)||m.isString(e)||m.isArguments(e))return 0===e.length;for(var t in e)if(m.has(e,t))return!1;return!0},m.isElement=function(e){return!(!e||1!==e.nodeType)},m.isArray=h||function(e){return"[object Array]"===p.call(e)},m.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},m.each(["Arguments","Function","String","Number","Date","RegExp"],function(e){m["is"+e]=function(t){return p.call(t)==="[object "+e+"]"}}),m.isArguments(arguments)||(m.isArguments=function(e){return m.has(e,"callee")}),"function"!=typeof/./&&(m.isFunction=function(e){return"function"==typeof e||!1}),m.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},m.isNaN=function(e){return m.isNumber(e)&&e!==+e},m.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"===p.call(e)},m.isNull=function(e){return null===e},m.isUndefined=function(e){return void 0===e},m.has=function(e,t){return null!=e&&l.call(e,t)},m.noConflict=function(){return e._=o,this},m.identity=function(e){return e},m.constant=function(e){return function(){return e}},m.noop=function(){},m.property=function(e){return function(t){return t[e]}},m.matches=function(e){var t=m.pairs(e),n=t.length;return function(e){if(null==e)return!n;e=new Object(e);for(var o=0;n>o;o++){var i=t[o],r=i[0];if(i[1]!==e[r]||!(r in e))return!1}return!0}},m.times=function(e,t,n){var o=Array(Math.max(0,e));t=y(t,n,1);for(var i=0;e>i;i++)o[i]=t(i);return o},m.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},m.now=Date.now||function(){return(new Date).getTime()};var S={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},T=m.invert(S),C=function(e){var t=function(t){return e[t]},n="(?:"+m.keys(e).join("|")+")",o=RegExp(n),i=RegExp(n,"g");return function(e){return e=null==e?"":""+e,o.test(e)?e.replace(i,t):e}};m.escape=C(S),m.unescape=C(T),m.result=function(e,t){if(null==e)return void 0;var n=e[t];return m.isFunction(n)?e[t]():n};var x=0;m.uniqueId=function(e){var t=++x+"";return e?e+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var E=/(.)^/,_={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},O=/\\|'|\r|\n|\u2028|\u2029/g,j=function(e){return"\\"+_[e]};m.template=function(e,t,n){!t&&n&&(t=n),t=m.defaults({},t,m.templateSettings);var o=RegExp([(t.escape||E).source,(t.interpolate||E).source,(t.evaluate||E).source].join("|")+"|$","g"),i=0,r="__p+='";e.replace(o,function(t,n,o,s,a){return r+=e.slice(i,a).replace(O,j),i=a+t.length,n?r+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":o?r+="'+\n((__t=("+o+"))==null?'':__t)+\n'":s&&(r+="';\n"+s+"\n__p+='"),t}),r+="';\n",t.variable||(r="with(obj||{}){\n"+r+"}\n"),r="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+r+"return __p;\n";try{var s=new Function(t.variable||"obj","_",r)}catch(a){throw a.source=r,a}var c=function(e){return s.call(this,e,m)},u=t.variable||"obj";return c.source="function("+u+"){\n"+r+"}",c},m.chain=function(e){var t=m(e);return t._chain=!0,t};var A=function(e){return this._chain?m(e).chain():e};m.mixin=function(e){m.each(m.functions(e),function(t){var n=m[t]=e[t];m.prototype[t]=function(){var e=[this._wrapped];return a.apply(e,arguments),A.call(this,n.apply(m,e))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=i[e];m.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],A.call(this,n)}}),m.each(["concat","join","slice"],function(e){var t=i[e];m.prototype[e]=function(){return A.call(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}.call(this)},{}],17:[function(e,t){function n(e){if(this.support=o.webAudio&&o.mediaStream,this.gain=1,this.support){var t=this.context=new o.AudioContext;this.microphone=t.createMediaStreamSource(e),this.gainFilter=t.createGain(),this.destination=t.createMediaStreamDestination(),this.outputStream=this.destination.stream,this.microphone.connect(this.gainFilter),this.gainFilter.connect(this.destination),e.addTrack(this.outputStream.getAudioTracks()[0]),e.removeTrack(e.getAudioTracks()[0])}this.stream=e}var o=e("webrtcsupport");n.prototype.setGain=function(e){this.support&&(this.gainFilter.gain.value=e,this.gain=e)},n.prototype.getGain=function(){return this.gain},n.prototype.off=function(){return this.setGain(0)},n.prototype.on=function(){this.setGain(1)},t.exports=n},{webrtcsupport:19}],20:[function(e,t,n){var o=e("./lib/tosdp"),i=e("./lib/tojson");n.toSessionSDP=o.toSessionSDP,n.toMediaSDP=o.toMediaSDP,n.toCandidateSDP=o.toCandidateSDP,n.toSessionJSON=i.toSessionJSON,n.toMediaJSON=i.toMediaJSON,n.toCandidateJSON=i.toCandidateJSON},{"./lib/tojson":21,"./lib/tosdp":22}],19:[function(e,t){var n,o=!1,i=!1,r=window.navigator.userAgent.toLowerCase();-1!==r.indexOf("firefox")?(n="moz",i=!0):-1!==r.indexOf("chrome")&&(n="webkit",o=!0);var s=window.mozRTCPeerConnection||window.webkitRTCPeerConnection,a=window.mozRTCIceCandidate||window.RTCIceCandidate,c=window.mozRTCSessionDescription||window.RTCSessionDescription,u=window.webkitMediaStream||window.MediaStream,p="https:"===window.location.protocol&&window.navigator.userAgent.match("Chrome")&&parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1],10)>=26,l=window.webkitAudioContext||window.AudioContext;t.exports={support:!!s,dataChannel:o||i||s&&s.prototype&&s.prototype.createDataChannel,prefix:n,webAudio:!(!l||!l.prototype.createMediaStreamSource),mediaStream:!(!u||!u.prototype.removeTrack),screenSharing:!!p,AudioContext:l,PeerConnection:s,SessionDescription:c,IceCandidate:a}},{}],13:[function(e,t){function n(e,t){var n,o=this;a.call(this),e=e||{},e.iceServers=e.iceServers||[],this.pc=new c(e,t),this.getLocalStreams=this.pc.getLocalStreams.bind(this.pc),this.getRemoteStreams=this.pc.getRemoteStreams.bind(this.pc),this.addStream=this.pc.addStream.bind(this.pc),this.removeStream=this.pc.removeStream.bind(this.pc),this.pc.on("*",function(){o.emit.apply(o,arguments)}),this.pc.onremovestream=this.emit.bind(this,"removeStream"),this.pc.onnegotiationneeded=this.emit.bind(this,"negotiationNeeded"),this.pc.oniceconnectionstatechange=this.emit.bind(this,"iceConnectionStateChange"),this.pc.onsignalingstatechange=this.emit.bind(this,"signalingStateChange"),this.pc.onaddstream=this._onAddStream.bind(this),this.pc.onicecandidate=this._onIce.bind(this),this.pc.ondatachannel=this._onDataChannel.bind(this),this.localDescription={contents:[]},this.remoteDescription={contents:[]},this.localStream=null,this.remoteStreams=[],this.config={debug:!1,ice:{},sid:"",isInitiator:!0,sdpSessionID:Date.now(),useJingle:!1};for(n in e)this.config[n]=e[n];this.config.debug&&this.on("*",function(){var t=e.logger||console;t.log("PeerConnection event:",arguments)}),this.hadLocalStunCandidate=!1,this.hadRemoteStunCandidate=!1,this.hadLocalRelayCandidate=!1,this.hadRemoteRelayCandidate=!1,this.hadLocalIPv6Candidate=!1,this.hadRemoteIPv6Candidate=!1,this._remoteDataChannels=[],this._localDataChannels=[]}var o=e("underscore"),i=e("util"),r=e("webrtcsupport"),s=e("sdp-jingle-json"),a=e("wildemitter"),c=e("traceablepeerconnection");i.inherits(n,a),Object.defineProperty(n.prototype,"signalingState",{get:function(){return this.pc.signalingState}}),Object.defineProperty(n.prototype,"iceConnectionState",{get:function(){return this.pc.iceConnectionState}}),n.prototype.addStream=function(e){this.localStream=e,this.pc.addStream(e)},n.prototype.processIce=function(e,t){t=t||function(){};var n=this;if(e.contents){var i=o.pluck(this.remoteDescription.contents,"name"),a=e.contents;a.forEach(function(e){var t=e.transport||{},o=t.candidates||[],a=i.indexOf(e.name),c=e.name;o.forEach(function(e){var t=s.toCandidateSDP(e)+"\r\n";n.pc.addIceCandidate(new r.IceCandidate({candidate:t,sdpMLineIndex:a,sdpMid:c})),"srflx"===e.type?n.hadRemoteStunCandidate=!0:"relay"===e.type&&(n.hadRemoteRelayCandidate=!0),-1!=e.ip.indexOf(":")&&(n.hadRemoteIPv6Candidate=!0)})})}else{0!==e.candidate.candidate.indexOf("a=")&&(e.candidate.candidate="a="+e.candidate.candidate),n.pc.addIceCandidate(new r.IceCandidate(e.candidate));var c=s.toCandidateJSON(e.candidate.candidate);"srflx"==c.type?n.hadRemoteStunCandidate=!0:"relay"==c.type&&(n.hadRemoteRelayCandidate=!0),-1!=c.ip.indexOf(":")&&(n.hadRemoteIPv6Candidate=!0)}t()},n.prototype.offer=function(e,t){var n=this,i=2===arguments.length,r=i?e:{mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!0}};t=i?t:e,t=t||function(){},this.pc.createOffer(function(e){n.pc.setLocalDescription(e,function(){var i,r={type:"offer",sdp:e.sdp};n.config.useJingle&&(i=s.toSessionJSON(e.sdp,n.config.isInitiator?"initiator":"responder"),i.sid=n.config.sid,n.localDescription=i,o.each(i.contents,function(e){var t=e.transport||{};t.ufrag&&(n.config.ice[e.name]={ufrag:t.ufrag,pwd:t.pwd})}),r.jingle=i),n.emit("offer",r),t(null,r)},function(e){n.emit("error",e),t(e)})},function(e){n.emit("error",e),t(e)},r)},n.prototype.handleOffer=function(e,t){t=t||function(){};var n=this;e.type="offer",e.jingle&&(e.sdp=s.toSessionSDP(e.jingle,n.config.sdpSessionID),n.remoteDescription=e.jingle),n.pc.setRemoteDescription(new r.SessionDescription(e),function(){t()},t)},n.prototype.answerAudioOnly=function(e){var t={mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!1}};this._answer(t,e)},n.prototype.answerBroadcastOnly=function(e){var t={mandatory:{OfferToReceiveAudio:!1,OfferToReceiveVideo:!1}};this._answer(t,e)},n.prototype.answer=function(e,t){var n=2===arguments.length,o=n?t:e,i=n?e:{mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!0}};this._answer(i,o)},n.prototype.handleAnswer=function(e,t){t=t||function(){};var n=this;e.jingle&&(e.sdp=s.toSessionSDP(e.jingle,n.config.sdpSessionID),n.remoteDescription=e.jingle),n.pc.setRemoteDescription(new r.SessionDescription(e),function(){t(null)},t)},n.prototype.close=function(){this.pc.close(),this._localDataChannels=[],this._remoteDataChannels=[],this.emit("close")},n.prototype._answer=function(e,t){t=t||function(){};var n=this;if(!this.pc.remoteDescription)throw new Error("remoteDescription not set");var o=e.enableChromeNativeSimulcast&&"webkit"===r.prefix&&null===navigator.appVersion.match(/Chromium\//)||!1;delete e.enableChromeNativeSimulcast,n.pc.createAnswer(function(e){var i=[];if(o&&(e.jingle=s.toSessionJSON(e.sdp),e.jingle.contents.length>=2&&"video"===e.jingle.contents[1].name)){var r=JSON.parse(JSON.stringify(e.jingle.contents[1].description.sources[0]));r.ssrc=""+Math.floor(4294967295*Math.random()),e.jingle.contents[1].description.sources.push(r),e.jingle.contents[1].description.sources.forEach(function(e){i.push(e.ssrc)}),e.jingle.contents[1].description.sourceGroups=[{semantics:"SIM",sources:i}],e.sdp=s.toSessionSDP(e.jingle,n.config.sdpSessionID)}n.pc.setLocalDescription(e,function(){var r={type:"answer",sdp:e.sdp};if(n.config.useJingle){var a=s.toSessionJSON(e.sdp);a.sid=n.config.sid,n.localDescription=a,r.jingle=a}o&&(r.jingle||(r.jingle=s.toSessionJSON(e.sdp)),r.jingle.contents[1].description.sources.forEach(function(e,t){-1!=i.indexOf(e.ssrc)&&(e.parameters=e.parameters.map(function(e){return"msid"===e.key&&(e.value+="-"+t),e
}))}),r.sdp=s.toSessionSDP(r.jingle)),n.emit("answer",r),t(null,r)},function(e){n.emit("error",e),t(e)})},function(e){n.emit("error",e),t(e)},e)},n.prototype._onIce=function(e){var t=this;if(e.candidate){var n=e.candidate,i={candidate:e.candidate},r=s.toCandidateJSON(n.candidate);if(t.config.useJingle){if(n.sdpMid||(n.sdpMid=t.localDescription.contents[n.sdpMLineIndex].name),!t.config.ice[n.sdpMid]){var a=s.toSessionJSON(t.pc.localDescription.sdp,t.config.isInitiator?"initiator":"responder");o.each(a.contents,function(e){var n=e.transport||{};n.ufrag&&(t.config.ice[e.name]={ufrag:n.ufrag,pwd:n.pwd})})}i.jingle={contents:[{name:n.sdpMid,creator:t.config.isInitiator?"initiator":"responder",transport:{transType:"iceUdp",ufrag:t.config.ice[n.sdpMid].ufrag,pwd:t.config.ice[n.sdpMid].pwd,candidates:[r]}}]}}"srflx"===r.type?this.hadLocalStunCandidate=!0:"relay"==r.type&&(this.hadLocalRelayCandidate=!0),-1!=r.ip.indexOf(":")&&(t.hadLocalIPv6Candidate=!0),this.emit("ice",i)}else this.emit("endOfCandidates")},n.prototype._onDataChannel=function(e){var t=e.channel;this._remoteDataChannels.push(t),this.emit("addChannel",t)},n.prototype._onAddStream=function(e){this.remoteStreams.push(e.stream),this.emit("addStream",e)},n.prototype.createDataChannel=function(e,t){var n=this.pc.createDataChannel(e,t);return this._localDataChannels.push(n),n},n.prototype.getStats=function(e){"moz"===r.prefix?this.pc.getStats(function(t){var n=[];t.forEach(function(e){n.push(e)}),e(null,n)},e):this.pc.getStats(function(t){var n=[];t.result().forEach(function(e){var t={};e.names().forEach(function(n){t[n]=e.stat(n)}),t.id=e.id,t.type=e.type,t.timestamp=e.timestamp,n.push(t)}),e(null,n)})},t.exports=n},{"sdp-jingle-json":20,traceablepeerconnection:23,underscore:18,util:8,webrtcsupport:4,wildemitter:2}],16:[function(e,t){var n=e("getusermedia"),o={};t.exports=function(e,t){var i,r=2===arguments.length,s=r?t:e;if("undefined"==typeof window||"http:"===window.location.protocol)return i=new Error("NavigatorUserMediaError"),i.name="HTTPS_REQUIRED",s(i);if(window.navigator.userAgent.match("Chrome")){var a=parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1],10),c=33;if(window.navigator.userAgent.match("Linux")&&(c=35),a>=26&&c>=a)e=r&&e||{video:{mandatory:{googLeakyBucket:!0,maxWidth:window.screen.width,maxHeight:window.screen.height,maxFrameRate:3,chromeMediaSource:"screen"}}},n(e,s);else{var u=window.setTimeout(function(){return i=new Error("NavigatorUserMediaError"),i.name="EXTENSION_UNAVAILABLE",s(i)},1e3);o[u]=[s,r?constraint:null],window.postMessage({type:"getScreen",id:u},"*")}}else if(window.navigator.userAgent.match("Firefox")){var p=parseInt(window.navigator.userAgent.match(/Firefox\/(.*)/)[1],10);p>=33?(e=r&&e||{video:{mozMediaSource:"window",mediaSource:"window"}},n(e,function(e,t){if(s(e,t),!e)var n=t.currentTime,o=window.setInterval(function(){t||window.clearInterval(o),t.currentTime==n&&(window.clearInterval(o),t.onended&&t.onended()),n=t.currentTime},500)})):(i=new Error("NavigatorUserMediaError"),i.name="EXTENSION_UNAVAILABLE")}},window.addEventListener("message",function(e){if(e.origin==window.location.origin)if("gotScreen"==e.data.type&&o[e.data.id]){var t=o[e.data.id],i=t[1],r=t[0];if(delete o[e.data.id],""===e.data.sourceId){var s=new Error("NavigatorUserMediaError");s.name="PERMISSION_DENIED",r(s)}else i=i||{audio:!1,video:{mandatory:{chromeMediaSource:"desktop",maxWidth:window.screen.width,maxHeight:window.screen.height,maxFrameRate:3},optional:[{googLeakyBucket:!0},{googTemporalLayeredScreencast:!0}]}},i.video.mandatory.chromeMediaSourceId=e.data.sourceId,n(i,r)}else"getScreenPending"==e.data.type&&window.clearTimeout(e.data.id)})},{getusermedia:14}],22:[function(e,t,n){var o={initiator:"sendonly",responder:"recvonly",both:"sendrecv",none:"inactive",sendonly:"initator",recvonly:"responder",sendrecv:"both",inactive:"none"};n.toSessionSDP=function(e,t,o){var i=["v=0","o=- "+(t||e.sid||Date.now())+" "+(o||Date.now())+" IN IP4 0.0.0.0","s=-","t=0 0"],r=e.groups||[];r.forEach(function(e){i.push("a=group:"+e.semantics+" "+e.contents.join(" "))});var s=e.contents||[];return s.forEach(function(e){i.push(n.toMediaSDP(e))}),i.join("\r\n")+"\r\n"},n.toMediaSDP=function(e){var t=[],i=e.description,r=e.transport,s=i.payloads||[],a=r&&r.fingerprints||[],c=[];if("datachannel"==i.descType?(c.push("application"),c.push("1"),c.push("DTLS/SCTP"),r.sctp&&r.sctp.forEach(function(e){c.push(e.number)})):(c.push(i.media),c.push("1"),i.encryption&&i.encryption.length>0||a.length>0?c.push("RTP/SAVPF"):c.push("RTP/AVPF"),s.forEach(function(e){c.push(e.id)})),t.push("m="+c.join(" ")),t.push("c=IN IP4 0.0.0.0"),i.bandwidth&&i.bandwidth.type&&i.bandwidth.bandwidth&&t.push("b="+i.bandwidth.type+":"+i.bandwidth.bandwidth),"rtp"==i.descType&&t.push("a=rtcp:1 IN IP4 0.0.0.0"),r){r.ufrag&&t.push("a=ice-ufrag:"+r.ufrag),r.pwd&&t.push("a=ice-pwd:"+r.pwd);var u=!1;a.forEach(function(e){t.push("a=fingerprint:"+e.hash+" "+e.value),e.setup&&!u&&t.push("a=setup:"+e.setup)}),r.sctp&&r.sctp.forEach(function(e){t.push("a=sctpmap:"+e.number+" "+e.protocol+" "+e.streams)})}"rtp"==i.descType&&t.push("a="+(o[e.senders]||"sendrecv")),t.push("a=mid:"+e.name),i.mux&&t.push("a=rtcp-mux");var p=i.encryption||[];p.forEach(function(e){t.push("a=crypto:"+e.tag+" "+e.cipherSuite+" "+e.keyParams+(e.sessionParams?" "+e.sessionParams:""))}),i.googConferenceFlag&&t.push("a=x-google-flag:conference"),s.forEach(function(e){var n="a=rtpmap:"+e.id+" "+e.name+"/"+e.clockrate;if(e.channels&&"1"!=e.channels&&(n+="/"+e.channels),t.push(n),e.parameters&&e.parameters.length){var o=["a=fmtp:"+e.id],i=[];e.parameters.forEach(function(e){i.push((e.key?e.key+"=":"")+e.value)}),o.push(i.join(";")),t.push(o.join(" "))}e.feedback&&e.feedback.forEach(function(n){"trr-int"===n.type?t.push("a=rtcp-fb:"+e.id+" trr-int "+n.value?n.value:"0"):t.push("a=rtcp-fb:"+e.id+" "+n.type+(n.subtype?" "+n.subtype:""))})}),i.feedback&&i.feedback.forEach(function(e){"trr-int"===e.type?t.push(e.value):t.push("a=rtcp-fb:* "+e.type+(e.subtype?" "+e.subtype:""))});var l=i.headerExtensions||[];l.forEach(function(e){t.push("a=extmap:"+e.id+(e.senders?"/"+o[e.senders]:"")+" "+e.uri)});var h=i.sourceGroups||[];h.forEach(function(e){t.push("a=ssrc-group:"+e.semantics+" "+e.sources.join(" "))});var f=i.sources||[];f.forEach(function(e){for(var n=0;n<e.parameters.length;n++){var o=e.parameters[n];t.push("a=ssrc:"+(e.ssrc||i.ssrc)+" "+o.key+(o.value?":"+o.value:""))}});var d=r.candidates||[];return d.forEach(function(e){t.push(n.toCandidateSDP(e))}),t.join("\r\n")},n.toCandidateSDP=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),("srflx"===n||"prflx"===n||"relay"===n)&&e.relAddr&&e.relPort&&(t.push("raddr"),t.push(e.relAddr),t.push("rport"),t.push(e.relPort)),e.tcpType&&"TCP"==e.protocol.toUpperCase()&&(t.push("tcptype"),t.push(e.tcpType)),t.push("generation"),t.push(e.generation||"0"),"a=candidate:"+t.join(" ")}},{}],15:[function(e,t){function n(e,t){var n=-1/0;e.getFloatFrequencyData(t);for(var o=4,i=t.length;i>o;o++)t[o]>n&&t[o]<0&&(n=t[o]);return n}var o=e("wildemitter"),i=window.webkitAudioContext||window.AudioContext,r=null;t.exports=function(e,t){var s=new o;if(!i)return s;var t=t||{},a=t.smoothing||.1,c=t.interval||50,u=t.threshold,p=t.play,l=t.history||10,h=!0;r||(r=new i);var f,d,m;m=r.createAnalyser(),m.fftSize=512,m.smoothingTimeConstant=a,d=new Float32Array(m.fftSize),e.jquery&&(e=e[0]),e instanceof HTMLAudioElement||e instanceof HTMLVideoElement?(f=r.createMediaElementSource(e),"undefined"==typeof p&&(p=!0),u=u||-50):(f=r.createMediaStreamSource(e),u=u||-50),f.connect(m),p&&m.connect(r.destination),s.speaking=!1,s.setThreshold=function(e){u=e},s.setInterval=function(e){c=e},s.stop=function(){h=!1,s.emit("volume_change",-100,u),s.speaking&&(s.speaking=!1,s.emit("stopped_speaking"))},s.speakingHistory=[];for(var y=0;l>y;y++)s.speakingHistory.push(0);var g=function(){setTimeout(function(){if(h){var e=n(m,d);s.emit("volume_change",e,u);var t=0;if(e>u&&!s.speaking){for(var o=s.speakingHistory.length-3;o<s.speakingHistory.length;o++)t+=s.speakingHistory[o];t>=2&&(s.speaking=!0,s.emit("speaking"))}else if(u>e&&s.speaking){for(var o=0;o<s.speakingHistory.length;o++)t+=s.speakingHistory[o];0==t&&(s.speaking=!1,s.emit("stopped_speaking"))}s.speakingHistory.shift(),s.speakingHistory.push(0+(e>u)),g()}},c)};return g(),s}},{wildemitter:2}],21:[function(e,t,n){var o=e("./parsers"),i=Math.random();n._setIdCounter=function(e){i=e},n.toSessionJSON=function(e,t){for(var i=e.split("\r\nm="),r=1;r<i.length;r++)i[r]="m="+i[r],r!==i.length-1&&(i[r]+="\r\n");var s=i.shift()+"\r\n",a=o.lines(s),c={},u=[];i.forEach(function(e){u.push(n.toMediaJSON(e,s,t))}),c.contents=u;var p=o.findLines("a=group:",a);return p.length&&(c.groups=o.groups(p)),c},n.toMediaJSON=function(e,t,i){var r=o.lines(e),s=o.lines(t),a=o.mline(r[0]),c={creator:i,name:a.media,description:{descType:"rtp",media:a.media,payloads:[],encryption:[],feedback:[],headerExtensions:[]},transport:{transType:"iceUdp",candidates:[],fingerprints:[]}};"application"==a.media&&(c.description={descType:"datachannel"},c.transport.sctp=[]);var u=c.description,p=c.transport,l=o.findLine("a=mid:",r);if(l&&(c.name=l.substr(6)),o.findLine("a=sendrecv",r,s)?c.senders="both":o.findLine("a=sendonly",r,s)?c.senders="initiator":o.findLine("a=recvonly",r,s)?c.senders="responder":o.findLine("a=inactive",r,s)&&(c.senders="none"),"rtp"==u.descType){var h=o.findLine("b=",r);h&&(u.bandwidth=o.bandwidth(h));var f=o.findLine("a=ssrc:",r);f&&(u.ssrc=f.substr(7).split(" ")[0]);var d=o.findLines("a=rtpmap:",r);d.forEach(function(e){var t=o.rtpmap(e);t.feedback=[];var n=o.findLines("a=fmtp:"+t.id,r);n.forEach(function(e){t.parameters=o.fmtp(e)});var i=o.findLines("a=rtcp-fb:"+t.id,r);i.forEach(function(e){t.feedback.push(o.rtcpfb(e))}),u.payloads.push(t)});var m=o.findLines("a=crypto:",r,s);m.forEach(function(e){u.encryption.push(o.crypto(e))}),o.findLine("a=rtcp-mux",r)&&(u.mux=!0);var y=o.findLines("a=rtcp-fb:*",r);y.forEach(function(e){u.feedback.push(o.rtcpfb(e))});var g=o.findLines("a=extmap:",r);g.forEach(function(e){var t=o.extmap(e),n={sendonly:"responder",recvonly:"initiator",sendrecv:"both",inactive:"none"};t.senders=n[t.senders],u.headerExtensions.push(t)});var v=o.findLines("a=ssrc-group:",r);u.sourceGroups=o.sourceGroups(v||[]);var b=o.findLines("a=ssrc:",r);u.sources=o.sources(b||[]),o.findLine("a=x-google-flag:conference",r,s)&&(u.googConferenceFlag=!0)}var w=o.findLines("a=fingerprint:",r,s),k=o.findLine("a=setup:",r,s);w.forEach(function(e){var t=o.fingerprint(e);k&&(t.setup=k.substr(8)),p.fingerprints.push(t)});var S=o.findLine("a=ice-ufrag:",r,s),T=o.findLine("a=ice-pwd:",r,s);if(S&&T){p.ufrag=S.substr(12),p.pwd=T.substr(10),p.candidates=[];var C=o.findLines("a=candidate:",r,s);C.forEach(function(e){p.candidates.push(n.toCandidateJSON(e))})}if("datachannel"==u.descType){var x=o.findLines("a=sctpmap:",r);x.forEach(function(e){var t=o.sctpmap(e);p.sctp.push(t)})}return c},n.toCandidateJSON=function(e){var t=o.candidate(e.split("\r\n")[0]);return t.id=(i++).toString(36).substr(0,12),t}},{"./parsers":24}],24:[function(e,t,n){n.lines=function(e){return e.split("\r\n").filter(function(e){return e.length>0})},n.findLine=function(e,t,n){for(var o=e.length,i=0;i<t.length;i++)if(t[i].substr(0,o)===e)return t[i];if(!n)return!1;for(var r=0;r<n.length;r++)if(n[r].substr(0,o)===e)return n[r];return!1},n.findLines=function(e,t,n){for(var o=[],i=e.length,r=0;r<t.length;r++)t[r].substr(0,i)===e&&o.push(t[r]);if(o.length||!n)return o;for(var s=0;s<n.length;s++)n[s].substr(0,i)===e&&o.push(n[s]);return o},n.mline=function(e){for(var t=e.substr(2).split(" "),n={media:t[0],port:t[1],proto:t[2],formats:[]},o=3;o<t.length;o++)t[o]&&n.formats.push(t[o]);return n},n.rtpmap=function(e){var t=e.substr(9).split(" "),n={id:t.shift()};return t=t[0].split("/"),n.name=t[0],n.clockrate=t[1],n.channels=3==t.length?t[2]:"1",n},n.sctpmap=function(e){var t=e.substr(10).split(" "),n={number:t.shift(),protocol:t.shift(),streams:t.shift()};return n},n.fmtp=function(e){for(var t,n,o,i=e.substr(e.indexOf(" ")+1).split(";"),r=[],s=0;s<i.length;s++)t=i[s].split("="),n=t[0].trim(),o=t[1],n&&o?r.push({key:n,value:o}):n&&r.push({key:"",value:n});return r},n.crypto=function(e){var t=e.substr(9).split(" "),n={tag:t[0],cipherSuite:t[1],keyParams:t[2],sessionParams:t.slice(3).join(" ")};return n},n.fingerprint=function(e){var t=e.substr(14).split(" ");return{hash:t[0],value:t[1]}},n.extmap=function(e){var t=e.substr(9).split(" "),n={},o=t.shift(),i=o.indexOf("/");return i>=0?(n.id=o.substr(0,i),n.senders=o.substr(i+1)):(n.id=o,n.senders="sendrecv"),n.uri=t.shift()||"",n},n.rtcpfb=function(e){var t=e.substr(10).split(" "),n={};return n.id=t.shift(),n.type=t.shift(),"trr-int"===n.type?n.value=t.shift():n.subtype=t.shift()||"",n.parameters=t,n},n.candidate=function(e){var t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");for(var n={foundation:t[0],component:t[1],protocol:t[2].toLowerCase(),priority:t[3],ip:t[4],port:t[5],type:t[7],generation:"0"},o=8;o<t.length;o+=2)"raddr"===t[o]?n.relAddr=t[o+1]:"rport"===t[o]?n.relPort=t[o+1]:"generation"===t[o]?n.generation=t[o+1]:"tcptype"===t[o]&&(n.tcpType=t[o+1]);return n.network="1",n},n.sourceGroups=function(e){for(var t=[],n=0;n<e.length;n++){var o=e[n].substr(13).split(" ");t.push({semantics:o.shift(),sources:o})}return t},n.sources=function(e){for(var t=[],n={},o=0;o<e.length;o++){var i=e[o].substr(7).split(" "),r=i.shift();if(!n[r]){var s={ssrc:r,parameters:[]};t.push(s),n[r]=s}i=i.join(" ").split(":");var a=i.shift(),c=i.join(":")||null;n[r].parameters.push({key:a,value:c})}return t},n.groups=function(e){for(var t,n=[],o=0;o<e.length;o++)t=e[o].substr(8).split(" "),n.push({semantics:t.shift(),contents:t});return n},n.bandwidth=function(e){var t=e.substr(2).split(":"),n={};return n.type=t.shift(),n.bandwidth=t.shift(),n}},{}],23:[function(e,t){function n(e){return{type:e.type,sdp:e.sdp}}function o(e){var t={label:e.id};return e.getAudioTracks().length&&(t.audio=e.getAudioTracks().map(function(e){return e.id})),e.getVideoTracks().length&&(t.video=e.getVideoTracks().map(function(e){return e.id})),t}function i(e,t){var n=this;a.call(this),this.peerconnection=new s.PeerConnection(e,t),this.trace=function(e,t){n.emit("PeerConnectionTrace",{time:new Date,type:e,value:t||""})},this.onicecandidate=null,this.peerconnection.onicecandidate=function(e){n.trace("onicecandidate",e.candidate),null!==n.onicecandidate&&n.onicecandidate(e)},this.onaddstream=null,this.peerconnection.onaddstream=function(e){n.trace("onaddstream",o(e.stream)),null!==n.onaddstream&&n.onaddstream(e)},this.onremovestream=null,this.peerconnection.onremovestream=function(e){n.trace("onremovestream",o(e.stream)),null!==n.onremovestream&&n.onremovestream(e)},this.onsignalingstatechange=null,this.peerconnection.onsignalingstatechange=function(e){n.trace("onsignalingstatechange",n.signalingState),null!==n.onsignalingstatechange&&n.onsignalingstatechange(e)},this.oniceconnectionstatechange=null,this.peerconnection.oniceconnectionstatechange=function(e){n.trace("oniceconnectionstatechange",n.iceConnectionState),null!==n.oniceconnectionstatechange&&n.oniceconnectionstatechange(e)},this.onnegotiationneeded=null,this.peerconnection.onnegotiationneeded=function(e){n.trace("onnegotiationneeded"),null!==n.onnegotiationneeded&&n.onnegotiationneeded(e)},n.ondatachannel=null,this.peerconnection.ondatachannel=function(e){n.trace("ondatachannel",e),null!==n.ondatachannel&&n.ondatachannel(e)},this.getLocalStreams=this.peerconnection.getLocalStreams.bind(this.peerconnection),this.getRemoteStreams=this.peerconnection.getRemoteStreams.bind(this.peerconnection)}var r=e("util"),s=e("webrtcsupport"),a=e("wildemitter");r.inherits(i,a),Object.defineProperty(i.prototype,"signalingState",{get:function(){return this.peerconnection.signalingState}}),Object.defineProperty(i.prototype,"iceConnectionState",{get:function(){return this.peerconnection.iceConnectionState}}),Object.defineProperty(i.prototype,"localDescription",{get:function(){return this.peerconnection.localDescription}}),Object.defineProperty(i.prototype,"remoteDescription",{get:function(){return this.peerconnection.remoteDescription}}),i.prototype.addStream=function(e){this.trace("addStream",o(e)),this.peerconnection.addStream(e)},i.prototype.removeStream=function(e){this.trace("removeStream",o(e)),this.peerconnection.removeStream(e)},i.prototype.createDataChannel=function(e,t){return this.trace("createDataChannel",e,t),this.peerconnection.createDataChannel(e,t)},i.prototype.setLocalDescription=function(e,t,o){var i=this;this.trace("setLocalDescription",n(e)),this.peerconnection.setLocalDescription(e,function(){i.trace("setLocalDescriptionOnSuccess"),t()},function(e){i.trace("setLocalDescriptionOnFailure",e),o(e)})},i.prototype.setRemoteDescription=function(e,t,o){var i=this;this.trace("setRemoteDescription",n(e)),this.peerconnection.setRemoteDescription(e,function(){i.trace("setRemoteDescriptionOnSuccess"),t()},function(e){i.trace("setRemoteDescriptionOnFailure",e),o(e)})},i.prototype.close=function(){this.trace("stop"),null!==this.statsinterval&&(window.clearInterval(this.statsinterval),this.statsinterval=null),"closed"!=this.peerconnection.signalingState&&this.peerconnection.close()},i.prototype.createOffer=function(e,t,o){var i=this;this.trace("createOffer",o),this.peerconnection.createOffer(function(t){i.trace("createOfferOnSuccess",n(t)),e(t)},function(e){i.trace("createOfferOnFailure",e),t(e)},o)},i.prototype.createAnswer=function(e,t,o){var i=this;this.trace("createAnswer",o),this.peerconnection.createAnswer(function(t){i.trace("createAnswerOnSuccess",n(t)),e(t)},function(e){i.trace("createAnswerOnFailure",e),t(e)},o)},i.prototype.addIceCandidate=function(e,t,n){var o=this;this.trace("addIceCandidate",e),this.peerconnection.addIceCandidate(e,function(){t&&t()},function(e){o.trace("addIceCandidateOnFailure",e),n&&n(e)})},i.prototype.getStats=function(e,t){navigator.mozGetUserMedia?this.peerconnection.getStats(null,e,t):this.peerconnection.getStats(e)},t.exports=i},{util:8,webrtcsupport:4,wildemitter:2}]},{},[1])(1)});var io="undefined"==typeof module?{}:module.exports;!function(){!function(e,t){var n=e;n.version="0.9.16",n.protocol=1,n.transports=[],n.j=[],n.sockets={},n.connect=function(e,o){var i,r,s=n.util.parseUri(e);t&&t.location&&(s.protocol=s.protocol||t.location.protocol.slice(0,-1),s.host=s.host||(t.document?t.document.domain:t.location.hostname),s.port=s.port||t.location.port),i=n.util.uniqueUri(s);var a={host:s.host,secure:"https"==s.protocol,port:s.port||("https"==s.protocol?443:80),query:s.query||""};return n.util.merge(a,o),(a["force new connection"]||!n.sockets[i])&&(r=new n.Socket(a)),!a["force new connection"]&&r&&(n.sockets[i]=r),r=r||n.sockets[i],r.of(s.path.length>1?s.path:"")}}("object"==typeof module?module.exports:this.io={},this),function(e,t){var n=e.util={},o=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,i=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];n.parseUri=function(e){for(var t=o.exec(e||""),n={},r=14;r--;)n[i[r]]=t[r]||"";return n},n.uniqueUri=function(e){var n=e.protocol,o=e.host,i=e.port;return"document"in t?(o=o||document.domain,i=i||("https"==n&&"https:"!==document.location.protocol?443:document.location.port)):(o=o||"localhost",i||"https"!=n||(i=443)),(n||"http")+"://"+o+":"+(i||80)},n.query=function(e,t){var o=n.chunkQuery(e||""),i=[];n.merge(o,n.chunkQuery(t||""));for(var r in o)o.hasOwnProperty(r)&&i.push(r+"="+o[r]);return i.length?"?"+i.join("&"):""},n.chunkQuery=function(e){for(var t,n={},o=e.split("&"),i=0,r=o.length;r>i;++i)t=o[i].split("="),t[0]&&(n[t[0]]=t[1]);return n};var r=!1;n.load=function(e){return"document"in t&&"complete"===document.readyState||r?e():(n.on(t,"load",e,!1),void 0)},n.on=function(e,t,n,o){e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener&&e.addEventListener(t,n,o)},n.request=function(e){if(e&&"undefined"!=typeof XDomainRequest&&!n.ua.hasCORS)return new XDomainRequest;if("undefined"!=typeof XMLHttpRequest&&(!e||n.ua.hasCORS))return new XMLHttpRequest;if(!e)try{return new(window[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}return null},"undefined"!=typeof window&&n.load(function(){r=!0}),n.defer=function(e){return n.ua.webkit&&"undefined"==typeof importScripts?(n.load(function(){setTimeout(e,100)}),void 0):e()},n.merge=function(e,t,o,i){var r,s=i||[],a="undefined"==typeof o?2:o;for(r in t)t.hasOwnProperty(r)&&n.indexOf(s,r)<0&&("object"==typeof e[r]&&a?n.merge(e[r],t[r],a-1,s):(e[r]=t[r],s.push(t[r])));return e},n.mixin=function(e,t){n.merge(e.prototype,t.prototype)},n.inherit=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n},n.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},n.intersect=function(e,t){for(var o=[],i=e.length>t.length?e:t,r=e.length>t.length?t:e,s=0,a=r.length;a>s;s++)~n.indexOf(i,r[s])&&o.push(r[s]);return o},n.indexOf=function(e,t,n){for(var o=e.length,n=0>n?0>n+o?0:n+o:n||0;o>n&&e[n]!==t;n++);return n>=o?-1:n},n.toArray=function(e){for(var t=[],n=0,o=e.length;o>n;n++)t.push(e[n]);return t},n.ua={},n.ua.hasCORS="undefined"!=typeof XMLHttpRequest&&function(){try{var e=new XMLHttpRequest}catch(t){return!1}return void 0!=e.withCredentials}(),n.ua.webkit="undefined"!=typeof navigator&&/webkit/i.test(navigator.userAgent),n.ua.iDevice="undefined"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)}("undefined"!=typeof io?io:module.exports,this),function(e,t){function n(){}e.EventEmitter=n,n.prototype.on=function(e,n){return this.$events||(this.$events={}),this.$events[e]?t.util.isArray(this.$events[e])?this.$events[e].push(n):this.$events[e]=[this.$events[e],n]:this.$events[e]=n,this},n.prototype.addListener=n.prototype.on,n.prototype.once=function(e,t){function n(){o.removeListener(e,n),t.apply(this,arguments)}var o=this;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,n){if(this.$events&&this.$events[e]){var o=this.$events[e];if(t.util.isArray(o)){for(var i=-1,r=0,s=o.length;s>r;r++)if(o[r]===n||o[r].listener&&o[r].listener===n){i=r;break}if(0>i)return this;o.splice(i,1),o.length||delete this.$events[e]}else(o===n||o.listener&&o.listener===n)&&delete this.$events[e]}return this},n.prototype.removeAllListeners=function(e){return void 0===e?(this.$events={},this):(this.$events&&this.$events[e]&&(this.$events[e]=null),this)},n.prototype.listeners=function(e){return this.$events||(this.$events={}),this.$events[e]||(this.$events[e]=[]),t.util.isArray(this.$events[e])||(this.$events[e]=[this.$events[e]]),this.$events[e]},n.prototype.emit=function(e){if(!this.$events)return!1;var n=this.$events[e];if(!n)return!1;var o=Array.prototype.slice.call(arguments,1);if("function"==typeof n)n.apply(this,o);else{if(!t.util.isArray(n))return!1;for(var i=n.slice(),r=0,s=i.length;s>r;r++)i[r].apply(this,o)}return!0}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(exports,nativeJSON){"use strict";function f(e){return 10>e?"0"+e:e}function date(e){return isFinite(e.valueOf())?e.getUTCFullYear()+"-"+f(e.getUTCMonth()+1)+"-"+f(e.getUTCDate())+"T"+f(e.getUTCHours())+":"+f(e.getUTCMinutes())+":"+f(e.getUTCSeconds())+"Z":null}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,o,i,r,s,a=gap,c=t[e];switch(c instanceof Date&&(c=date(e)),"function"==typeof rep&&(c=rep.call(t,e,c)),typeof c){case"string":return quote(c);case"number":return isFinite(c)?String(c):"null";case"boolean":case"null":return String(c);case"object":if(!c)return"null";if(gap+=indent,s=[],"[object Array]"===Object.prototype.toString.apply(c)){for(r=c.length,n=0;r>n;n+=1)s[n]=str(n,c)||"null";return i=0===s.length?"[]":gap?"[\n"+gap+s.join(",\n"+gap)+"\n"+a+"]":"["+s.join(",")+"]",gap=a,i}if(rep&&"object"==typeof rep)for(r=rep.length,n=0;r>n;n+=1)"string"==typeof rep[n]&&(o=rep[n],i=str(o,c),i&&s.push(quote(o)+(gap?": ":":")+i));else for(o in c)Object.prototype.hasOwnProperty.call(c,o)&&(i=str(o,c),i&&s.push(quote(o)+(gap?": ":":")+i));return i=0===s.length?"{}":gap?"{\n"+gap+s.join(",\n"+gap)+"\n"+a+"}":"{"+s.join(",")+"}",gap=a,i}}if(nativeJSON&&nativeJSON.parse)return exports.JSON={parse:nativeJSON.parse,stringify:nativeJSON.stringify};var JSON=exports.JSON={},cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;JSON.stringify=function(e,t,n){var o;if(gap="",indent="","number"==typeof n)for(o=0;n>o;o+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str("",{"":e})},JSON.parse=function(text,reviver){function walk(e,t){var n,o,i=e[t];if(i&&"object"==typeof i)for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(o=walk(i,n),void 0!==o?i[n]=o:delete i[n]);return reviver.call(e,t,i)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof JSON?JSON:void 0),function(e,t){var n=e.parser={},o=n.packets=["disconnect","connect","heartbeat","message","json","event","ack","error","noop"],i=n.reasons=["transport not supported","client not handshaken","unauthorized"],r=n.advice=["reconnect"],s=t.JSON,a=t.util.indexOf;n.encodePacket=function(e){var t=a(o,e.type),n=e.id||"",c=e.endpoint||"",u=e.ack,p=null;switch(e.type){case"error":var l=e.reason?a(i,e.reason):"",h=e.advice?a(r,e.advice):"";(""!==l||""!==h)&&(p=l+(""!==h?"+"+h:""));break;case"message":""!==e.data&&(p=e.data);break;case"event":var f={name:e.name};e.args&&e.args.length&&(f.args=e.args),p=s.stringify(f);break;case"json":p=s.stringify(e.data);break;case"connect":e.qs&&(p=e.qs);break;case"ack":p=e.ackId+(e.args&&e.args.length?"+"+s.stringify(e.args):"")}var d=[t,n+("data"==u?"+":""),c];return null!==p&&void 0!==p&&d.push(p),d.join(":")},n.encodePayload=function(e){var t="";if(1==e.length)return e[0];for(var n=0,o=e.length;o>n;n++){var i=e[n];t+="�"+i.length+"�"+e[n]}return t};var c=/([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/;n.decodePacket=function(e){var t=e.match(c);if(!t)return{};var n=t[2]||"",e=t[5]||"",a={type:o[t[1]],endpoint:t[4]||""};switch(n&&(a.id=n,a.ack=t[3]?"data":!0),a.type){case"error":var t=e.split("+");a.reason=i[t[0]]||"",a.advice=r[t[1]]||"";break;case"message":a.data=e||"";break;case"event":try{var u=s.parse(e);a.name=u.name,a.args=u.args}catch(p){}a.args=a.args||[];break;case"json":try{a.data=s.parse(e)}catch(p){}break;case"connect":a.qs=e||"";break;case"ack":var t=e.match(/^([0-9]+)(\+)?(.*)/);if(t&&(a.ackId=t[1],a.args=[],t[3]))try{a.args=t[3]?s.parse(t[3]):[]}catch(p){}break;case"disconnect":case"heartbeat":}return a},n.decodePayload=function(e){if("�"==e.charAt(0)){for(var t=[],o=1,i="";o<e.length;o++)"�"==e.charAt(o)?(t.push(n.decodePacket(e.substr(o+1).substr(0,i))),o+=Number(i)+1,i=""):i+=e.charAt(o);return t}return[n.decodePacket(e)]}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(e,t){function n(e,t){this.socket=e,this.sessid=t}e.Transport=n,t.util.mixin(n,t.EventEmitter),n.prototype.heartbeats=function(){return!0},n.prototype.onData=function(e){if(this.clearCloseTimeout(),(this.socket.connected||this.socket.connecting||this.socket.reconnecting)&&this.setCloseTimeout(),""!==e){var n=t.parser.decodePayload(e);if(n&&n.length)for(var o=0,i=n.length;i>o;o++)this.onPacket(n[o])}return this},n.prototype.onPacket=function(e){return this.socket.setHeartbeatTimeout(),"heartbeat"==e.type?this.onHeartbeat():("connect"==e.type&&""==e.endpoint&&this.onConnect(),"error"==e.type&&"reconnect"==e.advice&&(this.isOpen=!1),this.socket.onPacket(e),this)},n.prototype.setCloseTimeout=function(){if(!this.closeTimeout){var e=this;this.closeTimeout=setTimeout(function(){e.onDisconnect()},this.socket.closeTimeout)}},n.prototype.onDisconnect=function(){return this.isOpen&&this.close(),this.clearTimeouts(),this.socket.onDisconnect(),this},n.prototype.onConnect=function(){return this.socket.onConnect(),this},n.prototype.clearCloseTimeout=function(){this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null)},n.prototype.clearTimeouts=function(){this.clearCloseTimeout(),this.reopenTimeout&&clearTimeout(this.reopenTimeout)},n.prototype.packet=function(e){this.send(t.parser.encodePacket(e))},n.prototype.onHeartbeat=function(){this.packet({type:"heartbeat"})},n.prototype.onOpen=function(){this.isOpen=!0,this.clearCloseTimeout(),this.socket.onOpen()},n.prototype.onClose=function(){this.isOpen=!1,this.socket.onClose(),this.onDisconnect()},n.prototype.prepareUrl=function(){var e=this.socket.options;return this.scheme()+"://"+e.host+":"+e.port+"/"+e.resource+"/"+t.protocol+"/"+this.name+"/"+this.sessid},n.prototype.ready=function(e,t){t.call(this)}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(e,t,n){function o(e){if(this.options={port:80,secure:!1,document:"document"in n?document:!1,resource:"socket.io",transports:t.transports,"connect timeout":1e4,"try multiple transports":!0,reconnect:!0,"reconnection delay":500,"reconnection limit":1/0,"reopen delay":3e3,"max reconnection attempts":10,"sync disconnect on unload":!1,"auto connect":!0,"flash policy port":10843,manualFlush:!1},t.util.merge(this.options,e),this.connected=!1,this.open=!1,this.connecting=!1,this.reconnecting=!1,this.namespaces={},this.buffer=[],this.doBuffer=!1,this.options["sync disconnect on unload"]&&(!this.isXDomain()||t.util.ua.hasCORS)){var o=this;t.util.on(n,"beforeunload",function(){o.disconnectSync()},!1)}this.options["auto connect"]&&this.connect()}function i(){}e.Socket=o,t.util.mixin(o,t.EventEmitter),o.prototype.of=function(e){return this.namespaces[e]||(this.namespaces[e]=new t.SocketNamespace(this,e),""!==e&&this.namespaces[e].packet({type:"connect"})),this.namespaces[e]},o.prototype.publish=function(){this.emit.apply(this,arguments);var e;for(var t in this.namespaces)this.namespaces.hasOwnProperty(t)&&(e=this.of(t),e.$emit.apply(e,arguments))},o.prototype.handshake=function(e){function n(t){t instanceof Error?(o.connecting=!1,o.onError(t.message)):e.apply(null,t.split(":"))}var o=this,r=this.options,s=["http"+(r.secure?"s":"")+":/",r.host+":"+r.port,r.resource,t.protocol,t.util.query(this.options.query,"t="+ +new Date)].join("/");if(this.isXDomain()&&!t.util.ua.hasCORS){var a=document.getElementsByTagName("script")[0],c=document.createElement("script");c.src=s+"&jsonp="+t.j.length,a.parentNode.insertBefore(c,a),t.j.push(function(e){n(e),c.parentNode.removeChild(c)})}else{var u=t.util.request();u.open("GET",s,!0),this.isXDomain()&&(u.withCredentials=!0),u.onreadystatechange=function(){4==u.readyState&&(u.onreadystatechange=i,200==u.status?n(u.responseText):403==u.status?o.onError(u.responseText):(o.connecting=!1,!o.reconnecting&&o.onError(u.responseText)))
},u.send(null)}},o.prototype.getTransport=function(e){for(var n,o=e||this.transports,i=0;n=o[i];i++)if(t.Transport[n]&&t.Transport[n].check(this)&&(!this.isXDomain()||t.Transport[n].xdomainCheck(this)))return new t.Transport[n](this,this.sessionid);return null},o.prototype.connect=function(e){if(this.connecting)return this;var n=this;return n.connecting=!0,this.handshake(function(o,i,r,s){function a(e){return n.transport&&n.transport.clearTimeouts(),n.transport=n.getTransport(e),n.transport?(n.transport.ready(n,function(){n.connecting=!0,n.publish("connecting",n.transport.name),n.transport.open(),n.options["connect timeout"]&&(n.connectTimeoutTimer=setTimeout(function(){if(!n.connected&&(n.connecting=!1,n.options["try multiple transports"])){for(var e=n.transports;e.length>0&&e.splice(0,1)[0]!=n.transport.name;);e.length?a(e):n.publish("connect_failed")}},n.options["connect timeout"]))}),void 0):n.publish("connect_failed")}n.sessionid=o,n.closeTimeout=1e3*r,n.heartbeatTimeout=1e3*i,n.transports||(n.transports=n.origTransports=s?t.util.intersect(s.split(","),n.options.transports):n.options.transports),n.setHeartbeatTimeout(),a(n.transports),n.once("connect",function(){clearTimeout(n.connectTimeoutTimer),e&&"function"==typeof e&&e()})}),this},o.prototype.setHeartbeatTimeout=function(){if(clearTimeout(this.heartbeatTimeoutTimer),!this.transport||this.transport.heartbeats()){var e=this;this.heartbeatTimeoutTimer=setTimeout(function(){e.transport.onClose()},this.heartbeatTimeout)}},o.prototype.packet=function(e){return this.connected&&!this.doBuffer?this.transport.packet(e):this.buffer.push(e),this},o.prototype.setBuffer=function(e){this.doBuffer=e,!e&&this.connected&&this.buffer.length&&(this.options.manualFlush||this.flushBuffer())},o.prototype.flushBuffer=function(){this.transport.payload(this.buffer),this.buffer=[]},o.prototype.disconnect=function(){return(this.connected||this.connecting)&&(this.open&&this.of("").packet({type:"disconnect"}),this.onDisconnect("booted")),this},o.prototype.disconnectSync=function(){var e=t.util.request(),n=["http"+(this.options.secure?"s":"")+":/",this.options.host+":"+this.options.port,this.options.resource,t.protocol,"",this.sessionid].join("/")+"/?disconnect=1";e.open("GET",n,!1),e.send(null),this.onDisconnect("booted")},o.prototype.isXDomain=function(){var e=n.location.port||("https:"==n.location.protocol?443:80);return this.options.host!==n.location.hostname||this.options.port!=e},o.prototype.onConnect=function(){this.connected||(this.connected=!0,this.connecting=!1,this.doBuffer||this.setBuffer(!1),this.emit("connect"))},o.prototype.onOpen=function(){this.open=!0},o.prototype.onClose=function(){this.open=!1,clearTimeout(this.heartbeatTimeoutTimer)},o.prototype.onPacket=function(e){this.of(e.endpoint).onPacket(e)},o.prototype.onError=function(e){e&&e.advice&&"reconnect"===e.advice&&(this.connected||this.connecting)&&(this.disconnect(),this.options.reconnect&&this.reconnect()),this.publish("error",e&&e.reason?e.reason:e)},o.prototype.onDisconnect=function(e){var t=this.connected,n=this.connecting;this.connected=!1,this.connecting=!1,this.open=!1,(t||n)&&(this.transport.close(),this.transport.clearTimeouts(),t&&(this.publish("disconnect",e),"booted"!=e&&this.options.reconnect&&!this.reconnecting&&this.reconnect()))},o.prototype.reconnect=function(){function e(){if(n.connected){for(var e in n.namespaces)n.namespaces.hasOwnProperty(e)&&""!==e&&n.namespaces[e].packet({type:"connect"});n.publish("reconnect",n.transport.name,n.reconnectionAttempts)}clearTimeout(n.reconnectionTimer),n.removeListener("connect_failed",t),n.removeListener("connect",t),n.reconnecting=!1,delete n.reconnectionAttempts,delete n.reconnectionDelay,delete n.reconnectionTimer,delete n.redoTransports,n.options["try multiple transports"]=i}function t(){return n.reconnecting?n.connected?e():n.connecting&&n.reconnecting?n.reconnectionTimer=setTimeout(t,1e3):(n.reconnectionAttempts++>=o?n.redoTransports?(n.publish("reconnect_failed"),e()):(n.on("connect_failed",t),n.options["try multiple transports"]=!0,n.transports=n.origTransports,n.transport=n.getTransport(),n.redoTransports=!0,n.connect()):(n.reconnectionDelay<r&&(n.reconnectionDelay*=2),n.connect(),n.publish("reconnecting",n.reconnectionDelay,n.reconnectionAttempts),n.reconnectionTimer=setTimeout(t,n.reconnectionDelay)),void 0):void 0}this.reconnecting=!0,this.reconnectionAttempts=0,this.reconnectionDelay=this.options["reconnection delay"];var n=this,o=this.options["max reconnection attempts"],i=this.options["try multiple transports"],r=this.options["reconnection limit"];this.options["try multiple transports"]=!1,this.reconnectionTimer=setTimeout(t,this.reconnectionDelay),this.on("connect",t)}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports,this),function(e,t){function n(e,t){this.socket=e,this.name=t||"",this.flags={},this.json=new o(this,"json"),this.ackPackets=0,this.acks={}}function o(e,t){this.namespace=e,this.name=t}e.SocketNamespace=n,t.util.mixin(n,t.EventEmitter),n.prototype.$emit=t.EventEmitter.prototype.emit,n.prototype.of=function(){return this.socket.of.apply(this.socket,arguments)},n.prototype.packet=function(e){return e.endpoint=this.name,this.socket.packet(e),this.flags={},this},n.prototype.send=function(e,t){var n={type:this.flags.json?"json":"message",data:e};return"function"==typeof t&&(n.id=++this.ackPackets,n.ack=!0,this.acks[n.id]=t),this.packet(n)},n.prototype.emit=function(e){var t=Array.prototype.slice.call(arguments,1),n=t[t.length-1],o={type:"event",name:e};return"function"==typeof n&&(o.id=++this.ackPackets,o.ack="data",this.acks[o.id]=n,t=t.slice(0,t.length-1)),o.args=t,this.packet(o)},n.prototype.disconnect=function(){return""===this.name?this.socket.disconnect():(this.packet({type:"disconnect"}),this.$emit("disconnect")),this},n.prototype.onPacket=function(e){function n(){o.packet({type:"ack",args:t.util.toArray(arguments),ackId:e.id})}var o=this;switch(e.type){case"connect":this.$emit("connect");break;case"disconnect":""===this.name?this.socket.onDisconnect(e.reason||"booted"):this.$emit("disconnect",e.reason);break;case"message":case"json":var i=["message",e.data];"data"==e.ack?i.push(n):e.ack&&this.packet({type:"ack",ackId:e.id}),this.$emit.apply(this,i);break;case"event":var i=[e.name].concat(e.args);"data"==e.ack&&i.push(n),this.$emit.apply(this,i);break;case"ack":this.acks[e.ackId]&&(this.acks[e.ackId].apply(this,e.args),delete this.acks[e.ackId]);break;case"error":e.advice?this.socket.onError(e):"unauthorized"==e.reason?this.$emit("connect_failed",e.reason):this.$emit("error",e.reason)}},o.prototype.send=function(){this.namespace.flags[this.name]=!0,this.namespace.send.apply(this.namespace,arguments)},o.prototype.emit=function(){this.namespace.flags[this.name]=!0,this.namespace.emit.apply(this.namespace,arguments)}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(e,t,n){function o(){t.Transport.apply(this,arguments)}e.websocket=o,t.util.inherit(o,t.Transport),o.prototype.name="websocket",o.prototype.open=function(){var e,o=t.util.query(this.socket.options.query),i=this;return e||(e=n.MozWebSocket||n.WebSocket),this.websocket=new e(this.prepareUrl()+o),this.websocket.onopen=function(){i.onOpen(),i.socket.setBuffer(!1)},this.websocket.onmessage=function(e){i.onData(e.data)},this.websocket.onclose=function(){i.onClose(),i.socket.setBuffer(!0)},this.websocket.onerror=function(e){i.onError(e)},this},o.prototype.send=t.util.ua.iDevice?function(e){var t=this;return setTimeout(function(){t.websocket.send(e)},0),this}:function(e){return this.websocket.send(e),this},o.prototype.payload=function(e){for(var t=0,n=e.length;n>t;t++)this.packet(e[t]);return this},o.prototype.close=function(){return this.websocket.close(),this},o.prototype.onError=function(e){this.socket.onError(e)},o.prototype.scheme=function(){return this.socket.options.secure?"wss":"ws"},o.check=function(){return"WebSocket"in n&&!("__addTask"in WebSocket)||"MozWebSocket"in n},o.xdomainCheck=function(){return!0},t.transports.push("websocket")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this),function(e,t,n){function o(e){e&&(t.Transport.apply(this,arguments),this.sendBuffer=[])}function i(){}e.XHR=o,t.util.inherit(o,t.Transport),o.prototype.open=function(){return this.socket.setBuffer(!1),this.onOpen(),this.get(),this.setCloseTimeout(),this},o.prototype.payload=function(e){for(var n=[],o=0,i=e.length;i>o;o++)n.push(t.parser.encodePacket(e[o]));this.send(t.parser.encodePayload(n))},o.prototype.send=function(e){return this.post(e),this},o.prototype.post=function(e){function t(){4==this.readyState&&(this.onreadystatechange=i,r.posting=!1,200==this.status?r.socket.setBuffer(!1):r.onClose())}function o(){this.onload=i,r.socket.setBuffer(!1)}var r=this;this.socket.setBuffer(!0),this.sendXHR=this.request("POST"),n.XDomainRequest&&this.sendXHR instanceof XDomainRequest?this.sendXHR.onload=this.sendXHR.onerror=o:this.sendXHR.onreadystatechange=t,this.sendXHR.send(e)},o.prototype.close=function(){return this.onClose(),this},o.prototype.request=function(e){var n=t.util.request(this.socket.isXDomain()),o=t.util.query(this.socket.options.query,"t="+ +new Date);if(n.open(e||"GET",this.prepareUrl()+o,!0),"POST"==e)try{n.setRequestHeader?n.setRequestHeader("Content-type","text/plain;charset=UTF-8"):n.contentType="text/plain"}catch(i){}return n},o.prototype.scheme=function(){return this.socket.options.secure?"https":"http"},o.check=function(e,o){try{var i=t.util.request(o),r=n.XDomainRequest&&i instanceof XDomainRequest,s=e&&e.options&&e.options.secure?"https:":"http:",a=n.location&&s!=n.location.protocol;if(i&&(!r||!a))return!0}catch(c){}return!1},o.xdomainCheck=function(e){return o.check(e,!0)}}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this),function(e,t){function n(){t.Transport.XHR.apply(this,arguments)}e.htmlfile=n,t.util.inherit(n,t.Transport.XHR),n.prototype.name="htmlfile",n.prototype.get=function(){this.doc=new(window[["Active"].concat("Object").join("X")])("htmlfile"),this.doc.open(),this.doc.write("<html></html>"),this.doc.close(),this.doc.parentWindow.s=this;var e=this.doc.createElement("div");e.className="socketio",this.doc.body.appendChild(e),this.iframe=this.doc.createElement("iframe"),e.appendChild(this.iframe);var n=this,o=t.util.query(this.socket.options.query,"t="+ +new Date);this.iframe.src=this.prepareUrl()+o,t.util.on(window,"unload",function(){n.destroy()})},n.prototype._=function(e,t){e=e.replace(/\\\//g,"/"),this.onData(e);try{var n=t.getElementsByTagName("script")[0];n.parentNode.removeChild(n)}catch(o){}},n.prototype.destroy=function(){if(this.iframe){try{this.iframe.src="about:blank"}catch(e){}this.doc=null,this.iframe.parentNode.removeChild(this.iframe),this.iframe=null,CollectGarbage()}},n.prototype.close=function(){return this.destroy(),t.Transport.XHR.prototype.close.call(this)},n.check=function(e){if("undefined"!=typeof window&&["Active"].concat("Object").join("X")in window)try{var n=new(window[["Active"].concat("Object").join("X")])("htmlfile");return n&&t.Transport.XHR.check(e)}catch(o){}return!1},n.xdomainCheck=function(){return!1},t.transports.push("htmlfile")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(e,t,n){function o(){t.Transport.XHR.apply(this,arguments)}function i(){}e["xhr-polling"]=o,t.util.inherit(o,t.Transport.XHR),t.util.merge(o,t.Transport.XHR),o.prototype.name="xhr-polling",o.prototype.heartbeats=function(){return!1},o.prototype.open=function(){var e=this;return t.Transport.XHR.prototype.open.call(e),!1},o.prototype.get=function(){function e(){4==this.readyState&&(this.onreadystatechange=i,200==this.status?(r.onData(this.responseText),r.get()):r.onClose())}function t(){this.onload=i,this.onerror=i,r.retryCounter=1,r.onData(this.responseText),r.get()}function o(){r.retryCounter++,!r.retryCounter||r.retryCounter>3?r.onClose():r.get()}if(this.isOpen){var r=this;this.xhr=this.request(),n.XDomainRequest&&this.xhr instanceof XDomainRequest?(this.xhr.onload=t,this.xhr.onerror=o):this.xhr.onreadystatechange=e,this.xhr.send(null)}},o.prototype.onClose=function(){if(t.Transport.XHR.prototype.onClose.call(this),this.xhr){this.xhr.onreadystatechange=this.xhr.onload=this.xhr.onerror=i;try{this.xhr.abort()}catch(e){}this.xhr=null}},o.prototype.ready=function(e,n){var o=this;t.util.defer(function(){n.call(o)})},t.transports.push("xhr-polling")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this),function(e,t,n){function o(){t.Transport["xhr-polling"].apply(this,arguments),this.index=t.j.length;var e=this;t.j.push(function(t){e._(t)})}var i=n.document&&"MozAppearance"in n.document.documentElement.style;e["jsonp-polling"]=o,t.util.inherit(o,t.Transport["xhr-polling"]),o.prototype.name="jsonp-polling",o.prototype.post=function(e){function n(){o(),i.socket.setBuffer(!1)}function o(){i.iframe&&i.form.removeChild(i.iframe);try{s=document.createElement('<iframe name="'+i.iframeId+'">')}catch(e){s=document.createElement("iframe"),s.name=i.iframeId}s.id=i.iframeId,i.form.appendChild(s),i.iframe=s}var i=this,r=t.util.query(this.socket.options.query,"t="+ +new Date+"&i="+this.index);if(!this.form){var s,a=document.createElement("form"),c=document.createElement("textarea"),u=this.iframeId="socketio_iframe_"+this.index;a.className="socketio",a.style.position="absolute",a.style.top="0px",a.style.left="0px",a.style.display="none",a.target=u,a.method="POST",a.setAttribute("accept-charset","utf-8"),c.name="d",a.appendChild(c),document.body.appendChild(a),this.form=a,this.area=c}this.form.action=this.prepareUrl()+r,o(),this.area.value=t.JSON.stringify(e);try{this.form.submit()}catch(p){}this.iframe.attachEvent?s.onreadystatechange=function(){"complete"==i.iframe.readyState&&n()}:this.iframe.onload=n,this.socket.setBuffer(!0)},o.prototype.get=function(){var e=this,n=document.createElement("script"),o=t.util.query(this.socket.options.query,"t="+ +new Date+"&i="+this.index);this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),n.async=!0,n.src=this.prepareUrl()+o,n.onerror=function(){e.onClose()};var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(n,r),this.script=n,i&&setTimeout(function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)},100)},o.prototype._=function(e){return this.onData(e),this.isOpen&&this.get(),this},o.prototype.ready=function(e,n){var o=this;return i?(t.util.load(function(){n.call(o)}),void 0):n.call(this)},o.check=function(){return"document"in n},o.xdomainCheck=function(){return!0},t.transports.push("jsonp-polling")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this),"function"==typeof define&&define.amd&&define([],function(){return io})}();