text: var vertx=vertx||{};
  !function(j){"function"===typeof define&&define.amd?define("vertxbus",["sockjs"],j):j(SockJS)}(function(j){vertx.EventBus=function(p,q){function o(){e.send(JSON.stringify({type:"ping"}))}function l(b,a,c,f){g("address","string",a);g("replyHandler","function",f,!0);k();b={type:b,address:a,body:c};d.sessionID&&(b.sessionID=d.sessionID);f&&(a=r(),b.replyAddress=a,m[a]=f);f=JSON.stringify(b);e.send(f)}function k(){if(h!=vertx.EventBus.OPEN)throw Error("INVALID_STATE_ERR");}function g(b,a,c,f){if(!f&&
  !c)throw Error("Parameter "+b+" must be specified");if(c&&typeof c!=a)throw Error("Parameter "+b+" must be of type "+a);}function r(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b,a){return a=16*Math.random(),("y"==b?a&3|8:a|0).toString(16)})}var d=this,e=new j(p,void 0,q),i={},m={},h=vertx.EventBus.CONNECTING,n=null;d.onopen=null;d.onclose=null;d.login=function(b,a,c){l("send","vertx.basicauthmanager.login",{username:b,password:a},function(a){"ok"===a.status&&(d.sessionID=
  a.sessionID);c&&(delete a.sessionID,c(a))})};d.send=function(b,a,c){l("send",b,a,c)};d.publish=function(b,a,c){l("publish",b,a,c)};d.registerHandler=function(b,a){g("address","string",b);g("handler","function",a);k();var c=i[b];c?c[c.length]=a:(c=[a],i[b]=c,e.send(JSON.stringify({type:"register",address:b})))};d.unregisterHandler=function(b,a){g("address","string",b);g("handler","function",a);k();var c=i[b];if(c){var d=c.indexOf(a);-1!=d&&c.splice(d,1);0==c.length&&(e.send(JSON.stringify({type:"unregister",
  address:b})),delete i[b])}};d.close=function(){k();n&&clearInterval(n);h=vertx.EventBus.CLOSING;e.close()};d.readyState=function(){return h};e.onopen=function(){o();n=setInterval(o,5E3);h=vertx.EventBus.OPEN;if(d.onopen)d.onopen()};e.onclose=function(){h=vertx.EventBus.CLOSED;if(d.onclose)d.onclose()};e.onmessage=function(b){var a=JSON.parse(b.data),b=a.body,c=a.replyAddress,a=a.address,f;c&&(f=function(a,b){d.send(c,a,b)});var e=i[a];if(e){a=e.slice(0);for(e=0;e<a.length;e++)a[e](b,f)}else if(e=
  m[a])delete m[a],e(b,f)}};vertx.EventBus.CONNECTING=0;vertx.EventBus.OPEN=1;vertx.EventBus.CLOSING=2;vertx.EventBus.CLOSED=3;return vertx.EventBus});