Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removed depricated web bind feature.

  • Loading branch information...
commit 72b9895f6649d85d4f555a9f233a60c4864b25bc 1 parent 7257c83
@stephenlb stephenlb authored
View
48 socket.io/socket.io.min.js
@@ -4,33 +4,33 @@ var j=!0,t=null,u=!1;function x(){return function(){}}
window.JSON&&window.JSON.stringify||function(){function a(){try{return this.valueOf()}catch(a){return t}}function c(a){d.lastIndex=0;return d.test(a)?'"'+a.replace(d,function(a){var b=H[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function b(d,h){var p,f,q,r,i,k=e,g=h[d];g&&"object"===typeof g&&(g=a.call(g));"function"===typeof m&&(g=m.call(h,d,g));switch(typeof g){case "string":return c(g);case "number":return isFinite(g)?String(g):"null";case "boolean":case "null":return String(g);
case "object":if(!g)return"null";e+=s;i=[];if("[object Array]"===Object.prototype.toString.apply(g)){r=g.length;for(p=0;p<r;p+=1)i[p]=b(p,g)||"null";q=0===i.length?"[]":e?"[\n"+e+i.join(",\n"+e)+"\n"+k+"]":"["+i.join(",")+"]";e=k;return q}if(m&&"object"===typeof m){r=m.length;for(p=0;p<r;p+=1)f=m[p],"string"===typeof f&&(q=b(f,g))&&i.push(c(f)+(e?": ":":")+q)}else for(f in g)Object.hasOwnProperty.call(g,f)&&(q=b(f,g))&&i.push(c(f)+(e?": ":":")+q);q=0===i.length?"{}":e?"{\n"+e+i.join(",\n"+e)+"\n"+
k+"}":"{"+i.join(",")+"}";e=k;return q}}window.JSON||(window.JSON={});var d=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e,s,H={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},m;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,c,d){var f;s=e="";if("number"===typeof d)for(f=0;f<d;f+=1)s+=" ";else"string"===typeof d&&(s=d);if((m=c)&&"function"!==typeof c&&("object"!==typeof c||"number"!==
-typeof c.length))throw Error("JSON.stringify");return b("",{"":a})});"function"!==typeof JSON.parse&&(JSON.parse=function(a){return eval("("+a+")")})}();var aa=1,C=u,ba=[],D="-pnpres",I=1E3,ca="/",da="&",fa=/{([\w\-]+)}/g;function ga(){return"x"+ ++aa+""+ +new Date}function J(){return+new Date}var P,ha=Math.floor(20*Math.random());P=function(a,c){return 0<a.indexOf("pubsub.")&&a.replace("pubsub","ps"+(c?ja().split("-")[0]:20>++ha?ha:ha=1))||a};
+typeof c.length))throw Error("JSON.stringify");return b("",{"":a})});"function"!==typeof JSON.parse&&(JSON.parse=function(a){return eval("("+a+")")})}();var aa=1,C=u,ba=[],G="-pnpres",I=1E3,ca="/",da="&",fa=/{([\w\-]+)}/g;function ga(){return"x"+ ++aa+""+ +new Date}function J(){return+new Date}var P,ha=Math.floor(20*Math.random());P=function(a,c){return 0<a.indexOf("pubsub.")&&a.replace("pubsub","ps"+(c?ja().split("-")[0]:20>++ha?ha:ha=1))||a};
function ka(a,c){var b=a.join(ca),d=[];if(!c)return b;Q(c,function(a,b){"undefined"!=typeof b&&(b!=t&&0<encodeURIComponent(b).length)&&d.push(a+"="+encodeURIComponent(b))});return b+="?"+d.join(da)}function la(a,c){function b(){e+c>J()?(clearTimeout(d),d=setTimeout(b,c)):(e=J(),a())}var d,e=0;return b}function na(a,c){var b=[];Q(a||[],function(a){c(a)&&b.push(a)});return b}function oa(a,c){return a.replace(fa,function(a,d){return c[d]||a})}
function ja(a){var c="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var c=16*Math.random()|0;return("x"==a?c:c&3|8).toString(16)});a&&a(c);return c}function Q(a,c){if(a&&c)if("undefined"!=typeof a[0])for(var b=0,d=a.length;b<d;)c.call(a[b],a[b],b++);else for(b in a)a.hasOwnProperty&&a.hasOwnProperty(b)&&c.call(a[b],b,a[b])}function pa(a,c){var b=[];Q(a||[],function(a,e){b.push(c(a,e))});return b}function qa(a){var c=[];Q(a,function(a,d){d.j&&c.push(a)});return c.sort()}
function ra(){setTimeout(function(){C||(C=1,Q(ba,function(a){a()}))},I)}
-if(!window.PUBNUB){var sa=function(a,c){return CryptoJS.HmacSHA256(a,c).toString(CryptoJS.enc.Base64)},ta=function(a){return document.getElementById(a)},ua=function(a){console.error(a)},va=function(a,c){var b=[];Q(a.split(/\s+/),function(a){Q((c||document).getElementsByTagName(a),function(a){b.push(a)})});return b},U=function(a,c,b){Q(a.split(","),function(a){function e(a){a||(a=window.event);b(a)||(a.cancelBubble=j,a.returnValue=u,a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation())}
-c.addEventListener?c.addEventListener(a,e,u):c.attachEvent?c.attachEvent("on"+a,e):c["on"+a]=e})},xa=function(){return va("head")[0]},V=function(a,c,b){if(b)a.setAttribute(c,b);else return a&&a.getAttribute&&a.getAttribute(c)},ya=function(a,c){for(var b in c)if(c.hasOwnProperty(b))try{a.style[b]=c[b]+(0<"|width|height|top|left|".indexOf(b)&&"number"==typeof c[b]?"px":"")}catch(d){}},Ba=function(a){return document.createElement(a)},Da=function(){return Ca||W()?0:ga()},Fa=function(a){function c(a,b){M||
-(M=1,g.onerror=t,clearTimeout(ea),a||!b||N(b),setTimeout(function(){a&&O();var b=ta(E),c=b&&b.parentNode;c&&c.removeChild(b)},I))}if(Ca||W()){a:{var b,d,e=function(){if(!H){H=1;clearTimeout(L);try{d=JSON.parse(b.responseText)}catch(a){return r(1)}s=1;f(d)}},s=0,H=0,m=a.timeout||1E4,L=setTimeout(function(){r(1)},m),h=a.b||x(),p=a.data||{},f=a.c||x(),q="undefined"===typeof a.g,r=function(a,c){s||(s=1,clearTimeout(L),b&&(b.onerror=b.onload=t,b.abort&&b.abort(),b=t),a&&h(c))};try{b=W()||window.XDomainRequest&&
-new XDomainRequest||new XMLHttpRequest;b.onerror=b.onabort=function(){r(1,b.responseText||{error:"Network Connection Error"})};b.onload=b.onloadend=e;b.onreadystatechange=function(){if(b&&4==b.readyState)switch(b.status){case 401:case 402:case 403:try{d=JSON.parse(b.responseText),r(1,d)}catch(a){return r(1,b.responseText)}}};q&&(b.timeout=m);p.pnsdk=Ea;var i=ka(a.url,p);b.open("GET",i,q);b.send()}catch(k){r(0);Ca=0;a=Fa(a);break a}a=r}return a}var g=Ba("script"),e=a.a,E=ga(),M=0,ea=setTimeout(function(){c(1)},
-a.timeout||1E4),O=a.b||x(),m=a.data||{},N=a.c||x();window[e]=function(a){c(0,a)};a.g||(g[Ga]=Ga);g.onerror=function(){c(1)};m.pnsdk=Ea;g.src=ka(a.url,m);V(g,"id",E);xa().appendChild(g);return c},Ha=function(){return!("onLine"in navigator)?1:navigator.onLine},W=function(){if(!Ia||!Ia.get)return 0;var a={id:W.id++,send:x(),abort:function(){a.id={}},open:function(c,b){W[a.id]=a;Ia.get(a.id,b)}};return a},Ga="async",Ea="PubNub-JS-Web/3.5.48",Ca=-1==navigator.userAgent.indexOf("MSIE 6");window.console||
-(window.console=window.console||{});console.log||(console.log=console.error=(window.opera||{}).postError||x());var Ja,Ka=window.localStorage;Ja={get:function(a){try{return Ka?Ka.getItem(a):-1==document.cookie.indexOf(a)?t:((document.cookie||"").match(RegExp(a+"=([^;]+)"))||[])[1]||t}catch(c){}},set:function(a,c){try{if(Ka)return Ka.setItem(a,c)&&0;document.cookie=a+"="+c+"; expires=Thu, 1 Aug 2030 20:00:00 UTC; path=/"}catch(b){}}};var Y={list:{},unbind:function(a){Y.list[a]=[]},bind:function(a,c){(Y.list[a]=
-Y.list[a]||[]).push(c)},fire:function(a,c){Q(Y.list[a]||[],function(a){a(c)})}},Z=ta("pubnub")||0,La=function(a){function c(){}function b(a,b){function c(b){b&&(ia=J()-(b/1E4+(J()-d)/2),a&&a(ia))}var d=J();b&&c(b)||z.time(c)}function d(a,b){R&&R(a,b);R=t}function e(){z.time(function(a){b(x(),a);a||d(1,{error:"Heartbeat failed to connect to Pubnub Servers.Please check your network settings."});setTimeout(e,q)})}function s(){Na()||d(1,{error:"Offline. Please check your network settings. "});setTimeout(s,
-I)}function H(a){var b=0;Q(qa(F),function(c){if(c=F[c])b++,(a||x())(c)});return b}function m(a){if(Oa){if(!y.length)return}else{a&&(y.h=0);if(y.h||!y.length)return;y.h=1}A(y.shift())}a.jsonp&&(Ca=0);var L=a.subscribe_key||"";a.uuid||Ja.get(L+"uuid");a.xdr=Fa;a.db=Ja;a.error=ua;a._is_online=Ha;a.jsonp_cb=Da;a.PNSDK=Ea;a.hmac_SHA256=sa;var h,p=+a.windowing||10,f=(+a.timeout||310)*I,q=(+a.keepalive||60)*I,r=a.noleave||0,i=a.publish_key||"demo",k=a.subscribe_key||"demo",g=a.auth_key||"",E=a.secret_key||
-"",M=a.PNSDK||"",ea=a.hmac_SHA256,O=a.ssl?"s":"",N="http"+O+"://"+(a.origin||"pubsub.pubnub.com"),K=P(N),wa=P(N),y=[],ia=0,za=0,Aa=0,R=0,ma=0,S=0,F={},Oa=a.no_wait_for_pending,A=a.xdr,l=a.error||x(),Na=a._is_online||function(){return 1},G=a.jsonp_cb||function(){return 0},T=a.db||{get:x(),set:x()},B=a.uuid||T&&T.get(k+"uuid")||"",z={LEAVE:function(a,b,c,d){var X={uuid:B,auth:g},e=P(N),c=c||x(),v=d||x(),d=G();if(0<a.indexOf(D))return j;if(r||!O||"0"==d)return u;"0"!=d&&(X.callback=d);A({g:b||O,timeout:2E3,
-a:d,data:X,c:function(a){"object"==typeof a&&a.error?v(a):c(a)},b:v,url:[e,"v2","presence","sub_key",k,"channel",encodeURIComponent(a),"leave"]});return j},history:function(a,b){var b=a.callback||b,c=a.count||a.limit||100,d=a.reverse||"false",X=a.error||x(),e=a.auth_key||g,v=a.channel,w=a.start,h=a.end,n={},i=G();if(!v)return l("Missing Channel");if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");n.stringtoken="true";n.count=c;n.reverse=d;n.auth=e;i&&(n.callback=i);w&&(n.start=
-w);h&&(n.end=h);A({a:i,data:n,c:function(a){"object"==typeof a&&a.error?X(a):b(a)},b:X,url:[K,"v2","history","sub-key",k,"channel",encodeURIComponent(v)]})},replay:function(a){var b=b||a.callback||x(),c=a.auth_key||g,d=a.source,e=a.destination,h=a.stop,v=a.start,w=a.end,Pa=a.reverse,a=a.limit,n=G(),f={};if(!d)return l("Missing Source Channel");if(!e)return l("Missing Destination Channel");if(!i)return l("Missing Publish Key");if(!k)return l("Missing Subscribe Key");"0"!=n&&(f.callback=n);h&&(f.stop=
-"all");Pa&&(f.reverse="true");v&&(f.start=v);w&&(f.end=w);a&&(f.count=a);f.auth=c;A({a:n,c:function(a){"object"==typeof a&&a.error?err(a):b(a)},b:function(){b([0,"Disconnected"])},url:[K,"v1","replay",i,k,d,e],data:f})},auth:function(a){g=a;c()},time:function(a){var b=G();A({a:b,data:{uuid:B,auth:g},timeout:5*I,url:[K,"time",b],c:function(b){a(b[0])},b:function(){a(0)}})},publish:function(a,b){var b=b||a.callback||x(),c=a.message,d=a.channel,e=a.auth_key||g,h=a.error||x(),v=G(),w="push";a.prepend&&
-(w="unshift");if(!c)return l("Missing Message");if(!d)return l("Missing Channel");if(!i)return l("Missing Publish Key");if(!k)return l("Missing Subscribe Key");c=JSON.stringify(c);y[w]({a:v,timeout:5*I,url:[K,"publish",i,k,0,encodeURIComponent(d),v,encodeURIComponent(c)],data:{uuid:B,auth:e},b:function(a){h(a);m(1)},c:function(a){"object"==typeof a&&a.error?h(a):b(a);m(1)}});m()},unsubscribe:function(a,b){var d=a.channel,b=b||a.callback||x(),e=a.error||x();S=0;ma=1;d=pa((d.join?d.join(","):""+d).split(","),
-function(a){if(F[a])return a+","+a+D}).join(",");Q(d.split(","),function(a){var c=j;a&&(C&&(c=z.LEAVE(a,0,b,e)),c||b({action:"leave"}),F[a]=0)});c()},subscribe:function(a,b){function e(a){a?setTimeout(c,I):(K=P(N,1),wa=P(N,1),setTimeout(function(){z.time(e)},I));H(function(b){if(a&&b.d)return b.d=0,b.m(b.name);!a&&!b.d&&(b.d=1,b.l(b.name))})}function h(){var a=G(),b=qa(F).join(",");b&&(d(),R=A({timeout:O,a:a,b:function(a){n(a);R=t;z.time(e)},data:{uuid:B,auth:m},url:[wa,"subscribe",k,encodeURIComponent(b),
-a,S],c:function(a){R=t;if(!a||"object"==typeof a&&"error"in a&&a.error)return n(a),setTimeout(c,I);r(a[1]);S=!S&&ma&&T.get(k)||a[1];H(function(a){a.f||(a.f=1,a.k(a.name))});y&&(S=1E4,y=0);T.set(k,a[1]);var b,d=(2<a.length?a[2]:pa(F,function(b){return pa(Array(a[0].length).join(",").split(","),function(){return b})}).join(",")).split(",");b=function(){var a=d.shift()||Aa;return[(F[a]||{}).a||za,a.split(D)[0]]};var e=J()-ia-+a[1]/1E4;Q(a[0],function(c){var d=b();d[0](c,a,d[1],e)});setTimeout(h,L)}}))}
-var i=a.channel,b=(b=b||a.callback)||a.message,m=a.auth_key||g,v=a.connect||x(),w=a.reconnect||x(),q=a.disconnect||x(),n=a.error||x(),r=a.idle||x(),s=a.presence||0,E=a.noheresync||0,y=a.backfill||0,M=a.timetoken||0,O=a.timeout||f,L=a.windowing||p;ma=a.restore;S=M;if(!i)return l("Missing Channel");if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");Q((i.join?i.join(","):""+i).split(","),function(a){var c=F[a]||{};F[Aa=a]={name:a,f:c.f,d:c.d,j:1,a:za=b,k:v,l:q,m:w};s&&(z.subscribe({channel:a+
-D,callback:s}),!c.j&&!E&&z.here_now({channel:a,callback:function(b){Q("uuids"in b?b.uuids:[],function(c){s({action:"join",uuid:c,timestamp:J(),occupancy:b.occupancy||1},b,a)})}}))});c=function(){d();setTimeout(h,L)};if(!C)return ba.push(c);c()},here_now:function(a,b){var b=a.callback||b,c=a.error||x(),d=a.auth_key||g,e=a.channel,h=G(),d={uuid:B,auth:d};if(!e)return l("Missing Channel");if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");"0"!=h&&(d.callback=h);A({a:h,data:d,
-c:function(a){"object"==typeof a&&a.error?c(a):b(a)},b:c,url:[K,"v2","presence","sub_key",k,"channel",encodeURIComponent(e)]})},grant:function(a,b){var b=a.callback||b,c=a.error||x(),d=a.channel,e=G(),h=a.ttl||-1,g=a.read?"1":"0",w=a.write?"1":"0",f=a.auth_key;if(!d)return l("Missing Channel");if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");if(!i)return l("Missing Publish Key");if(!E)return l("Missing Secret Key");"0"!=e&&(n.callback=e);var n=Math.floor((new Date).getTime()/
-1E3),m=ea(k+"\n"+i+"\ngrant\n"+(f&&0<encodeURIComponent(f).length?"auth="+encodeURIComponent(f)+"&":"")+"channel="+encodeURIComponent(d)+"&pnsdk="+encodeURIComponent(M)+"&r="+g+"&timestamp="+encodeURIComponent(n)+(-1<h?"&ttl="+h:"")+"&w="+w,E),m=m.replace(/\+/g,"-"),m=m.replace(/\//g,"_"),n={w:w,r:g,signature:m,channel:encodeURIComponent(d),timestamp:n};-1<h&&(n.ttl=h);f&&(n.auth=encodeURIComponent(f));A({a:e,data:n,c:function(a){b(a)},b:c,url:[K,"v1","auth","grant","sub-key",k]})},audit:function(a,
-b){var b=a.callback||b,c=a.error||x(),d=a.channel,e=a.auth_key,h=G();if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");if(!i)return l("Missing Publish Key");if(!E)return l("Missing Secret Key");"0"!=h&&(g.callback=h);var g=Math.floor((new Date).getTime()/1E3),f=k+"\n"+i+"\naudit\n";e&&(f+="auth="+encodeURIComponent(e)+"&");d&&(f+="channel="+encodeURIComponent(d)+"&");var f=f+("pnsdk="+encodeURIComponent(M)+"&timestamp="+g),f=ea(f,E),f=f.replace(/\+/g,"-"),f=f.replace(/\//g,
-"_"),g={signature:f,timestamp:g};d&&(g.channel=encodeURIComponent(d));e&&(g.auth=encodeURIComponent(e));A({a:h,data:g,c:function(a){b(a)},b:c,url:[K,"v1","auth","audit","sub-key",k]})},revoke:function(a,b){a.read=u;a.write=u;z.grant(a,b)},set_uuid:function(a){B=a;c()},get_uuid:function(){return B},xdr:A,ready:ra,db:T,uuid:ja,map:pa,each:Q,"each-channel":H,grep:na,offline:function(){d(1)},supplant:oa,now:J,unique:ga,updater:la};B||(B=z.uuid());T.set(k+"uuid",B);setTimeout(s,I);setTimeout(e,q);b();
-h=z;h.css=ya;h.$=ta;h.create=Ba;h.bind=U;h.head=xa;h.search=va;h.attr=V;h.events=Y;h.init=La;U("beforeunload",window,function(){h["each-channel"](function(a){h.LEAVE(a.name,0)});return j});if(a.notest)return h;U("offline",window,h.offline);U("offline",document,h.offline);return h};"complete"===document.readyState?setTimeout(ra,0):U("load",window,function(){setTimeout(ra,0)});var $=Z||{};PUBNUB=La({notest:1,publish_key:V($,"pub-key"),subscribe_key:V($,"sub-key"),ssl:!document.location.href.indexOf("https")||
-"on"==V($,"ssl"),origin:V($,"origin"),uuid:V($,"uuid")});window.jQuery&&(window.jQuery.PUBNUB=PUBNUB);"undefined"!==typeof module&&(module.exports=PUBNUB)&&ra();var Ia=ta("pubnubs")||0;if(Z){ya(Z,{position:"absolute",top:-I});if("opera"in window||V(Z,"flash"))Z.innerHTML="<object id=pubnubs data=https://pubnub.a.ssl.fastly.net/pubnub.swf><param name=movie value=https://pubnub.a.ssl.fastly.net/pubnub.swf><param name=allowscriptaccess value=always></object>";PUBNUB.rdx=function(a,c){if(!c)return W[a].onerror();
+if(!window.PUBNUB){var sa=function(a,c){return CryptoJS.HmacSHA256(a,c).toString(CryptoJS.enc.Base64)},ta=function(a){return document.getElementById(a)},ua=function(a){console.error(a)},va=function(a,c){var b=[];Q(a.split(/\s+/),function(a){Q((c||document).getElementsByTagName(a),function(a){b.push(a)})});return b},U=function(a,c,b){Q(a.split(","),function(a){function e(a){a||(a=window.event);b(a)||(a.cancelBubble=j,a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation())}c.addEventListener?
+c.addEventListener(a,e,u):c.attachEvent?c.attachEvent("on"+a,e):c["on"+a]=e})},xa=function(){return va("head")[0]},V=function(a,c,b){if(b)a.setAttribute(c,b);else return a&&a.getAttribute&&a.getAttribute(c)},ya=function(a,c){for(var b in c)if(c.hasOwnProperty(b))try{a.style[b]=c[b]+(0<"|width|height|top|left|".indexOf(b)&&"number"==typeof c[b]?"px":"")}catch(d){}},Ba=function(a){return document.createElement(a)},Da=function(){return Ca||W()?0:ga()},Fa=function(a){function c(a,b){M||(M=1,g.onerror=
+t,clearTimeout(ea),a||!b||N(b),setTimeout(function(){a&&O();var b=ta(D),c=b&&b.parentNode;c&&c.removeChild(b)},I))}if(Ca||W()){a:{var b,d,e=function(){if(!H){H=1;clearTimeout(L);try{d=JSON.parse(b.responseText)}catch(a){return r(1)}s=1;f(d)}},s=0,H=0,m=a.timeout||1E4,L=setTimeout(function(){r(1)},m),h=a.b||x(),p=a.data||{},f=a.c||x(),q="undefined"===typeof a.g,r=function(a,c){s||(s=1,clearTimeout(L),b&&(b.onerror=b.onload=t,b.abort&&b.abort(),b=t),a&&h(c))};try{b=W()||window.XDomainRequest&&new XDomainRequest||
+new XMLHttpRequest;b.onerror=b.onabort=function(){r(1,b.responseText||{error:"Network Connection Error"})};b.onload=b.onloadend=e;b.onreadystatechange=function(){if(b&&4==b.readyState)switch(b.status){case 401:case 402:case 403:try{d=JSON.parse(b.responseText),r(1,d)}catch(a){return r(1,b.responseText)}}};q&&(b.timeout=m);p.pnsdk=Ea;var i=ka(a.url,p);b.open("GET",i,q);b.send()}catch(k){r(0);Ca=0;a=Fa(a);break a}a=r}return a}var g=Ba("script"),e=a.a,D=ga(),M=0,ea=setTimeout(function(){c(1)},a.timeout||
+1E4),O=a.b||x(),m=a.data||{},N=a.c||x();window[e]=function(a){c(0,a)};a.g||(g[Ga]=Ga);g.onerror=function(){c(1)};m.pnsdk=Ea;g.src=ka(a.url,m);V(g,"id",D);xa().appendChild(g);return c},Ha=function(){return!("onLine"in navigator)?1:navigator.onLine},W=function(){if(!Ia||!Ia.get)return 0;var a={id:W.id++,send:x(),abort:function(){a.id={}},open:function(c,b){W[a.id]=a;Ia.get(a.id,b)}};return a},Ga="async",Ea="PubNub-JS-Web/3.5.48",Ca=-1==navigator.userAgent.indexOf("MSIE 6");window.console||(window.console=
+window.console||{});console.log||(console.log=console.error=(window.opera||{}).postError||x());var Ja,Ka=window.localStorage;Ja={get:function(a){try{return Ka?Ka.getItem(a):-1==document.cookie.indexOf(a)?t:((document.cookie||"").match(RegExp(a+"=([^;]+)"))||[])[1]||t}catch(c){}},set:function(a,c){try{if(Ka)return Ka.setItem(a,c)&&0;document.cookie=a+"="+c+"; expires=Thu, 1 Aug 2030 20:00:00 UTC; path=/"}catch(b){}}};var Y={list:{},unbind:function(a){Y.list[a]=[]},bind:function(a,c){(Y.list[a]=Y.list[a]||
+[]).push(c)},fire:function(a,c){Q(Y.list[a]||[],function(a){a(c)})}},Z=ta("pubnub")||0,La=function(a){function c(){}function b(a,b){function c(b){b&&(ia=J()-(b/1E4+(J()-d)/2),a&&a(ia))}var d=J();b&&c(b)||z.time(c)}function d(a,b){R&&R(a,b);R=t}function e(){z.time(function(a){b(x(),a);a||d(1,{error:"Heartbeat failed to connect to Pubnub Servers.Please check your network settings."});setTimeout(e,q)})}function s(){Na()||d(1,{error:"Offline. Please check your network settings. "});setTimeout(s,I)}function H(a){var b=
+0;Q(qa(E),function(c){if(c=E[c])b++,(a||x())(c)});return b}function m(a){if(Oa){if(!y.length)return}else{a&&(y.h=0);if(y.h||!y.length)return;y.h=1}A(y.shift())}a.jsonp&&(Ca=0);var L=a.subscribe_key||"";a.uuid||Ja.get(L+"uuid");a.xdr=Fa;a.db=Ja;a.error=ua;a._is_online=Ha;a.jsonp_cb=Da;a.PNSDK=Ea;a.hmac_SHA256=sa;var h,p=+a.windowing||10,f=(+a.timeout||310)*I,q=(+a.keepalive||60)*I,r=a.noleave||0,i=a.publish_key||"demo",k=a.subscribe_key||"demo",g=a.auth_key||"",D=a.secret_key||"",M=a.PNSDK||"",ea=
+a.hmac_SHA256,O=a.ssl?"s":"",N="http"+O+"://"+(a.origin||"pubsub.pubnub.com"),K=P(N),wa=P(N),y=[],ia=0,za=0,Aa=0,R=0,ma=0,S=0,E={},Oa=a.no_wait_for_pending,A=a.xdr,l=a.error||x(),Na=a._is_online||function(){return 1},F=a.jsonp_cb||function(){return 0},T=a.db||{get:x(),set:x()},B=a.uuid||T&&T.get(k+"uuid")||"",z={LEAVE:function(a,b,c,d){var X={uuid:B,auth:g},e=P(N),c=c||x(),v=d||x(),d=F();if(0<a.indexOf(G))return j;if(r||!O||"0"==d)return u;"0"!=d&&(X.callback=d);A({g:b||O,timeout:2E3,a:d,data:X,c:function(a){"object"==
+typeof a&&a.error?v(a):c(a)},b:v,url:[e,"v2","presence","sub_key",k,"channel",encodeURIComponent(a),"leave"]});return j},history:function(a,b){var b=a.callback||b,c=a.count||a.limit||100,d=a.reverse||"false",X=a.error||x(),e=a.auth_key||g,v=a.channel,w=a.start,h=a.end,n={},i=F();if(!v)return l("Missing Channel");if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");n.stringtoken="true";n.count=c;n.reverse=d;n.auth=e;i&&(n.callback=i);w&&(n.start=w);h&&(n.end=h);A({a:i,data:n,
+c:function(a){"object"==typeof a&&a.error?X(a):b(a)},b:X,url:[K,"v2","history","sub-key",k,"channel",encodeURIComponent(v)]})},replay:function(a){var b=b||a.callback||x(),c=a.auth_key||g,d=a.source,e=a.destination,h=a.stop,v=a.start,w=a.end,Pa=a.reverse,a=a.limit,n=F(),f={};if(!d)return l("Missing Source Channel");if(!e)return l("Missing Destination Channel");if(!i)return l("Missing Publish Key");if(!k)return l("Missing Subscribe Key");"0"!=n&&(f.callback=n);h&&(f.stop="all");Pa&&(f.reverse="true");
+v&&(f.start=v);w&&(f.end=w);a&&(f.count=a);f.auth=c;A({a:n,c:function(a){"object"==typeof a&&a.error?err(a):b(a)},b:function(){b([0,"Disconnected"])},url:[K,"v1","replay",i,k,d,e],data:f})},auth:function(a){g=a;c()},time:function(a){var b=F();A({a:b,data:{uuid:B,auth:g},timeout:5*I,url:[K,"time",b],c:function(b){a(b[0])},b:function(){a(0)}})},publish:function(a,b){var b=b||a.callback||x(),c=a.message,d=a.channel,e=a.auth_key||g,h=a.error||x(),v=F(),w="push";a.prepend&&(w="unshift");if(!c)return l("Missing Message");
+if(!d)return l("Missing Channel");if(!i)return l("Missing Publish Key");if(!k)return l("Missing Subscribe Key");c=JSON.stringify(c);y[w]({a:v,timeout:5*I,url:[K,"publish",i,k,0,encodeURIComponent(d),v,encodeURIComponent(c)],data:{uuid:B,auth:e},b:function(a){h(a);m(1)},c:function(a){"object"==typeof a&&a.error?h(a):b(a);m(1)}});m()},unsubscribe:function(a,b){var d=a.channel,b=b||a.callback||x(),e=a.error||x();S=0;ma=1;d=pa((d.join?d.join(","):""+d).split(","),function(a){if(E[a])return a+","+a+G}).join(",");
+Q(d.split(","),function(a){var c=j;a&&(C&&(c=z.LEAVE(a,0,b,e)),c||b({action:"leave"}),E[a]=0)});c()},subscribe:function(a,b){function e(a){a?setTimeout(c,I):(K=P(N,1),wa=P(N,1),setTimeout(function(){z.time(e)},I));H(function(b){if(a&&b.d)return b.d=0,b.m(b.name);!a&&!b.d&&(b.d=1,b.l(b.name))})}function h(){var a=F(),b=qa(E).join(",");b&&(d(),R=A({timeout:O,a:a,b:function(a){n(a);R=t;z.time(e)},data:{uuid:B,auth:m},url:[wa,"subscribe",k,encodeURIComponent(b),a,S],c:function(a){R=t;if(!a||"object"==
+typeof a&&"error"in a&&a.error)return n(a),setTimeout(c,I);r(a[1]);S=!S&&ma&&T.get(k)||a[1];H(function(a){a.f||(a.f=1,a.k(a.name))});y&&(S=1E4,y=0);T.set(k,a[1]);var b,d=(2<a.length?a[2]:pa(E,function(b){return pa(Array(a[0].length).join(",").split(","),function(){return b})}).join(",")).split(",");b=function(){var a=d.shift()||Aa;return[(E[a]||{}).a||za,a.split(G)[0]]};var e=J()-ia-+a[1]/1E4;Q(a[0],function(c){var d=b();d[0](c,a,d[1],e)});setTimeout(h,L)}}))}var i=a.channel,b=(b=b||a.callback)||
+a.message,m=a.auth_key||g,v=a.connect||x(),w=a.reconnect||x(),q=a.disconnect||x(),n=a.error||x(),r=a.idle||x(),s=a.presence||0,D=a.noheresync||0,y=a.backfill||0,M=a.timetoken||0,O=a.timeout||f,L=a.windowing||p;ma=a.restore;S=M;if(!i)return l("Missing Channel");if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");Q((i.join?i.join(","):""+i).split(","),function(a){var c=E[a]||{};E[Aa=a]={name:a,f:c.f,d:c.d,j:1,a:za=b,k:v,l:q,m:w};s&&(z.subscribe({channel:a+G,callback:s}),!c.j&&
+!D&&z.here_now({channel:a,callback:function(b){Q("uuids"in b?b.uuids:[],function(c){s({action:"join",uuid:c,timestamp:J(),occupancy:b.occupancy||1},b,a)})}}))});c=function(){d();setTimeout(h,L)};if(!C)return ba.push(c);c()},here_now:function(a,b){var b=a.callback||b,c=a.error||x(),d=a.auth_key||g,e=a.channel,h=F(),d={uuid:B,auth:d};if(!e)return l("Missing Channel");if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");"0"!=h&&(d.callback=h);A({a:h,data:d,c:function(a){"object"==
+typeof a&&a.error?c(a):b(a)},b:c,url:[K,"v2","presence","sub_key",k,"channel",encodeURIComponent(e)]})},grant:function(a,b){var b=a.callback||b,c=a.error||x(),d=a.channel,e=F(),h=a.ttl||-1,g=a.read?"1":"0",w=a.write?"1":"0",f=a.auth_key;if(!d)return l("Missing Channel");if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");if(!i)return l("Missing Publish Key");if(!D)return l("Missing Secret Key");"0"!=e&&(n.callback=e);var n=Math.floor((new Date).getTime()/1E3),m=ea(k+"\n"+i+
+"\ngrant\n"+(f&&0<encodeURIComponent(f).length?"auth="+encodeURIComponent(f)+"&":"")+"channel="+encodeURIComponent(d)+"&pnsdk="+encodeURIComponent(M)+"&r="+g+"&timestamp="+encodeURIComponent(n)+(-1<h?"&ttl="+h:"")+"&w="+w,D),m=m.replace(/\+/g,"-"),m=m.replace(/\//g,"_"),n={w:w,r:g,signature:m,channel:encodeURIComponent(d),timestamp:n};-1<h&&(n.ttl=h);f&&(n.auth=encodeURIComponent(f));A({a:e,data:n,c:function(a){b(a)},b:c,url:[K,"v1","auth","grant","sub-key",k]})},audit:function(a,b){var b=a.callback||
+b,c=a.error||x(),d=a.channel,e=a.auth_key,h=F();if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");if(!i)return l("Missing Publish Key");if(!D)return l("Missing Secret Key");"0"!=h&&(g.callback=h);var g=Math.floor((new Date).getTime()/1E3),f=k+"\n"+i+"\naudit\n";e&&(f+="auth="+encodeURIComponent(e)+"&");d&&(f+="channel="+encodeURIComponent(d)+"&");var f=f+("pnsdk="+encodeURIComponent(M)+"&timestamp="+g),f=ea(f,D),f=f.replace(/\+/g,"-"),f=f.replace(/\//g,"_"),g={signature:f,
+timestamp:g};d&&(g.channel=encodeURIComponent(d));e&&(g.auth=encodeURIComponent(e));A({a:h,data:g,c:function(a){b(a)},b:c,url:[K,"v1","auth","audit","sub-key",k]})},revoke:function(a,b){a.read=u;a.write=u;z.grant(a,b)},set_uuid:function(a){B=a;c()},get_uuid:function(){return B},xdr:A,ready:ra,db:T,uuid:ja,map:pa,each:Q,"each-channel":H,grep:na,offline:function(){d(1)},supplant:oa,now:J,unique:ga,updater:la};B||(B=z.uuid());T.set(k+"uuid",B);setTimeout(s,I);setTimeout(e,q);b();h=z;h.css=ya;h.$=ta;
+h.create=Ba;h.bind=U;h.head=xa;h.search=va;h.attr=V;h.events=Y;h.init=La;U("beforeunload",window,function(){h["each-channel"](function(a){h.LEAVE(a.name,0)});return j});if(a.notest)return h;U("offline",window,h.offline);U("offline",document,h.offline);return h};"complete"===document.readyState?setTimeout(ra,0):U("load",window,function(){setTimeout(ra,0)});var $=Z||{};PUBNUB=La({notest:1,publish_key:V($,"pub-key"),subscribe_key:V($,"sub-key"),ssl:!document.location.href.indexOf("https")||"on"==V($,
+"ssl"),origin:V($,"origin"),uuid:V($,"uuid")});window.jQuery&&(window.jQuery.PUBNUB=PUBNUB);"undefined"!==typeof module&&(module.exports=PUBNUB)&&ra();var Ia=ta("pubnubs")||0;if(Z){ya(Z,{position:"absolute",top:-I});if("opera"in window||V(Z,"flash"))Z.innerHTML="<object id=pubnubs data=https://pubnub.a.ssl.fastly.net/pubnub.swf><param name=movie value=https://pubnub.a.ssl.fastly.net/pubnub.swf><param name=allowscriptaccess value=always></object>";PUBNUB.rdx=function(a,c){if(!c)return W[a].onerror();
W[a].responseText=unescape(c);W[a].onload()};W.id=I}}
var Ma=PUBNUB.ws=function(a,c){if(!(this instanceof Ma))return new Ma(a,c);var b=this,a=b.url=a||"";b.protocol=c||"Sec-WebSocket-Protocol";var d=a.split("/"),d={ssl:"wss:"===d[0],origin:d[2],publish_key:d[3],subscribe_key:d[4],channel:d[5]};b.CONNECTING=0;b.OPEN=1;b.CLOSING=2;b.CLOSED=3;b.CLOSE_NORMAL=1E3;b.CLOSE_GOING_AWAY=1001;b.CLOSE_PROTOCOL_ERROR=1002;b.CLOSE_UNSUPPORTED=1003;b.CLOSE_TOO_LARGE=1004;b.CLOSE_NO_STATUS=1005;b.CLOSE_ABNORMAL=1006;b.onclose=b.onerror=b.onmessage=b.onopen=b.onsend=
x();b.binaryType="";b.extensions="";b.bufferedAmount=0;b.trasnmitting=u;b.buffer=[];b.readyState=b.CONNECTING;if(!a)return b.readyState=b.CLOSED,b.onclose({code:b.CLOSE_ABNORMAL,reason:"Missing URL",wasClean:j}),b;b.e=PUBNUB.init(d);b.e.i=d;b.i=d;b.e.subscribe({restore:u,channel:d.channel,disconnect:b.onerror,reconnect:b.onopen,error:function(){b.onclose({code:b.CLOSE_ABNORMAL,reason:"Missing URL",wasClean:u})},callback:function(a){b.onmessage({data:a})},connect:function(){b.readyState=b.OPEN;b.onopen()}})};
View
3  web/pubnub.js
@@ -1229,8 +1229,7 @@ function bind( type, el, fun ) {
if (!e) e = window.event;
if (!fun(e)) {
e.cancelBubble = true;
- e.returnValue = false;
- e.preventDefault && e.preventDefault();
+ e.preventDefault && e.preventDefault();
e.stopPropagation && e.stopPropagation();
}
};
View
48 web/pubnub.min.js
@@ -4,33 +4,33 @@ var j=!0,t=null,u=!1;function x(){return function(){}}
window.JSON&&window.JSON.stringify||function(){function a(){try{return this.valueOf()}catch(a){return t}}function c(a){d.lastIndex=0;return d.test(a)?'"'+a.replace(d,function(a){var b=H[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function b(d,h){var p,f,q,r,i,k=e,g=h[d];g&&"object"===typeof g&&(g=a.call(g));"function"===typeof m&&(g=m.call(h,d,g));switch(typeof g){case "string":return c(g);case "number":return isFinite(g)?String(g):"null";case "boolean":case "null":return String(g);
case "object":if(!g)return"null";e+=s;i=[];if("[object Array]"===Object.prototype.toString.apply(g)){r=g.length;for(p=0;p<r;p+=1)i[p]=b(p,g)||"null";q=0===i.length?"[]":e?"[\n"+e+i.join(",\n"+e)+"\n"+k+"]":"["+i.join(",")+"]";e=k;return q}if(m&&"object"===typeof m){r=m.length;for(p=0;p<r;p+=1)f=m[p],"string"===typeof f&&(q=b(f,g))&&i.push(c(f)+(e?": ":":")+q)}else for(f in g)Object.hasOwnProperty.call(g,f)&&(q=b(f,g))&&i.push(c(f)+(e?": ":":")+q);q=0===i.length?"{}":e?"{\n"+e+i.join(",\n"+e)+"\n"+
k+"}":"{"+i.join(",")+"}";e=k;return q}}window.JSON||(window.JSON={});var d=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e,s,H={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},m;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,c,d){var f;s=e="";if("number"===typeof d)for(f=0;f<d;f+=1)s+=" ";else"string"===typeof d&&(s=d);if((m=c)&&"function"!==typeof c&&("object"!==typeof c||"number"!==
-typeof c.length))throw Error("JSON.stringify");return b("",{"":a})});"function"!==typeof JSON.parse&&(JSON.parse=function(a){return eval("("+a+")")})}();var aa=1,C=u,ba=[],D="-pnpres",I=1E3,ca="/",da="&",fa=/{([\w\-]+)}/g;function ga(){return"x"+ ++aa+""+ +new Date}function J(){return+new Date}var P,ha=Math.floor(20*Math.random());P=function(a,c){return 0<a.indexOf("pubsub.")&&a.replace("pubsub","ps"+(c?ja().split("-")[0]:20>++ha?ha:ha=1))||a};
+typeof c.length))throw Error("JSON.stringify");return b("",{"":a})});"function"!==typeof JSON.parse&&(JSON.parse=function(a){return eval("("+a+")")})}();var aa=1,C=u,ba=[],G="-pnpres",I=1E3,ca="/",da="&",fa=/{([\w\-]+)}/g;function ga(){return"x"+ ++aa+""+ +new Date}function J(){return+new Date}var P,ha=Math.floor(20*Math.random());P=function(a,c){return 0<a.indexOf("pubsub.")&&a.replace("pubsub","ps"+(c?ja().split("-")[0]:20>++ha?ha:ha=1))||a};
function ka(a,c){var b=a.join(ca),d=[];if(!c)return b;Q(c,function(a,b){"undefined"!=typeof b&&(b!=t&&0<encodeURIComponent(b).length)&&d.push(a+"="+encodeURIComponent(b))});return b+="?"+d.join(da)}function la(a,c){function b(){e+c>J()?(clearTimeout(d),d=setTimeout(b,c)):(e=J(),a())}var d,e=0;return b}function na(a,c){var b=[];Q(a||[],function(a){c(a)&&b.push(a)});return b}function oa(a,c){return a.replace(fa,function(a,d){return c[d]||a})}
function ja(a){var c="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var c=16*Math.random()|0;return("x"==a?c:c&3|8).toString(16)});a&&a(c);return c}function Q(a,c){if(a&&c)if("undefined"!=typeof a[0])for(var b=0,d=a.length;b<d;)c.call(a[b],a[b],b++);else for(b in a)a.hasOwnProperty&&a.hasOwnProperty(b)&&c.call(a[b],b,a[b])}function pa(a,c){var b=[];Q(a||[],function(a,e){b.push(c(a,e))});return b}function qa(a){var c=[];Q(a,function(a,d){d.j&&c.push(a)});return c.sort()}
function ra(){setTimeout(function(){C||(C=1,Q(ba,function(a){a()}))},I)}
-if(!window.PUBNUB){var sa=function(a,c){return CryptoJS.HmacSHA256(a,c).toString(CryptoJS.enc.Base64)},ta=function(a){return document.getElementById(a)},ua=function(a){console.error(a)},va=function(a,c){var b=[];Q(a.split(/\s+/),function(a){Q((c||document).getElementsByTagName(a),function(a){b.push(a)})});return b},U=function(a,c,b){Q(a.split(","),function(a){function e(a){a||(a=window.event);b(a)||(a.cancelBubble=j,a.returnValue=u,a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation())}
-c.addEventListener?c.addEventListener(a,e,u):c.attachEvent?c.attachEvent("on"+a,e):c["on"+a]=e})},xa=function(){return va("head")[0]},V=function(a,c,b){if(b)a.setAttribute(c,b);else return a&&a.getAttribute&&a.getAttribute(c)},ya=function(a,c){for(var b in c)if(c.hasOwnProperty(b))try{a.style[b]=c[b]+(0<"|width|height|top|left|".indexOf(b)&&"number"==typeof c[b]?"px":"")}catch(d){}},Ba=function(a){return document.createElement(a)},Da=function(){return Ca||W()?0:ga()},Fa=function(a){function c(a,b){M||
-(M=1,g.onerror=t,clearTimeout(ea),a||!b||N(b),setTimeout(function(){a&&O();var b=ta(E),c=b&&b.parentNode;c&&c.removeChild(b)},I))}if(Ca||W()){a:{var b,d,e=function(){if(!H){H=1;clearTimeout(L);try{d=JSON.parse(b.responseText)}catch(a){return r(1)}s=1;f(d)}},s=0,H=0,m=a.timeout||1E4,L=setTimeout(function(){r(1)},m),h=a.b||x(),p=a.data||{},f=a.c||x(),q="undefined"===typeof a.g,r=function(a,c){s||(s=1,clearTimeout(L),b&&(b.onerror=b.onload=t,b.abort&&b.abort(),b=t),a&&h(c))};try{b=W()||window.XDomainRequest&&
-new XDomainRequest||new XMLHttpRequest;b.onerror=b.onabort=function(){r(1,b.responseText||{error:"Network Connection Error"})};b.onload=b.onloadend=e;b.onreadystatechange=function(){if(b&&4==b.readyState)switch(b.status){case 401:case 402:case 403:try{d=JSON.parse(b.responseText),r(1,d)}catch(a){return r(1,b.responseText)}}};q&&(b.timeout=m);p.pnsdk=Ea;var i=ka(a.url,p);b.open("GET",i,q);b.send()}catch(k){r(0);Ca=0;a=Fa(a);break a}a=r}return a}var g=Ba("script"),e=a.a,E=ga(),M=0,ea=setTimeout(function(){c(1)},
-a.timeout||1E4),O=a.b||x(),m=a.data||{},N=a.c||x();window[e]=function(a){c(0,a)};a.g||(g[Ga]=Ga);g.onerror=function(){c(1)};m.pnsdk=Ea;g.src=ka(a.url,m);V(g,"id",E);xa().appendChild(g);return c},Ha=function(){return!("onLine"in navigator)?1:navigator.onLine},W=function(){if(!Ia||!Ia.get)return 0;var a={id:W.id++,send:x(),abort:function(){a.id={}},open:function(c,b){W[a.id]=a;Ia.get(a.id,b)}};return a},Ga="async",Ea="PubNub-JS-Web/3.5.48",Ca=-1==navigator.userAgent.indexOf("MSIE 6");window.console||
-(window.console=window.console||{});console.log||(console.log=console.error=(window.opera||{}).postError||x());var Ja,Ka=window.localStorage;Ja={get:function(a){try{return Ka?Ka.getItem(a):-1==document.cookie.indexOf(a)?t:((document.cookie||"").match(RegExp(a+"=([^;]+)"))||[])[1]||t}catch(c){}},set:function(a,c){try{if(Ka)return Ka.setItem(a,c)&&0;document.cookie=a+"="+c+"; expires=Thu, 1 Aug 2030 20:00:00 UTC; path=/"}catch(b){}}};var Y={list:{},unbind:function(a){Y.list[a]=[]},bind:function(a,c){(Y.list[a]=
-Y.list[a]||[]).push(c)},fire:function(a,c){Q(Y.list[a]||[],function(a){a(c)})}},Z=ta("pubnub")||0,La=function(a){function c(){}function b(a,b){function c(b){b&&(ia=J()-(b/1E4+(J()-d)/2),a&&a(ia))}var d=J();b&&c(b)||z.time(c)}function d(a,b){R&&R(a,b);R=t}function e(){z.time(function(a){b(x(),a);a||d(1,{error:"Heartbeat failed to connect to Pubnub Servers.Please check your network settings."});setTimeout(e,q)})}function s(){Na()||d(1,{error:"Offline. Please check your network settings. "});setTimeout(s,
-I)}function H(a){var b=0;Q(qa(F),function(c){if(c=F[c])b++,(a||x())(c)});return b}function m(a){if(Oa){if(!y.length)return}else{a&&(y.h=0);if(y.h||!y.length)return;y.h=1}A(y.shift())}a.jsonp&&(Ca=0);var L=a.subscribe_key||"";a.uuid||Ja.get(L+"uuid");a.xdr=Fa;a.db=Ja;a.error=ua;a._is_online=Ha;a.jsonp_cb=Da;a.PNSDK=Ea;a.hmac_SHA256=sa;var h,p=+a.windowing||10,f=(+a.timeout||310)*I,q=(+a.keepalive||60)*I,r=a.noleave||0,i=a.publish_key||"demo",k=a.subscribe_key||"demo",g=a.auth_key||"",E=a.secret_key||
-"",M=a.PNSDK||"",ea=a.hmac_SHA256,O=a.ssl?"s":"",N="http"+O+"://"+(a.origin||"pubsub.pubnub.com"),K=P(N),wa=P(N),y=[],ia=0,za=0,Aa=0,R=0,ma=0,S=0,F={},Oa=a.no_wait_for_pending,A=a.xdr,l=a.error||x(),Na=a._is_online||function(){return 1},G=a.jsonp_cb||function(){return 0},T=a.db||{get:x(),set:x()},B=a.uuid||T&&T.get(k+"uuid")||"",z={LEAVE:function(a,b,c,d){var X={uuid:B,auth:g},e=P(N),c=c||x(),v=d||x(),d=G();if(0<a.indexOf(D))return j;if(r||!O||"0"==d)return u;"0"!=d&&(X.callback=d);A({g:b||O,timeout:2E3,
-a:d,data:X,c:function(a){"object"==typeof a&&a.error?v(a):c(a)},b:v,url:[e,"v2","presence","sub_key",k,"channel",encodeURIComponent(a),"leave"]});return j},history:function(a,b){var b=a.callback||b,c=a.count||a.limit||100,d=a.reverse||"false",X=a.error||x(),e=a.auth_key||g,v=a.channel,w=a.start,h=a.end,n={},i=G();if(!v)return l("Missing Channel");if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");n.stringtoken="true";n.count=c;n.reverse=d;n.auth=e;i&&(n.callback=i);w&&(n.start=
-w);h&&(n.end=h);A({a:i,data:n,c:function(a){"object"==typeof a&&a.error?X(a):b(a)},b:X,url:[K,"v2","history","sub-key",k,"channel",encodeURIComponent(v)]})},replay:function(a){var b=b||a.callback||x(),c=a.auth_key||g,d=a.source,e=a.destination,h=a.stop,v=a.start,w=a.end,Pa=a.reverse,a=a.limit,n=G(),f={};if(!d)return l("Missing Source Channel");if(!e)return l("Missing Destination Channel");if(!i)return l("Missing Publish Key");if(!k)return l("Missing Subscribe Key");"0"!=n&&(f.callback=n);h&&(f.stop=
-"all");Pa&&(f.reverse="true");v&&(f.start=v);w&&(f.end=w);a&&(f.count=a);f.auth=c;A({a:n,c:function(a){"object"==typeof a&&a.error?err(a):b(a)},b:function(){b([0,"Disconnected"])},url:[K,"v1","replay",i,k,d,e],data:f})},auth:function(a){g=a;c()},time:function(a){var b=G();A({a:b,data:{uuid:B,auth:g},timeout:5*I,url:[K,"time",b],c:function(b){a(b[0])},b:function(){a(0)}})},publish:function(a,b){var b=b||a.callback||x(),c=a.message,d=a.channel,e=a.auth_key||g,h=a.error||x(),v=G(),w="push";a.prepend&&
-(w="unshift");if(!c)return l("Missing Message");if(!d)return l("Missing Channel");if(!i)return l("Missing Publish Key");if(!k)return l("Missing Subscribe Key");c=JSON.stringify(c);y[w]({a:v,timeout:5*I,url:[K,"publish",i,k,0,encodeURIComponent(d),v,encodeURIComponent(c)],data:{uuid:B,auth:e},b:function(a){h(a);m(1)},c:function(a){"object"==typeof a&&a.error?h(a):b(a);m(1)}});m()},unsubscribe:function(a,b){var d=a.channel,b=b||a.callback||x(),e=a.error||x();S=0;ma=1;d=pa((d.join?d.join(","):""+d).split(","),
-function(a){if(F[a])return a+","+a+D}).join(",");Q(d.split(","),function(a){var c=j;a&&(C&&(c=z.LEAVE(a,0,b,e)),c||b({action:"leave"}),F[a]=0)});c()},subscribe:function(a,b){function e(a){a?setTimeout(c,I):(K=P(N,1),wa=P(N,1),setTimeout(function(){z.time(e)},I));H(function(b){if(a&&b.d)return b.d=0,b.m(b.name);!a&&!b.d&&(b.d=1,b.l(b.name))})}function h(){var a=G(),b=qa(F).join(",");b&&(d(),R=A({timeout:O,a:a,b:function(a){n(a);R=t;z.time(e)},data:{uuid:B,auth:m},url:[wa,"subscribe",k,encodeURIComponent(b),
-a,S],c:function(a){R=t;if(!a||"object"==typeof a&&"error"in a&&a.error)return n(a),setTimeout(c,I);r(a[1]);S=!S&&ma&&T.get(k)||a[1];H(function(a){a.f||(a.f=1,a.k(a.name))});y&&(S=1E4,y=0);T.set(k,a[1]);var b,d=(2<a.length?a[2]:pa(F,function(b){return pa(Array(a[0].length).join(",").split(","),function(){return b})}).join(",")).split(",");b=function(){var a=d.shift()||Aa;return[(F[a]||{}).a||za,a.split(D)[0]]};var e=J()-ia-+a[1]/1E4;Q(a[0],function(c){var d=b();d[0](c,a,d[1],e)});setTimeout(h,L)}}))}
-var i=a.channel,b=(b=b||a.callback)||a.message,m=a.auth_key||g,v=a.connect||x(),w=a.reconnect||x(),q=a.disconnect||x(),n=a.error||x(),r=a.idle||x(),s=a.presence||0,E=a.noheresync||0,y=a.backfill||0,M=a.timetoken||0,O=a.timeout||f,L=a.windowing||p;ma=a.restore;S=M;if(!i)return l("Missing Channel");if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");Q((i.join?i.join(","):""+i).split(","),function(a){var c=F[a]||{};F[Aa=a]={name:a,f:c.f,d:c.d,j:1,a:za=b,k:v,l:q,m:w};s&&(z.subscribe({channel:a+
-D,callback:s}),!c.j&&!E&&z.here_now({channel:a,callback:function(b){Q("uuids"in b?b.uuids:[],function(c){s({action:"join",uuid:c,timestamp:J(),occupancy:b.occupancy||1},b,a)})}}))});c=function(){d();setTimeout(h,L)};if(!C)return ba.push(c);c()},here_now:function(a,b){var b=a.callback||b,c=a.error||x(),d=a.auth_key||g,e=a.channel,h=G(),d={uuid:B,auth:d};if(!e)return l("Missing Channel");if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");"0"!=h&&(d.callback=h);A({a:h,data:d,
-c:function(a){"object"==typeof a&&a.error?c(a):b(a)},b:c,url:[K,"v2","presence","sub_key",k,"channel",encodeURIComponent(e)]})},grant:function(a,b){var b=a.callback||b,c=a.error||x(),d=a.channel,e=G(),h=a.ttl||-1,g=a.read?"1":"0",w=a.write?"1":"0",f=a.auth_key;if(!d)return l("Missing Channel");if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");if(!i)return l("Missing Publish Key");if(!E)return l("Missing Secret Key");"0"!=e&&(n.callback=e);var n=Math.floor((new Date).getTime()/
-1E3),m=ea(k+"\n"+i+"\ngrant\n"+(f&&0<encodeURIComponent(f).length?"auth="+encodeURIComponent(f)+"&":"")+"channel="+encodeURIComponent(d)+"&pnsdk="+encodeURIComponent(M)+"&r="+g+"&timestamp="+encodeURIComponent(n)+(-1<h?"&ttl="+h:"")+"&w="+w,E),m=m.replace(/\+/g,"-"),m=m.replace(/\//g,"_"),n={w:w,r:g,signature:m,channel:encodeURIComponent(d),timestamp:n};-1<h&&(n.ttl=h);f&&(n.auth=encodeURIComponent(f));A({a:e,data:n,c:function(a){b(a)},b:c,url:[K,"v1","auth","grant","sub-key",k]})},audit:function(a,
-b){var b=a.callback||b,c=a.error||x(),d=a.channel,e=a.auth_key,h=G();if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");if(!i)return l("Missing Publish Key");if(!E)return l("Missing Secret Key");"0"!=h&&(g.callback=h);var g=Math.floor((new Date).getTime()/1E3),f=k+"\n"+i+"\naudit\n";e&&(f+="auth="+encodeURIComponent(e)+"&");d&&(f+="channel="+encodeURIComponent(d)+"&");var f=f+("pnsdk="+encodeURIComponent(M)+"&timestamp="+g),f=ea(f,E),f=f.replace(/\+/g,"-"),f=f.replace(/\//g,
-"_"),g={signature:f,timestamp:g};d&&(g.channel=encodeURIComponent(d));e&&(g.auth=encodeURIComponent(e));A({a:h,data:g,c:function(a){b(a)},b:c,url:[K,"v1","auth","audit","sub-key",k]})},revoke:function(a,b){a.read=u;a.write=u;z.grant(a,b)},set_uuid:function(a){B=a;c()},get_uuid:function(){return B},xdr:A,ready:ra,db:T,uuid:ja,map:pa,each:Q,"each-channel":H,grep:na,offline:function(){d(1)},supplant:oa,now:J,unique:ga,updater:la};B||(B=z.uuid());T.set(k+"uuid",B);setTimeout(s,I);setTimeout(e,q);b();
-h=z;h.css=ya;h.$=ta;h.create=Ba;h.bind=U;h.head=xa;h.search=va;h.attr=V;h.events=Y;h.init=La;U("beforeunload",window,function(){h["each-channel"](function(a){h.LEAVE(a.name,0)});return j});if(a.notest)return h;U("offline",window,h.offline);U("offline",document,h.offline);return h};"complete"===document.readyState?setTimeout(ra,0):U("load",window,function(){setTimeout(ra,0)});var $=Z||{};PUBNUB=La({notest:1,publish_key:V($,"pub-key"),subscribe_key:V($,"sub-key"),ssl:!document.location.href.indexOf("https")||
-"on"==V($,"ssl"),origin:V($,"origin"),uuid:V($,"uuid")});window.jQuery&&(window.jQuery.PUBNUB=PUBNUB);"undefined"!==typeof module&&(module.exports=PUBNUB)&&ra();var Ia=ta("pubnubs")||0;if(Z){ya(Z,{position:"absolute",top:-I});if("opera"in window||V(Z,"flash"))Z.innerHTML="<object id=pubnubs data=https://pubnub.a.ssl.fastly.net/pubnub.swf><param name=movie value=https://pubnub.a.ssl.fastly.net/pubnub.swf><param name=allowscriptaccess value=always></object>";PUBNUB.rdx=function(a,c){if(!c)return W[a].onerror();
+if(!window.PUBNUB){var sa=function(a,c){return CryptoJS.HmacSHA256(a,c).toString(CryptoJS.enc.Base64)},ta=function(a){return document.getElementById(a)},ua=function(a){console.error(a)},va=function(a,c){var b=[];Q(a.split(/\s+/),function(a){Q((c||document).getElementsByTagName(a),function(a){b.push(a)})});return b},U=function(a,c,b){Q(a.split(","),function(a){function e(a){a||(a=window.event);b(a)||(a.cancelBubble=j,a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation())}c.addEventListener?
+c.addEventListener(a,e,u):c.attachEvent?c.attachEvent("on"+a,e):c["on"+a]=e})},xa=function(){return va("head")[0]},V=function(a,c,b){if(b)a.setAttribute(c,b);else return a&&a.getAttribute&&a.getAttribute(c)},ya=function(a,c){for(var b in c)if(c.hasOwnProperty(b))try{a.style[b]=c[b]+(0<"|width|height|top|left|".indexOf(b)&&"number"==typeof c[b]?"px":"")}catch(d){}},Ba=function(a){return document.createElement(a)},Da=function(){return Ca||W()?0:ga()},Fa=function(a){function c(a,b){M||(M=1,g.onerror=
+t,clearTimeout(ea),a||!b||N(b),setTimeout(function(){a&&O();var b=ta(D),c=b&&b.parentNode;c&&c.removeChild(b)},I))}if(Ca||W()){a:{var b,d,e=function(){if(!H){H=1;clearTimeout(L);try{d=JSON.parse(b.responseText)}catch(a){return r(1)}s=1;f(d)}},s=0,H=0,m=a.timeout||1E4,L=setTimeout(function(){r(1)},m),h=a.b||x(),p=a.data||{},f=a.c||x(),q="undefined"===typeof a.g,r=function(a,c){s||(s=1,clearTimeout(L),b&&(b.onerror=b.onload=t,b.abort&&b.abort(),b=t),a&&h(c))};try{b=W()||window.XDomainRequest&&new XDomainRequest||
+new XMLHttpRequest;b.onerror=b.onabort=function(){r(1,b.responseText||{error:"Network Connection Error"})};b.onload=b.onloadend=e;b.onreadystatechange=function(){if(b&&4==b.readyState)switch(b.status){case 401:case 402:case 403:try{d=JSON.parse(b.responseText),r(1,d)}catch(a){return r(1,b.responseText)}}};q&&(b.timeout=m);p.pnsdk=Ea;var i=ka(a.url,p);b.open("GET",i,q);b.send()}catch(k){r(0);Ca=0;a=Fa(a);break a}a=r}return a}var g=Ba("script"),e=a.a,D=ga(),M=0,ea=setTimeout(function(){c(1)},a.timeout||
+1E4),O=a.b||x(),m=a.data||{},N=a.c||x();window[e]=function(a){c(0,a)};a.g||(g[Ga]=Ga);g.onerror=function(){c(1)};m.pnsdk=Ea;g.src=ka(a.url,m);V(g,"id",D);xa().appendChild(g);return c},Ha=function(){return!("onLine"in navigator)?1:navigator.onLine},W=function(){if(!Ia||!Ia.get)return 0;var a={id:W.id++,send:x(),abort:function(){a.id={}},open:function(c,b){W[a.id]=a;Ia.get(a.id,b)}};return a},Ga="async",Ea="PubNub-JS-Web/3.5.48",Ca=-1==navigator.userAgent.indexOf("MSIE 6");window.console||(window.console=
+window.console||{});console.log||(console.log=console.error=(window.opera||{}).postError||x());var Ja,Ka=window.localStorage;Ja={get:function(a){try{return Ka?Ka.getItem(a):-1==document.cookie.indexOf(a)?t:((document.cookie||"").match(RegExp(a+"=([^;]+)"))||[])[1]||t}catch(c){}},set:function(a,c){try{if(Ka)return Ka.setItem(a,c)&&0;document.cookie=a+"="+c+"; expires=Thu, 1 Aug 2030 20:00:00 UTC; path=/"}catch(b){}}};var Y={list:{},unbind:function(a){Y.list[a]=[]},bind:function(a,c){(Y.list[a]=Y.list[a]||
+[]).push(c)},fire:function(a,c){Q(Y.list[a]||[],function(a){a(c)})}},Z=ta("pubnub")||0,La=function(a){function c(){}function b(a,b){function c(b){b&&(ia=J()-(b/1E4+(J()-d)/2),a&&a(ia))}var d=J();b&&c(b)||z.time(c)}function d(a,b){R&&R(a,b);R=t}function e(){z.time(function(a){b(x(),a);a||d(1,{error:"Heartbeat failed to connect to Pubnub Servers.Please check your network settings."});setTimeout(e,q)})}function s(){Na()||d(1,{error:"Offline. Please check your network settings. "});setTimeout(s,I)}function H(a){var b=
+0;Q(qa(E),function(c){if(c=E[c])b++,(a||x())(c)});return b}function m(a){if(Oa){if(!y.length)return}else{a&&(y.h=0);if(y.h||!y.length)return;y.h=1}A(y.shift())}a.jsonp&&(Ca=0);var L=a.subscribe_key||"";a.uuid||Ja.get(L+"uuid");a.xdr=Fa;a.db=Ja;a.error=ua;a._is_online=Ha;a.jsonp_cb=Da;a.PNSDK=Ea;a.hmac_SHA256=sa;var h,p=+a.windowing||10,f=(+a.timeout||310)*I,q=(+a.keepalive||60)*I,r=a.noleave||0,i=a.publish_key||"demo",k=a.subscribe_key||"demo",g=a.auth_key||"",D=a.secret_key||"",M=a.PNSDK||"",ea=
+a.hmac_SHA256,O=a.ssl?"s":"",N="http"+O+"://"+(a.origin||"pubsub.pubnub.com"),K=P(N),wa=P(N),y=[],ia=0,za=0,Aa=0,R=0,ma=0,S=0,E={},Oa=a.no_wait_for_pending,A=a.xdr,l=a.error||x(),Na=a._is_online||function(){return 1},F=a.jsonp_cb||function(){return 0},T=a.db||{get:x(),set:x()},B=a.uuid||T&&T.get(k+"uuid")||"",z={LEAVE:function(a,b,c,d){var X={uuid:B,auth:g},e=P(N),c=c||x(),v=d||x(),d=F();if(0<a.indexOf(G))return j;if(r||!O||"0"==d)return u;"0"!=d&&(X.callback=d);A({g:b||O,timeout:2E3,a:d,data:X,c:function(a){"object"==
+typeof a&&a.error?v(a):c(a)},b:v,url:[e,"v2","presence","sub_key",k,"channel",encodeURIComponent(a),"leave"]});return j},history:function(a,b){var b=a.callback||b,c=a.count||a.limit||100,d=a.reverse||"false",X=a.error||x(),e=a.auth_key||g,v=a.channel,w=a.start,h=a.end,n={},i=F();if(!v)return l("Missing Channel");if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");n.stringtoken="true";n.count=c;n.reverse=d;n.auth=e;i&&(n.callback=i);w&&(n.start=w);h&&(n.end=h);A({a:i,data:n,
+c:function(a){"object"==typeof a&&a.error?X(a):b(a)},b:X,url:[K,"v2","history","sub-key",k,"channel",encodeURIComponent(v)]})},replay:function(a){var b=b||a.callback||x(),c=a.auth_key||g,d=a.source,e=a.destination,h=a.stop,v=a.start,w=a.end,Pa=a.reverse,a=a.limit,n=F(),f={};if(!d)return l("Missing Source Channel");if(!e)return l("Missing Destination Channel");if(!i)return l("Missing Publish Key");if(!k)return l("Missing Subscribe Key");"0"!=n&&(f.callback=n);h&&(f.stop="all");Pa&&(f.reverse="true");
+v&&(f.start=v);w&&(f.end=w);a&&(f.count=a);f.auth=c;A({a:n,c:function(a){"object"==typeof a&&a.error?err(a):b(a)},b:function(){b([0,"Disconnected"])},url:[K,"v1","replay",i,k,d,e],data:f})},auth:function(a){g=a;c()},time:function(a){var b=F();A({a:b,data:{uuid:B,auth:g},timeout:5*I,url:[K,"time",b],c:function(b){a(b[0])},b:function(){a(0)}})},publish:function(a,b){var b=b||a.callback||x(),c=a.message,d=a.channel,e=a.auth_key||g,h=a.error||x(),v=F(),w="push";a.prepend&&(w="unshift");if(!c)return l("Missing Message");
+if(!d)return l("Missing Channel");if(!i)return l("Missing Publish Key");if(!k)return l("Missing Subscribe Key");c=JSON.stringify(c);y[w]({a:v,timeout:5*I,url:[K,"publish",i,k,0,encodeURIComponent(d),v,encodeURIComponent(c)],data:{uuid:B,auth:e},b:function(a){h(a);m(1)},c:function(a){"object"==typeof a&&a.error?h(a):b(a);m(1)}});m()},unsubscribe:function(a,b){var d=a.channel,b=b||a.callback||x(),e=a.error||x();S=0;ma=1;d=pa((d.join?d.join(","):""+d).split(","),function(a){if(E[a])return a+","+a+G}).join(",");
+Q(d.split(","),function(a){var c=j;a&&(C&&(c=z.LEAVE(a,0,b,e)),c||b({action:"leave"}),E[a]=0)});c()},subscribe:function(a,b){function e(a){a?setTimeout(c,I):(K=P(N,1),wa=P(N,1),setTimeout(function(){z.time(e)},I));H(function(b){if(a&&b.d)return b.d=0,b.m(b.name);!a&&!b.d&&(b.d=1,b.l(b.name))})}function h(){var a=F(),b=qa(E).join(",");b&&(d(),R=A({timeout:O,a:a,b:function(a){n(a);R=t;z.time(e)},data:{uuid:B,auth:m},url:[wa,"subscribe",k,encodeURIComponent(b),a,S],c:function(a){R=t;if(!a||"object"==
+typeof a&&"error"in a&&a.error)return n(a),setTimeout(c,I);r(a[1]);S=!S&&ma&&T.get(k)||a[1];H(function(a){a.f||(a.f=1,a.k(a.name))});y&&(S=1E4,y=0);T.set(k,a[1]);var b,d=(2<a.length?a[2]:pa(E,function(b){return pa(Array(a[0].length).join(",").split(","),function(){return b})}).join(",")).split(",");b=function(){var a=d.shift()||Aa;return[(E[a]||{}).a||za,a.split(G)[0]]};var e=J()-ia-+a[1]/1E4;Q(a[0],function(c){var d=b();d[0](c,a,d[1],e)});setTimeout(h,L)}}))}var i=a.channel,b=(b=b||a.callback)||
+a.message,m=a.auth_key||g,v=a.connect||x(),w=a.reconnect||x(),q=a.disconnect||x(),n=a.error||x(),r=a.idle||x(),s=a.presence||0,D=a.noheresync||0,y=a.backfill||0,M=a.timetoken||0,O=a.timeout||f,L=a.windowing||p;ma=a.restore;S=M;if(!i)return l("Missing Channel");if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");Q((i.join?i.join(","):""+i).split(","),function(a){var c=E[a]||{};E[Aa=a]={name:a,f:c.f,d:c.d,j:1,a:za=b,k:v,l:q,m:w};s&&(z.subscribe({channel:a+G,callback:s}),!c.j&&
+!D&&z.here_now({channel:a,callback:function(b){Q("uuids"in b?b.uuids:[],function(c){s({action:"join",uuid:c,timestamp:J(),occupancy:b.occupancy||1},b,a)})}}))});c=function(){d();setTimeout(h,L)};if(!C)return ba.push(c);c()},here_now:function(a,b){var b=a.callback||b,c=a.error||x(),d=a.auth_key||g,e=a.channel,h=F(),d={uuid:B,auth:d};if(!e)return l("Missing Channel");if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");"0"!=h&&(d.callback=h);A({a:h,data:d,c:function(a){"object"==
+typeof a&&a.error?c(a):b(a)},b:c,url:[K,"v2","presence","sub_key",k,"channel",encodeURIComponent(e)]})},grant:function(a,b){var b=a.callback||b,c=a.error||x(),d=a.channel,e=F(),h=a.ttl||-1,g=a.read?"1":"0",w=a.write?"1":"0",f=a.auth_key;if(!d)return l("Missing Channel");if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");if(!i)return l("Missing Publish Key");if(!D)return l("Missing Secret Key");"0"!=e&&(n.callback=e);var n=Math.floor((new Date).getTime()/1E3),m=ea(k+"\n"+i+
+"\ngrant\n"+(f&&0<encodeURIComponent(f).length?"auth="+encodeURIComponent(f)+"&":"")+"channel="+encodeURIComponent(d)+"&pnsdk="+encodeURIComponent(M)+"&r="+g+"&timestamp="+encodeURIComponent(n)+(-1<h?"&ttl="+h:"")+"&w="+w,D),m=m.replace(/\+/g,"-"),m=m.replace(/\//g,"_"),n={w:w,r:g,signature:m,channel:encodeURIComponent(d),timestamp:n};-1<h&&(n.ttl=h);f&&(n.auth=encodeURIComponent(f));A({a:e,data:n,c:function(a){b(a)},b:c,url:[K,"v1","auth","grant","sub-key",k]})},audit:function(a,b){var b=a.callback||
+b,c=a.error||x(),d=a.channel,e=a.auth_key,h=F();if(!b)return l("Missing Callback");if(!k)return l("Missing Subscribe Key");if(!i)return l("Missing Publish Key");if(!D)return l("Missing Secret Key");"0"!=h&&(g.callback=h);var g=Math.floor((new Date).getTime()/1E3),f=k+"\n"+i+"\naudit\n";e&&(f+="auth="+encodeURIComponent(e)+"&");d&&(f+="channel="+encodeURIComponent(d)+"&");var f=f+("pnsdk="+encodeURIComponent(M)+"&timestamp="+g),f=ea(f,D),f=f.replace(/\+/g,"-"),f=f.replace(/\//g,"_"),g={signature:f,
+timestamp:g};d&&(g.channel=encodeURIComponent(d));e&&(g.auth=encodeURIComponent(e));A({a:h,data:g,c:function(a){b(a)},b:c,url:[K,"v1","auth","audit","sub-key",k]})},revoke:function(a,b){a.read=u;a.write=u;z.grant(a,b)},set_uuid:function(a){B=a;c()},get_uuid:function(){return B},xdr:A,ready:ra,db:T,uuid:ja,map:pa,each:Q,"each-channel":H,grep:na,offline:function(){d(1)},supplant:oa,now:J,unique:ga,updater:la};B||(B=z.uuid());T.set(k+"uuid",B);setTimeout(s,I);setTimeout(e,q);b();h=z;h.css=ya;h.$=ta;
+h.create=Ba;h.bind=U;h.head=xa;h.search=va;h.attr=V;h.events=Y;h.init=La;U("beforeunload",window,function(){h["each-channel"](function(a){h.LEAVE(a.name,0)});return j});if(a.notest)return h;U("offline",window,h.offline);U("offline",document,h.offline);return h};"complete"===document.readyState?setTimeout(ra,0):U("load",window,function(){setTimeout(ra,0)});var $=Z||{};PUBNUB=La({notest:1,publish_key:V($,"pub-key"),subscribe_key:V($,"sub-key"),ssl:!document.location.href.indexOf("https")||"on"==V($,
+"ssl"),origin:V($,"origin"),uuid:V($,"uuid")});window.jQuery&&(window.jQuery.PUBNUB=PUBNUB);"undefined"!==typeof module&&(module.exports=PUBNUB)&&ra();var Ia=ta("pubnubs")||0;if(Z){ya(Z,{position:"absolute",top:-I});if("opera"in window||V(Z,"flash"))Z.innerHTML="<object id=pubnubs data=https://pubnub.a.ssl.fastly.net/pubnub.swf><param name=movie value=https://pubnub.a.ssl.fastly.net/pubnub.swf><param name=allowscriptaccess value=always></object>";PUBNUB.rdx=function(a,c){if(!c)return W[a].onerror();
W[a].responseText=unescape(c);W[a].onload()};W.id=I}}
var Ma=PUBNUB.ws=function(a,c){if(!(this instanceof Ma))return new Ma(a,c);var b=this,a=b.url=a||"";b.protocol=c||"Sec-WebSocket-Protocol";var d=a.split("/"),d={ssl:"wss:"===d[0],origin:d[2],publish_key:d[3],subscribe_key:d[4],channel:d[5]};b.CONNECTING=0;b.OPEN=1;b.CLOSING=2;b.CLOSED=3;b.CLOSE_NORMAL=1E3;b.CLOSE_GOING_AWAY=1001;b.CLOSE_PROTOCOL_ERROR=1002;b.CLOSE_UNSUPPORTED=1003;b.CLOSE_TOO_LARGE=1004;b.CLOSE_NO_STATUS=1005;b.CLOSE_ABNORMAL=1006;b.onclose=b.onerror=b.onmessage=b.onopen=b.onsend=
x();b.binaryType="";b.extensions="";b.bufferedAmount=0;b.trasnmitting=u;b.buffer=[];b.readyState=b.CONNECTING;if(!a)return b.readyState=b.CLOSED,b.onclose({code:b.CLOSE_ABNORMAL,reason:"Missing URL",wasClean:j}),b;b.e=PUBNUB.init(d);b.e.i=d;b.i=d;b.e.subscribe({restore:u,channel:d.channel,disconnect:b.onerror,reconnect:b.onopen,error:function(){b.onclose({code:b.CLOSE_ABNORMAL,reason:"Missing URL",wasClean:u})},callback:function(a){b.onmessage({data:a})},connect:function(){b.readyState=b.OPEN;b.onopen()}})};
View
3  web/unassembled/platform.js
@@ -98,8 +98,7 @@ function bind( type, el, fun ) {
if (!e) e = window.event;
if (!fun(e)) {
e.cancelBubble = true;
- e.returnValue = false;
- e.preventDefault && e.preventDefault();
+ e.preventDefault && e.preventDefault();
e.stopPropagation && e.stopPropagation();
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.