text: // Version: 3.7.10
  (function(){
  var da=void 0,v=!0,y=null,z=!1;function A(){return function(){}}
  window.JSON&&window.JSON.stringify||function(){function a(){try{return this.valueOf()}catch(a){return y}}function d(a){c.lastIndex=0;return c.test(a)?'"'+a.replace(c,function(a){var b=q[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function b(c,q){var u,r,f,h,m,g=e,l=q[c];l&&"object"===typeof l&&(l=a.call(l));"function"===typeof j&&(l=j.call(q,c,l));switch(typeof l){case "string":return d(l);case "number":return isFinite(l)?String(l):"null";case "boolean":case "null":return String(l);
  case "object":if(!l)return"null";e+=p;m=[];if("[object Array]"===Object.prototype.toString.apply(l)){h=l.length;for(u=0;u<h;u+=1)m[u]=b(u,l)||"null";f=0===m.length?"[]":e?"[\n"+e+m.join(",\n"+e)+"\n"+g+"]":"["+m.join(",")+"]";e=g;return f}if(j&&"object"===typeof j){h=j.length;for(u=0;u<h;u+=1)r=j[u],"string"===typeof r&&(f=b(r,l))&&m.push(d(r)+(e?": ":":")+f)}else for(r in l)Object.hasOwnProperty.call(l,r)&&(f=b(r,l))&&m.push(d(r)+(e?": ":":")+f);f=0===m.length?"{}":e?"{\n"+e+m.join(",\n"+e)+"\n"+
  g+"}":"{"+m.join(",")+"}";e=g;return f}}window.JSON||(window.JSON={});var c=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e,p,q={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},j;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,c,d){var q;p=e="";if("number"===typeof d)for(q=0;q<d;q+=1)p+=" ";else"string"===typeof d&&(p=d);if((j=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 fa=1,ia=z,ja=[],ka="-pnpres",E=1E3,na="/",oa="&",pa=/{([\w\-]+)}/g;function qa(){return"x"+ ++fa+""+ +new Date}function F(){return+new Date}var sa,ta=Math.floor(20*Math.random());sa=function(a,d){return 0<a.indexOf("pubsub.")&&a.replace("pubsub","ps"+(d?ua().split("-")[0]:20>++ta?ta:ta=1))||a};
  function va(a,d){var b=a.join(na),c=[];if(!d)return b;N(d,function(a,b){var d="object"==typeof b?JSON.stringify(b):b;"undefined"!=typeof b&&(b!=y&&0<encodeURIComponent(d).length)&&c.push(a+"="+encodeURIComponent(d))});return b+="?"+c.join(oa)}function wa(a,d){function b(){e+d>F()?(clearTimeout(c),c=setTimeout(b,d)):(e=F(),a())}var c,e=0;return b}function xa(a,d){var b=[];N(a||[],function(a){d(a)&&b.push(a)});return b}function ya(a,d){return a.replace(pa,function(a,c){return d[c]||a})}
  function ua(a){var d="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(d);return d}function za(a){return!!a&&"string"!==typeof a&&(Array.isArray&&Array.isArray(a)||"number"===typeof a.length)}function N(a,d){if(a&&d)if(za(a))for(var b=0,c=a.length;b<c;)d.call(a[b],a[b],b++);else for(b in a)a.hasOwnProperty&&a.hasOwnProperty(b)&&d.call(a[b],b,a[b])}
  function Aa(a,d){var b=[];N(a||[],function(a,e){b.push(d(a,e))});return b}function Ba(a,d){var b=[];N(a,function(a,e){d?0>a.search("-pnpres")&&e.e&&b.push(a):e.e&&b.push(a)});return b.sort()}function Ca(a,d){var b=[];N(a,function(a,e){d?0>a.search("-pnpres")&&e.e&&b.push(a):e.e&&b.push(a)});return b.sort()}function Da(){setTimeout(function(){ia||(ia=1,N(ja,function(a){a()}))},E)}var V,W=14,Z=8,Ea=z;
  function Fa(a,d){var b="",c,e;if(d){c=a[15];if(16<c)throw"Decryption error: Maybe bad key";if(16==c)return"";for(e=0;e<16-c;e++)b+=String.fromCharCode(a[e])}else for(e=0;16>e;e++)b+=String.fromCharCode(a[e]);return b}function Ga(a,d){var b=[],c;if(!d)try{a=unescape(encodeURIComponent(a))}catch(e){throw"Error on UTF-8 encode";}for(c=0;c<a.length;c++)b[c]=a.charCodeAt(c);return b}
  function Ha(a,d){var b=12<=W?3:2,c=[],e=[],c=[],e=[],p=a.concat(d),q;c[0]=GibberishAES.p.q(p);e=c[0];for(q=1;q<b;q++)c[q]=GibberishAES.p.q(c[q-1].concat(p)),e=e.concat(c[q]);c=e.slice(0,4*Z);e=e.slice(4*Z,4*Z+16);return{key:c,l:e}}
  function Ia(a,d,b){var d=Ja(d),c=Math.ceil(a.length/16),e=[],p,q=[];for(p=0;p<c;p++){var j=e,s=p,D=a.slice(16*p,16*p+16),u=[],r=da,r=da;16>D.length&&(r=16-D.length,u=[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r]);for(r=0;r<D.length;r++)u[r]=D[r];j[s]=u}0===a.length%16&&e.push([16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16]);for(p=0;p<e.length;p++)e[p]=0===p?Ka(e[p],b):Ka(e[p],q[p-1]),q[p]=La(e[p],d);return q}
  function Ma(a,d,b,c){var d=Ja(d),e=a.length/16,p=[],q,j=[],s="";for(q=0;q<e;q++)p.push(a.slice(16*q,16*(q+1)));for(q=p.length-1;0<=q;q--)j[q]=Na(p[q],d),j[q]=0===q?Ka(j[q],b):Ka(j[q],p[q-1]);for(q=0;q<e-1;q++)s+=Fa(j[q]);var s=s+Fa(j[q],v),D;if(c)D=s;else try{D=decodeURIComponent(escape(s))}catch(u){throw"Bad Key";}return D}function La(a,d){Ea=z;var b=Oa(a,d,0),c;for(c=1;c<W+1;c++)b=Pa(b),b=Va(b),c<W&&(b=Wa(b)),b=Oa(b,d,c);return b}
  function Na(a,d){Ea=v;var b=Oa(a,d,W),c;for(c=W-1;-1<c;c--)b=Va(b),b=Pa(b),b=Oa(b,d,c),0<c&&(b=Wa(b));return b}function Pa(a){var d=Ea?Xa:Ya,b=[],c;for(c=0;16>c;c++)b[c]=d[a[c]];return b}function Va(a){var d=[],b=Ea?[0,13,10,7,4,1,14,11,8,5,2,15,12,9,6,3]:[0,5,10,15,4,9,14,3,8,13,2,7,12,1,6,11],c;for(c=0;16>c;c++)d[c]=a[b[c]];return d}
  function Wa(a){var d=[],b;if(Ea)for(b=0;4>b;b++)d[4*b]=Za[a[4*b]]^$a[a[1+4*b]]^ab[a[2+4*b]]^cb[a[3+4*b]],d[1+4*b]=cb[a[4*b]]^Za[a[1+4*b]]^$a[a[2+4*b]]^ab[a[3+4*b]],d[2+4*b]=ab[a[4*b]]^cb[a[1+4*b]]^Za[a[2+4*b]]^$a[a[3+4*b]],d[3+4*b]=$a[a[4*b]]^ab[a[1+4*b]]^cb[a[2+4*b]]^Za[a[3+4*b]];else for(b=0;4>b;b++)d[4*b]=db[a[4*b]]^jb[a[1+4*b]]^a[2+4*b]^a[3+4*b],d[1+4*b]=a[4*b]^db[a[1+4*b]]^jb[a[2+4*b]]^a[3+4*b],d[2+4*b]=a[4*b]^a[1+4*b]^db[a[2+4*b]]^jb[a[3+4*b]],d[3+4*b]=jb[a[4*b]]^a[1+4*b]^a[2+4*b]^db[a[3+4*
  b]];return d}function Oa(a,d,b){var c=[],e;for(e=0;16>e;e++)c[e]=a[e]^d[b][e];return c}function Ka(a,d){var b=[],c;for(c=0;16>c;c++)b[c]=a[c]^d[c];return b}
  function Ja(a){var d=[],b=[],c,e,p=[];for(c=0;c<Z;c++)e=[a[4*c],a[4*c+1],a[4*c+2],a[4*c+3]],d[c]=e;for(c=Z;c<4*(W+1);c++){d[c]=[];for(a=0;4>a;a++)b[a]=d[c-1][a];if(0===c%Z){a=b[0];e=da;for(e=0;4>e;e++)b[e]=b[e+1];b[3]=a;b=kb(b);b[0]^=lb[c/Z-1]}else 6<Z&&4==c%Z&&(b=kb(b));for(a=0;4>a;a++)d[c][a]=d[c-Z][a]^b[a]}for(c=0;c<W+1;c++){p[c]=[];for(b=0;4>b;b++)p[c].push(d[4*c+b][0],d[4*c+b][1],d[4*c+b][2],d[4*c+b][3])}return p}function kb(a){for(var d=0;4>d;d++)a[d]=Ya[a[d]];return a}
  function mb(a,d){var b=[];for(i=0;i<a.length;i+=d)b[i/d]=parseInt(a.substr(i,d),16);return b}function nb(a){for(var d=[],b=0;256>b;b++){for(var c=a,e=b,p=da,q=da,p=q=0;8>p;p++)q=1==(e&1)?q^c:q,c=127<c?283^c<<1:c<<1,e>>>=1;d[b]=q}return d}
  var Ya=mb("637c777bf26b6fc53001672bfed7ab76ca82c97dfa5947f0add4a2af9ca472c0b7fd9326363ff7cc34a5e5f171d8311504c723c31896059a071280e2eb27b27509832c1a1b6e5aa0523bd6b329e32f8453d100ed20fcb15b6acbbe394a4c58cfd0efaafb434d338545f9027f503c9fa851a3408f929d38f5bcb6da2110fff3d2cd0c13ec5f974417c4a77e3d645d197360814fdc222a908846eeb814de5e0bdbe0323a0a4906245cc2d3ac629195e479e7c8376d8dd54ea96c56f4ea657aae08ba78252e1ca6b4c6e8dd741f4bbd8b8a703eb5664803f60e613557b986c11d9ee1f8981169d98e949b1e87e9ce5528df8ca1890dbfe6426841992d0fb054bb16",2),
  Xa,ob=Ya,pb=[];for(i=0;i<ob.length;i++)pb[ob[i]]=i;Xa=pb;var lb=mb("01020408102040801b366cd8ab4d9a2f5ebc63c697356ad4b37dfaefc591",2),db=nb(2),jb=nb(3),cb=nb(9),$a=nb(11),ab=nb(13),Za=nb(14),qb,rb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",sb=rb.split("");"function"===typeof Array.indexOf&&(rb=sb);
  qb={encode:function(a){var d=[],b="",c;for(c=0;c<16*a.length;c++)d.push(a[Math.floor(c/16)][c%16]);for(c=0;c<d.length;c+=3)b+=sb[d[c]>>2],b+=sb[(d[c]&3)<<4|d[c+1]>>4],b=d[c+1]!==da?b+sb[(d[c+1]&15)<<2|d[c+2]>>6]:b+"=",b=d[c+2]!==da?b+sb[d[c+2]&63]:b+"=";a=b.slice(0,64);for(c=1;c<Math.ceil(b.length/64);c++)a+=b.slice(64*c,64*c+64)+(Math.ceil(b.length/64)==c+1?"":"\n");return a},decode:function(a){var a=a.replace(/\n/g,""),d=[],b=[],c=[],e;for(e=0;e<a.length;e+=4)b[0]=rb.indexOf(a.charAt(e)),b[1]=rb.indexOf(a.charAt(e+
  1)),b[2]=rb.indexOf(a.charAt(e+2)),b[3]=rb.indexOf(a.charAt(e+3)),c[0]=b[0]<<2|b[1]>>4,c[1]=(b[1]&15)<<4|b[2]>>2,c[2]=(b[2]&3)<<6|b[3],d.push(c[0],c[1],c[2]);return d=d.slice(0,d.length-d.length%16)}};
  V={size:function(a){switch(a){case 128:W=10;Z=4;break;case 192:W=12;Z=6;break;case 256:W=14;Z=8;break;default:throw"Invalid Key Size Specified:"+a;}},h2a:function(a){var d=[];a.replace(/(..)/g,function(a){d.push(parseInt(a,16))});return d},expandKey:Ja,encryptBlock:La,decryptBlock:Na,Decrypt:Ea,s2a:Ga,rawEncrypt:Ia,rawDecrypt:Ma,dec:function(a,d,b){var a=qb.s(a),c=a.slice(8,16),c=Ha(Ga(d,b),c),d=c.key,c=c.l,a=a.slice(16,a.length);return a=Ma(a,d,c,b)},openSSLKey:Ha,a2h:function(a){var d="",b;for(b=
  0;b<a.length;b++)d+=(16>a[b]?"0":"")+a[b].toString(16);return d},enc:function(a,d,b){var c;c=[];var e;for(e=0;8>e;e++)c=c.concat(Math.floor(256*Math.random()));e=Ha(Ga(d,b),c);d=e.key;e=e.l;c=[[83,97,108,116,101,100,95,95].concat(c)];a=Ga(a,b);a=Ia(a,d,e);a=c.concat(a);return qb.t(a)},Hash:{MD5:function(a){function d(a,b){var c,d,e,f,j;e=a&2147483648;f=b&2147483648;c=a&1073741824;d=b&1073741824;j=(a&1073741823)+(b&1073741823);return c&d?j^2147483648^e^f:c|d?j&1073741824?j^3221225472^e^f:j^1073741824^
  e^f:j^e^f}function b(a,b,c,e,f,j,h){a=d(a,d(d(b&c|~b&e,f),h));return d(a<<j|a>>>32-j,b)}function c(a,b,c,e,f,j,h){a=d(a,d(d(b&e|c&~e,f),h));return d(a<<j|a>>>32-j,b)}function e(a,b,c,e,j,f,h){a=d(a,d(d(b^c^e,j),h));return d(a<<f|a>>>32-f,b)}function p(a,b,c,e,f,j,h){a=d(a,d(d(c^(b|~e),f),h));return d(a<<j|a>>>32-j,b)}function q(a){var b,c,d=[];for(c=0;3>=c;c++)b=a>>>8*c&255,d=d.concat(b);return d}var j=[],s,D,u,r,f,h,m,g,l=mb("67452301efcdab8998badcfe10325476d76aa478e8c7b756242070dbc1bdceeef57c0faf4787c62aa8304613fd469501698098d88b44f7afffff5bb1895cd7be6b901122fd987193a679438e49b40821f61e2562c040b340265e5a51e9b6c7aad62f105d02441453d8a1e681e7d3fbc821e1cde6c33707d6f4d50d87455a14eda9e3e905fcefa3f8676f02d98d2a4c8afffa39428771f6816d9d6122fde5380ca4beea444bdecfa9f6bb4b60bebfbc70289b7ec6eaa127fad4ef308504881d05d9d4d039e6db99e51fa27cf8c4ac5665f4292244432aff97ab9423a7fc93a039655b59c38f0ccc92ffeff47d85845dd16fa87e4ffe2ce6e0a30143144e0811a1f7537e82bd3af2352ad7d2bbeb86d391",
  8),j=a.length;s=j+8;D=16*((s-s%64)/64+1);u=[];for(f=r=0;f<j;)s=(f-f%4)/4,r=8*(f%4),u[s]|=a[f]<<r,f++;s=(f-f%4)/4;u[s]|=128<<8*(f%4);u[D-2]=j<<3;u[D-1]=j>>>29;j=u;f=l[0];h=l[1];m=l[2];g=l[3];for(a=0;a<j.length;a+=16)s=f,D=h,u=m,r=g,f=b(f,h,m,g,j[a+0],7,l[4]),g=b(g,f,h,m,j[a+1],12,l[5]),m=b(m,g,f,h,j[a+2],17,l[6]),h=b(h,m,g,f,j[a+3],22,l[7]),f=b(f,h,m,g,j[a+4],7,l[8]),g=b(g,f,h,m,j[a+5],12,l[9]),m=b(m,g,f,h,j[a+6],17,l[10]),h=b(h,m,g,f,j[a+7],22,l[11]),f=b(f,h,m,g,j[a+8],7,l[12]),g=b(g,f,h,m,j[a+9],
  12,l[13]),m=b(m,g,f,h,j[a+10],17,l[14]),h=b(h,m,g,f,j[a+11],22,l[15]),f=b(f,h,m,g,j[a+12],7,l[16]),g=b(g,f,h,m,j[a+13],12,l[17]),m=b(m,g,f,h,j[a+14],17,l[18]),h=b(h,m,g,f,j[a+15],22,l[19]),f=c(f,h,m,g,j[a+1],5,l[20]),g=c(g,f,h,m,j[a+6],9,l[21]),m=c(m,g,f,h,j[a+11],14,l[22]),h=c(h,m,g,f,j[a+0],20,l[23]),f=c(f,h,m,g,j[a+5],5,l[24]),g=c(g,f,h,m,j[a+10],9,l[25]),m=c(m,g,f,h,j[a+15],14,l[26]),h=c(h,m,g,f,j[a+4],20,l[27]),f=c(f,h,m,g,j[a+9],5,l[28]),g=c(g,f,h,m,j[a+14],9,l[29]),m=c(m,g,f,h,j[a+3],14,l[30]),
  h=c(h,m,g,f,j[a+8],20,l[31]),f=c(f,h,m,g,j[a+13],5,l[32]),g=c(g,f,h,m,j[a+2],9,l[33]),m=c(m,g,f,h,j[a+7],14,l[34]),h=c(h,m,g,f,j[a+12],20,l[35]),f=e(f,h,m,g,j[a+5],4,l[36]),g=e(g,f,h,m,j[a+8],11,l[37]),m=e(m,g,f,h,j[a+11],16,l[38]),h=e(h,m,g,f,j[a+14],23,l[39]),f=e(f,h,m,g,j[a+1],4,l[40]),g=e(g,f,h,m,j[a+4],11,l[41]),m=e(m,g,f,h,j[a+7],16,l[42]),h=e(h,m,g,f,j[a+10],23,l[43]),f=e(f,h,m,g,j[a+13],4,l[44]),g=e(g,f,h,m,j[a+0],11,l[45]),m=e(m,g,f,h,j[a+3],16,l[46]),h=e(h,m,g,f,j[a+6],23,l[47]),f=e(f,h,
  m,g,j[a+9],4,l[48]),g=e(g,f,h,m,j[a+12],11,l[49]),m=e(m,g,f,h,j[a+15],16,l[50]),h=e(h,m,g,f,j[a+2],23,l[51]),f=p(f,h,m,g,j[a+0],6,l[52]),g=p(g,f,h,m,j[a+7],10,l[53]),m=p(m,g,f,h,j[a+14],15,l[54]),h=p(h,m,g,f,j[a+5],21,l[55]),f=p(f,h,m,g,j[a+12],6,l[56]),g=p(g,f,h,m,j[a+3],10,l[57]),m=p(m,g,f,h,j[a+10],15,l[58]),h=p(h,m,g,f,j[a+1],21,l[59]),f=p(f,h,m,g,j[a+8],6,l[60]),g=p(g,f,h,m,j[a+15],10,l[61]),m=p(m,g,f,h,j[a+6],15,l[62]),h=p(h,m,g,f,j[a+13],21,l[63]),f=p(f,h,m,g,j[a+4],6,l[64]),g=p(g,f,h,m,j[a+
  11],10,l[65]),m=p(m,g,f,h,j[a+2],15,l[66]),h=p(h,m,g,f,j[a+9],21,l[67]),f=d(f,s),h=d(h,D),m=d(m,u),g=d(g,r);return q(f).concat(q(h),q(m),q(g))}},Base64:qb};
  if(!window.PUBNUB){var tb=function(a,d){return CryptoJS.HmacSHA256(a,d).toString(CryptoJS.enc.Base64)},ub=function(a){return document.getElementById(a)},vb=function(a){console.error(a)},wb=function(a,d){var b=[];N(a.split(/\s+/),function(a){N((d||document).getElementsByTagName(a),function(a){b.push(a)})});return b},xb=function(a,d,b){N(a.split(","),function(a){function e(a){a||(a=window.event);b(a)||(a.cancelBubble=v,a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation())}d.addEventListener?
  d.addEventListener(a,e,z):d.attachEvent?d.attachEvent("on"+a,e):d["on"+a]=e})},yb=function(){return wb("head")[0]},Ab=function(a,d,b){if(b)a.setAttribute(d,b);else return a&&a.getAttribute&&a.getAttribute(d)},Bb=function(a,d){for(var b in d)if(d.hasOwnProperty(b))try{a.style[b]=d[b]+(0<"|width|height|top|left|".indexOf(b)&&"number"==typeof d[b]?"px":"")}catch(c){}},Cb=function(a){return document.createElement(a)},Fb=function(){return Db||$()?0:qa()},Gb=function(a){function d(a,b){x||(x=1,l.onerror=
  y,clearTimeout(ea),a||!b||bb(b),setTimeout(function(){a&&X();var b=ub(C),c=b&&b.parentNode;c&&c.removeChild(b)},E))}if(Db||$()){a:{var b,c,e=function(){if(!q){q=1;clearTimeout(s);try{c=JSON.parse(b.responseText)}catch(a){return h(1)}p=1;r(c)}},p=0,q=0,j=a.timeout||1E4,s=setTimeout(function(){h(1,{message:"timeout"})},j),D=a.b||A(),u=a.data||{},r=a.c||A(),f=!a.h,h=function(a,c){p||(p=1,clearTimeout(s),b&&(b.onerror=b.onload=y,b.abort&&b.abort(),b=y),a&&D(c))};try{b=$()||window.XDomainRequest&&new XDomainRequest||
  new XMLHttpRequest;b.onerror=b.onabort=function(){h(1,b.responseText||{error:"Network Connection Error"})};b.onload=b.onloadend=e;b.onreadystatechange=function(){if(b&&4==b.readyState)switch(b.status){case 200:break;default:try{c=JSON.parse(b.responseText),h(1,c)}catch(a){return h(1,{status:b.status,u:y,message:b.responseText})}}};var m=va(a.url,u);b.open("GET",m,f);f&&(b.timeout=j);b.send()}catch(g){h(0);Db=0;a=Gb(a);break a}a=h}return a}var l=Cb("script"),e=a.a,C=qa(),x=0,ea=setTimeout(function(){d(1,
  {message:"timeout"})},a.timeout||1E4),X=a.b||A(),j=a.data||{},bb=a.c||A();window[e]=function(a){d(0,a)};a.h||(l[Hb]=Hb);l.onerror=function(){d(1)};l.src=va(a.url,j);Ab(l,"id",C);yb().appendChild(l);return d},Ib=function(){if(!("onLine"in navigator))return 1;try{return navigator.onLine}catch(a){return v}},$=function(){if(!Jb||!Jb.get)return 0;var a={id:$.id++,send:A(),abort:function(){a.id={}},open:function(d,b){$[a.id]=a;Jb.get(a.id,b)}};return a},Hb="async",Pb=navigator.userAgent,Db=-1==Pb.indexOf("MSIE 6");
  window.console||(window.console=window.console||{});console.log||(console.log=console.error=(window.opera||{}).postError||A());var Qb,Rb={},Sb=z;try{Sb=window.localStorage}catch(Tb){}var Ub=function(a){return-1==document.cookie.indexOf(a)?y:((document.cookie||"").match(RegExp(a+"=([^;]+)"))||[])[1]||y},Vb=function(a,d){document.cookie=a+"="+d+"; expires=Thu, 1 Aug 2030 20:00:00 UTC; path=/"},Wb;try{Vb("pnctest","1"),Wb="1"===Ub("pnctest")}catch(Yb){Wb=z}Qb={get:function(a){try{return Sb?Sb.getItem(a):
  Wb?Ub(a):Rb[a]}catch(d){return Rb[a]}},set:function(a,d){try{if(Sb)return Sb.setItem(a,d)&&0;Wb&&Vb(a,d);Rb[a]=d}catch(b){Rb[a]=d}}};var Zb={list:{},unbind:function(a){Zb.list[a]=[]},bind:function(a,d){(Zb.list[a]=Zb.list[a]||[]).push(d)},fire:function(a,d){N(Zb.list[a]||[],function(a){a(d)})}},$b=ub("pubnub")||0,bc=function(a){function d(){}function b(a,b){function c(b){b&&(eb=F()-(b/1E4+(F()-d)/2),a&&a(eb))}var d=F();b&&c(b)||B.time(c)}function c(a,b){Qa&&Qa(a,b);Qa=y;clearTimeout(ga);clearTimeout(aa)}
  function e(){cc&&B.time(function(a){b(A(),a);a||c(1,{error:"Heartbeat failed to connect to Pubnub Servers.Please check your network settings."});aa&&clearTimeout(aa);aa=setTimeout(e,Eb)})}function p(){dc()||c(1,{error:"Offline. Please check your network settings. "});ga&&clearTimeout(ga);ga=setTimeout(p,E)}function q(a,b,c,d){var b=a.callback||b,e=a.error||t,f=K(),d=d||{};d.auth||(d.auth=a.auth_key||L);a=[M,"v1","channel-registration","sub-key",w];a.push.apply(a,c);f&&(d.callback=f);J({a:f,data:C(d),
  c:function(a){s(a,b,e)},b:function(a){j(a,e)},url:a})}function j(a,b){if("object"==typeof a&&a.error){var c={};a.message&&(c.message=a.message);a.payload&&(c.payload=a.payload);b&&b(c)}else b&&b(a)}function s(a,b,c){if("object"==typeof a){if(a.error){b={};a.message&&(b.message=a.message);a.payload&&(b.payload=a.payload);c&&c(b);return}if(a.payload){a.next_page?b&&b(a.payload,a.next_page):b&&b(a.payload);return}}b&&b(a)}function D(a){var b=0;N(Ba(G),function(c){if(c=G[c])b++,(a||A())(c)});return b}
  function u(a){var b=0;N(Ca(P),function(c){if(c=P[c])b++,(a||A())(c)})}function r(a){if(ec){if(!ba.length)return}else{a&&(ba.n=0);if(ba.n||!ba.length)return;ba.n=1}J(ba.shift())}function f(){!fb&&h()}function h(){clearTimeout(ha);!O||500<=O||1>O||!Ba(G,v).length&&!Ca(P,v).length?fb=z:(fb=v,B.presence_heartbeat({callback:function(){ha=setTimeout(h,O*E)},error:function(a){t&&t("Presence Heartbeat unable to reach Pubnub servers."+JSON.stringify(a));ha=setTimeout(h,O*E)}}))}function m(a,b){return Ra.decrypt(a,
  b||T)||Ra.decrypt(a,T)||a}function g(a,b,c){var d=z;if("undefined"===typeof a)return b;if("number"===typeof a)d=5<a||0==a?z:v;else{if("boolean"===typeof a)return a?30:0;d=v}return d?(c&&c("Presence Heartbeat value invalid. Valid range ( x > 5 or x = 0). Current Value : "+(b||5)),b||5):a}function l(a){var b="",c=[];N(a,function(a){c.push(a)});var d=c.sort(),e;for(e in d){var f=d[e],b=b+(f+"="+encodeURIComponent(a[f]));e!=d.length-1&&(b+="&")}return b}function C(a){a||(a={});N(H,function(b,c){b in a||
  (a[b]=c)});return a}function x(a){return bc(a)}function ea(a){function b(a,c){var d=(a&65535)+(c&65535);return(a>>16)+(c>>16)+(d>>16)<<16|d&65535}function c(a,b){return a>>>b|a<<32-b}var d;d=a.replace(/\r\n/g,"\n");for(var a="",e=0;e<d.length;e++){var f=d.charCodeAt(e);128>f?a+=String.fromCharCode(f):(127<f&&2048>f?a+=String.fromCharCode(f>>6|192):(a+=String.fromCharCode(f>>12|224),a+=String.fromCharCode(f>>6&63|128)),a+=String.fromCharCode(f&63|128))}e=a;d=[];for(f=0;f<8*e.length;f+=8)d[f>>5]|=(e.charCodeAt(f/
  8)&255)<<24-f%32;var j=8*a.length,e=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,
  3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],f=Array(64),h,m,l,g,p,q,t,r,s,u,w;d[j>>5]|=128<<24-j%32;d[(j+64>>9<<4)+15]=j;for(r=0;r<d.length;r+=16){j=a[0];h=a[1];m=a[2];l=a[3];g=a[4];p=a[5];q=a[6];t=a[7];for(s=0;64>s;s++)f[s]=16>s?d[s+r]:b(b(b(c(f[s-
  2],17)^c(f[s-2],19)^f[s-2]>>>10,f[s-7]),c(f[s-15],7)^c(f[s-15],18)^f[s-15]>>>3),f[s-16]),u=b(b(b(b(t,c(g,6)^c(g,11)^c(g,25)),g&p^~g&q),e[s]),f[s]),w=b(c(j,2)^c(j,13)^c(j,22),j&h^j&m^h&m),t=q,q=p,p=g,g=b(l,u),l=m,m=h,h=j,j=b(u,w);a[0]=b(j,a[0]);a[1]=b(h,a[1]);a[2]=b(m,a[2]);a[3]=b(l,a[3]);a[4]=b(g,a[4]);a[5]=b(p,a[5]);a[6]=b(q,a[6]);a[7]=b(t,a[7])}d="";for(e=0;e<4*a.length;e++)d+="0123456789abcdef".charAt(a[e>>2]>>8*(3-e%4)+4&15)+"0123456789abcdef".charAt(a[e>>2]>>8*(3-e%4)&15);return d}Db=a.jsonp?
  0:-1==Pb.indexOf("MSIE 6");var X=a.subscribe_key||"";a.uuid||Qb.get(X+"uuid");var bb=a.leave_on_unload||0;a.xdr=Gb;a.db=Qb;a.error=a.error||vb;a._is_online=Ib;a.jsonp_cb=Fb;a.hmac_SHA256=tb;V.size(256);var zb=V.s2a("0123456789012345");a.crypto_obj={encrypt:function(a,b){if(!b)return a;var c=V.s2a(ea(b).slice(0,32)),d=V.s2a(JSON.stringify(a)),c=V.rawEncrypt(d,c,zb);return V.Base64.encode(c)||a},decrypt:function(a,b){if(!b)return a;var c=V.s2a(ea(b).slice(0,32));try{var d=V.Base64.decode(a),e=V.rawDecrypt(d,
  c,zb,z);return JSON.parse(e)}catch(f){}}};a.params={pnsdk:"PubNub-JS-Web/3.7.10"};var Xb=+a.windowing||10,ac=(+a.timeout||310)*E,Eb=(+a.keepalive||60)*E,cc=a.timecheck||0,Kb=a.noleave||0,Q=a.publish_key||"demo",w=a.subscribe_key||"demo",L=a.auth_key||"",Sa=a.secret_key||"",Lb=a.hmac_SHA256,ca=a.ssl?"s":"",ra="http"+ca+"://"+(a.origin||"pubsub.pubnub.com"),M=sa(ra),Mb=sa(ra),ba=[],gb=v,eb=0,hb=0,Nb=0,Qa=0,Ta=a.restore||0,la=0,ib=z,G={},P={},U={},ha=y,R=g(a.heartbeat||a.pnexpires||0,a.error),O=a.heartbeat_interval||
  R/2-1,fb=z,ec=a.no_wait_for_pending,Ob=a["compatible_3.5"]||z,J=a.xdr,H=a.params||{},t=a.error||A(),dc=a._is_online||function(){return 1},K=a.jsonp_cb||function(){return 0},ma=a.db||{get:A(),set:A()},T=a.cipher_key,I=a.uuid||!a.unique_uuid&&ma&&ma.get(w+"uuid")||"",Y=a.instance_id||z,S="",ga,aa;2===R&&(O=1);var Ra=a.crypto_obj||{encrypt:function(a){return a},decrypt:function(a){return a}},B={LEAVE:function(a,b,c,d,e){var c={uuid:I,auth:c||L},f=sa(ra),d=d||A(),h=e||A(),e=K();if(0<a.indexOf(ka))return v;
  if(Ob&&(!ca||"0"==e)||Kb)return z;"0"!=e&&(c.callback=e);Y&&(c.instanceid=S);J({h:b||ca,timeout:2E3,a:e,data:C(c),c:function(a){s(a,d,h)},b:function(a){j(a,h)},url:[f,"v2","presence","sub_key",w,"channel",encodeURIComponent(a),"leave"]});return v},LEAVE_GROUP:function(a,b,c,d,e){var c={uuid:I,auth:c||L},f=sa(ra),d=d||A(),h=e||A(),e=K();if(0<a.indexOf(ka))return v;if(Ob&&(!ca||"0"==e)||Kb)return z;"0"!=e&&(c.callback=e);a&&0<a.length&&(c["channel-group"]=a);Y&&(c.instanceid=S);J({h:b||ca,timeout:5E3,
  a:e,data:C(c),c:function(a){s(a,d,h)},b:function(a){j(a,h)},url:[f,"v2","presence","sub_key",w,"channel",encodeURIComponent(","),"leave"]});return v},set_resumed:function(a){ib=a},get_cipher_key:function(){return T},set_cipher_key:function(a){T=a},raw_encrypt:function(a,b){return Ra.encrypt(a,b||T)||a},raw_decrypt:function(a,b){return m(a,b)},get_heartbeat:function(){return R},set_heartbeat:function(a,b){R=g(a,R,t);O=b||R/2-1;2==R&&(O=1);d();h()},get_heartbeat_interval:function(){return O},set_heartbeat_interval:function(a){O=
  a;h()},get_version:function(){return"3.7.10"},getGcmMessageObject:function(a){return{data:a}},getApnsMessageObject:function(a){var b={aps:{badge:1,alert:""}};for(k in a)k[b]=a[k];return b},newPnMessage:function(){var a={};gcm&&(a.pn_gcm=gcm);apns&&(a.pn_apns=apns);for(k in n)a[k]=n[k];return a},_add_param:function(a,b){H[a]=b},channel_group:function(a,b){var c=a.channel_group,b=b||a.callback,d=a.channels||a.channel,e=a.cloak,f,j,h=[],m={},g=a.mode||"add";c&&(c=c.split(":"),1<c.length?(f="*"===c[0]?
  y:c[0],j=c[1]):j=c[0]);f&&h.push("namespace")&&h.push(encodeURIComponent(f));h.push("channel-group");j&&"*"!==j&&h.push(j);d?(za(d)&&(d=d.join(",")),m[g]=d,m.cloak=gb?"true":"false"):"remove"===g&&h.push("remove");"undefined"!=typeof e&&(m.cloak=e?"true":"false");q(a,b,h,m)},channel_group_list_groups:function(a,b){var c;(c=a.namespace||a.ns||a.channel_group||y)&&(a.channel_group=c+":*");B.channel_group(a,b)},channel_group_list_channels:function(a,b){if(!a.channel_group)return t("Missing Channel Group");
  B.channel_group(a,b)},channel_group_remove_channel:function(a,b){if(!a.channel_group)return t("Missing Channel Group");if(!a.channel&&!a.channels)return t("Missing Channel");a.mode="remove";B.channel_group(a,b)},channel_group_remove_group:function(a,b){if(!a.channel_group)return t("Missing Channel Group");if(a.channel)return t("Use channel_group_remove_channel if you want to remove a channel from a group.");a.mode="remove";B.channel_group(a,b)},channel_group_add_channel:function(a,b){if(!a.channel_group)return t("Missing Channel Group");
  if(!a.channel&&!a.channels)return t("Missing Channel");B.channel_group(a,b)},channel_group_cloak:function(a,b){"undefined"==typeof a.cloak?b(gb):(gb=a.cloak,B.channel_group(a,b))},channel_group_list_namespaces:function(a,b){q(a,b,["namespace"])},channel_group_remove_namespace:function(a,b){q(a,b,["namespace",a.namespace,"remove"])},history:function(a,b){var b=a.callback||b,c=a.count||a.limit||100,d=a.reverse||"false",e=a.error||A(),f=a.auth_key||L,h=a.cipher_key,g=a.channel,l=a.channel_group,p=a.start,
  q=a.end,s=a.include_token,r={},u=K();if(!g&&!l)return t("Missing Channel");if(!b)return t("Missing Callback");if(!w)return t("Missing Subscribe Key");r.stringtoken="true";r.count=c;r.reverse=d;r.auth=f;l&&(r["channel-group"]=l,g||(g=","));u&&(r.callback=u);p&&(r.start=p);q&&(r.end=q);s&&(r.include_token="true");J({a:u,data:C(r),c:function(a){if("object"==typeof a&&a.error)e({message:a.message,payload:a.payload});else{for(var c=a[0],d=[],f=0;f<c.length;f++){var j=m(c[f],h);try{d.push(JSON.parse(j))}catch(hc){d.push(j)}}b([d,
  a[1],a[2]])}},b:function(a){j(a,e)},url:[M,"v2","history","sub-key",w,"channel",encodeURIComponent(g)]})},replay:function(a,b){var b=b||a.callback||A(),c=a.auth_key||L,d=a.source,e=a.destination,f=a.stop,j=a.start,h=a.end,m=a.reverse,g=a.limit,l=K(),p={};if(!d)return t("Missing Source Channel");if(!e)return t("Missing Destination Channel");if(!Q)return t("Missing Publish Key");if(!w)return t("Missing Subscribe Key");"0"!=l&&(p.callback=l);f&&(p.stop="all");m&&(p.reverse="true");j&&(p.start=j);h&&
  (p.end=h);g&&(p.count=g);p.auth=c;J({a:l,c:function(a){s(a,b,err)},b:function(){b([0,"Disconnected"])},url:[M,"v1","replay",Q,w,d,e],data:C(p)})},auth:function(a){L=a;d()},time:function(a){var b=K(),c={uuid:I,auth:L};Y&&(c.instanceid=S);J({a:b,data:C(c),timeout:5*E,url:[M,"time",b],c:function(b){a(b[0])},b:function(){a(0)}})},publish:function(a,b){var c=a.message;if(!c)return t("Missing Message");var b=b||a.callback||c.callback||A(),d=a.channel||c.channel,e=a.auth_key||L,f=a.cipher_key,h=a.error||
  c.error||A(),m=a.post||z,g="store_in_history"in a?a.store_in_history:v,l=K(),p="push";a.prepend&&(p="unshift");if(!d)return t("Missing Channel");if(!Q)return t("Missing Publish Key");if(!w)return t("Missing Subscribe Key");c.getPubnubMessage&&(c=c.getPubnubMessage());c=JSON.stringify(Ra.encrypt(c,f||T)||c);c=[M,"publish",Q,w,0,encodeURIComponent(d),l,encodeURIComponent(c)];H={uuid:I,auth:e};g||(H.store="0");Y&&(H.instanceid=S);ba[p]({a:l,timeout:5*E,url:c,data:C(H),b:function(a){j(a,h);r(1)},c:function(a){s(a,
  b,h);r(1)},mode:m?"POST":"GET"});r()},unsubscribe:function(a,b){var c=a.channel,e=a.channel_group,f=a.auth_key||L,b=b||a.callback||A(),j=a.error||A();la=0;c&&(c=Aa((c.join?c.join(","):""+c).split(","),function(a){if(G[a])return a+","+a+ka}).join(","),N(c.split(","),function(a){var c=v;a&&(G[a]=0,a in U&&delete U[a],ia&&(c=B.LEAVE(a,0,f,b,j)),c||b({action:"leave"}))}));e&&(e=Aa((e.join?e.join(","):""+e).split(","),function(a){if(P[a])return a+","+a+ka}).join(","),N(e.split(","),function(a){var c=v;
  a&&(P[a]=0,a in U&&delete U[a],ia&&(c=B.LEAVE_GROUP(a,0,f,b,j)),c||b({action:"leave"}))}));d()},subscribe:function(a,b){function e(a){a?setTimeout(d,E):(M=sa(ra,1),Mb=sa(ra,1),setTimeout(function(){B.time(e)},E));D(function(b){if(a&&b.d)return b.d=0,b.k(b.name);!a&&!b.d&&(b.d=1,b.j(b.name))});u(function(b){if(a&&b.d)return b.d=0,b.k(b.name);!a&&!b.d&&(b.d=1,b.j(b.name))})}function h(){var a=K(),b=Ba(G).join(","),g=Ca(P).join(",");if(b||g){b||(b=",");c();var l=C({uuid:I,auth:p});g&&(l["channel-group"]=
  g);2<JSON.stringify(U).length&&(l.state=JSON.stringify(U));R&&(l.heartbeat=R);Y&&(l.instanceid=S);f();Qa=J({timeout:ga,a:a,b:function(a){a&&a.error&&a.service?(j(a,x),e(1)):B.time(function(b){!b&&j(a,x);e(b)})},data:C(l),url:[Mb,"subscribe",w,encodeURIComponent(b),a,la],c:function(a){if(!a||"object"==typeof a&&"error"in a&&a.error)return x(a.error),setTimeout(d,E);O(a[1]);la=!la&&Ta&&ma.get(w)||a[1];D(function(a){a.f||(a.f=1,a.i(a.name))});u(function(a){a.f||(a.f=1,a.i(a.name))});if(ib&&!Ta)la=0,
  ib=z,ma.set(w,0);else{X&&(la=1E4,X=0);ma.set(w,a[1]);var b,c="",e="";3<a.length?(c=a[3],e=a[2]):c=2<a.length?a[2]:Aa(Ba(G),function(b){return Aa(Array(a[0].length).join(",").split(","),function(){return b})}).join(",");var f=c.split(","),j=e?e.split(","):[];b=function(){var a=f.shift()||Nb,b=j.shift(),c={};b?(a&&(0<=a.indexOf("-pnpres")&&0>b.indexOf("-pnpres"))&&(b+="-pnpres"),c=P[b]||G[b]||{callback:A()}):c=G[a];a=[c.a||hb,a.split(ka)[0]];b&&a.push(b.split(ka)[0]);return a};var g=F()-eb-+a[1]/1E4;
  N(a[0],function(c){var d=b(),c=m(c,G[d[1]]?G[d[1]].cipher_key:y);d[0]&&d[0](c,a,d[2]||d[1],g,d[1])})}setTimeout(h,aa)}})}}var g=a.channel,l=a.channel_group,b=(b=b||a.callback)||a.message,p=a.auth_key||L,q=a.connect||A(),r=a.reconnect||A(),s=a.disconnect||A(),x=a.error||x||A(),O=a.idle||A(),H=a.presence||0,Q=a.noheresync||0,X=a.backfill||0,ba=a.timetoken||0,ga=a.timeout||ac,aa=a.windowing||Xb,T=a.state,ca=a.heartbeat||a.pnexpires,ea=a.heartbeat_interval,ha=a.restore||Ta;Ta=ha;la=ba;if(!g&&!l)return t("Missing Channel");
  if(!b)return t("Missing Callback");if(!w)return t("Missing Subscribe Key");(ca||0===ca||ea||0===ea)&&B.set_heartbeat(ca,ea);g&&N((g.join?g.join(","):""+g).split(","),function(c){var d=G[c]||{};G[Nb=c]={name:c,f:d.f,d:d.d,e:1,a:hb=b,cipher_key:a.cipher_key,i:q,j:s,k:r};T&&(U[c]=c in T?T[c]:T);H&&(B.subscribe({channel:c+ka,callback:H,restore:ha}),!d.e&&!Q&&B.here_now({channel:c,data:C({uuid:I,auth:p}),callback:function(a){N("uuids"in a?a.uuids:[],function(b){H({action:"join",uuid:b,timestamp:Math.floor(F()/
  1E3),occupancy:a.occupancy||1},a,c)})}}))});l&&N((l.join?l.join(","):""+l).split(","),function(c){var d=P[c]||{};P[c]={name:c,f:d.f,d:d.d,e:1,a:hb=b,cipher_key:a.cipher_key,i:q,j:s,k:r};H&&(B.subscribe({channel_group:c+ka,callback:H,restore:ha,auth_key:p}),!d.e&&!Q&&B.here_now({channel_group:c,data:C({uuid:I,auth:p}),callback:function(a){N("uuids"in a?a.uuids:[],function(b){H({action:"join",uuid:b,timestamp:Math.floor(F()/1E3),occupancy:a.occupancy||1},a,c)})}}))});d=function(){c();setTimeout(h,aa)};
  if(!ia)return ja.push(d);d()},here_now:function(a,b){var b=a.callback||b,c=a.error||A(),d=a.auth_key||L,e=a.channel,f=a.channel_group,h=K(),g=a.state,d={uuid:I,auth:d};if(!("uuids"in a?a.uuids:1))d.disable_uuids=1;g&&(d.state=1);if(!b)return t("Missing Callback");if(!w)return t("Missing Subscribe Key");g=[M,"v2","presence","sub_key",w];e&&g.push("channel")&&g.push(encodeURIComponent(e));"0"!=h&&(d.callback=h);f&&(d["channel-group"]=f,!e&&g.push("channel")&&g.push(","));Y&&(d.instanceid=S);J({a:h,
  data:C(d),c:function(a){s(a,b,c)},b:function(a){j(a,c)},url:g})},where_now:function(a,b){var b=a.callback||b,c=a.error||A(),d=a.auth_key||L,e=K(),f=a.uuid||I,d={auth:d};if(!b)return t("Missing Callback");if(!w)return t("Missing Subscribe Key");"0"!=e&&(d.callback=e);Y&&(d.instanceid=S);J({a:e,data:C(d),c:function(a){s(a,b,c)},b:function(a){j(a,c)},url:[M,"v2","presence","sub_key",w,"uuid",encodeURIComponent(f)]})},state:function(a,b){var b=a.callback||b||A(),c=a.error||A(),d=a.auth_key||L,e=K(),f=
  a.state,h=a.uuid||I,g=a.channel,l=a.channel_group,d=C({auth:d});if(!w)return t("Missing Subscribe Key");if(!h)return t("Missing UUID");if(!g&&!l)return t("Missing Channel");"0"!=e&&(d.callback=e);"undefined"!=typeof g&&G[g]&&G[g].e&&f&&(U[g]=f);"undefined"!=typeof l&&(P[l]&&P[l].e)&&(f&&(U[l]=f),d["channel-group"]=l,g||(g=","));d.state=JSON.stringify(f);Y&&(d.instanceid=S);f=f?[M,"v2","presence","sub-key",w,"channel",g,"uuid",h,"data"]:[M,"v2","presence","sub-key",w,"channel",g,"uuid",encodeURIComponent(h)];
  J({a:e,data:C(d),c:function(a){s(a,b,c)},b:function(a){j(a,c)},url:f})},grant:function(a,b){var b=a.callback||b,c=a.error||A(),d=a.channel,e=a.channel_group,f=K(),h=a.ttl,g=a.read?"1":"0",m=a.write?"1":"0",p=a.manage?"1":"0",q=a.auth_key;if(!b)return t("Missing Callback");if(!w)return t("Missing Subscribe Key");if(!Q)return t("Missing Publish Key");if(!Sa)return t("Missing Secret Key");var r=w+"\n"+Q+"\ngrant\n",g={w:m,r:g,timestamp:Math.floor((new Date).getTime()/1E3)};a.manage&&(g.m=p);"undefined"!=
  typeof d&&(d!=y&&0<d.length)&&(g.channel=d);"undefined"!=typeof e&&(e!=y&&0<e.length)&&(g["channel-group"]=e);"0"!=f&&(g.callback=f);if(h||0===h)g.ttl=h;q&&(g.auth=q);g=C(g);q||delete g.auth;r+=l(g);d=Lb(r,Sa);d=d.replace(/\+/g,"-");d=d.replace(/\//g,"_");g.signature=d;J({a:f,data:g,c:function(a){s(a,b,c)},b:function(a){j(a,c)},url:[M,"v1","auth","grant","sub-key",w]})},mobile_gw_provision:function(a){var b=a.callback||A(),c=a.auth_key||L,d=a.error||A(),e=K(),f=a.channel,g=a.op,h=a.gw_type,a=a.device_id;
  if(!a)return t("Missing Device ID (device_id)");if(!h)return t("Missing GW Type (gw_type: gcm or apns)");if(!g)return t("Missing GW Operation (op: add or remove)");if(!f)return t("Missing gw destination Channel (channel)");if(!Q)return t("Missing Publish Key");if(!w)return t("Missing Subscribe Key");a=[M,"v1/push/sub-key",w,"devices",a];H={uuid:I,auth:c,type:h};"add"==g?H.add=f:"remove"==g&&(H.remove=f);Y&&(data.instanceid=S);J({a:e,data:H,c:function(a){s(a,b,d)},b:function(a){j(a,d)},url:a})},audit:function(a,
  b){var b=a.callback||b,c=a.error||A(),d=a.channel,e=a.channel_group,f=a.auth_key,g=K();if(!b)return t("Missing Callback");if(!w)return t("Missing Subscribe Key");if(!Q)return t("Missing Publish Key");if(!Sa)return t("Missing Secret Key");var h=w+"\n"+Q+"\naudit\n",m={timestamp:Math.floor((new Date).getTime()/1E3)};"0"!=g&&(m.callback=g);"undefined"!=typeof d&&(d!=y&&0<d.length)&&(m.channel=d);"undefined"!=typeof e&&(e!=y&&0<e.length)&&(m["channel-group"]=e);f&&(m.auth=f);m=C(m);f||delete m.auth;h+=
  l(m);d=Lb(h,Sa);d=d.replace(/\+/g,"-");d=d.replace(/\//g,"_");m.signature=d;J({a:g,data:m,c:function(a){s(a,b,c)},b:function(a){j(a,c)},url:[M,"v1","auth","audit","sub-key",w]})},revoke:function(a,b){a.read=z;a.write=z;B.grant(a,b)},set_uuid:function(a){I=a;d()},get_uuid:function(){return I},isArray:function(a){return za(a)},get_subscibed_channels:function(){return Ba(G,v)},presence_heartbeat:function(a){var b=a.callback||A(),c=a.error||A(),a=K(),d={uuid:I,auth:L};2<JSON.stringify(U).length&&(d.state=
  JSON.stringify(U));0<R&&320>R&&(d.heartbeat=R);"0"!=a&&(d.callback=a);var e;e=Ba(G,v).join(",");e=encodeURIComponent(e);var f=Ca(P,v).join(",");e||(e=",");f&&(d["channel-group"]=f);Y&&(d.instanceid=S);J({a:a,data:C(d),timeout:5*E,url:[M,"v2","presence","sub-key",w,"channel",e,"heartbeat"],c:function(a){s(a,b,c)},b:function(a){j(a,c)}})},stop_timers:function(){clearTimeout(ga);clearTimeout(aa)},xdr:J,ready:Da,db:ma,uuid:ua,map:Aa,each:N,"each-channel":D,grep:xa,offline:function(){c(1,{message:"Offline. Please check your network settings."})},
  supplant:ya,now:F,unique:qa,updater:wa};I||(I=B.uuid());S||(S=B.uuid());ma.set(w+"uuid",I);ga=setTimeout(p,E);aa=setTimeout(e,Eb);ha=setTimeout(f,(O-3)*E);b();var X=B,Ua;for(Ua in X)X.hasOwnProperty(Ua)&&(x[Ua]=X[Ua]);x.css=Bb;x.$=ub;x.create=Cb;x.bind=xb;x.head=yb;x.search=wb;x.attr=Ab;x.events=Zb;x.init=x;x.secure=x;xb("beforeunload",window,function(){if(bb)x["each-channel"](function(a){x.LEAVE(a.name,0)});return v});if(a.notest)return x;xb("offline",window,x.offline);xb("offline",document,x.offline);
  return x};bc.init=bc;bc.secure=bc;"complete"===document.readyState?setTimeout(Da,0):xb("load",window,function(){setTimeout(Da,0)});var fc=$b||{};PUBNUB=bc({notest:1,publish_key:Ab(fc,"pub-key"),subscribe_key:Ab(fc,"sub-key"),ssl:!document.location.href.indexOf("https")||"on"==Ab(fc,"ssl"),origin:Ab(fc,"origin"),uuid:Ab(fc,"uuid")});window.jQuery&&(window.jQuery.PUBNUB=bc);"undefined"!==typeof module&&(module.exports=PUBNUB)&&Da();var Jb=ub("pubnubs")||0;if($b){Bb($b,{position:"absolute",top:-E});
  if("opera"in window||Ab($b,"flash"))$b.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,d){if(!d)return $[a].onerror();$[a].responseText=unescape(d);$[a].onload()};$.id=E}}
  var gc=PUBNUB.ws=function(a,d){if(!(this instanceof gc))return new gc(a,d);var b=this,a=b.url=a||"";b.protocol=d||"Sec-WebSocket-Protocol";var c=a.split("/"),c={ssl:"wss:"===c[0],origin:c[2],publish_key:c[3],subscribe_key:c[4],channel:c[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=
  A();b.binaryType="";b.extensions="";b.bufferedAmount=0;b.trasnmitting=z;b.buffer=[];b.readyState=b.CONNECTING;if(!a)return b.readyState=b.CLOSED,b.onclose({code:b.CLOSE_ABNORMAL,reason:"Missing URL",wasClean:v}),b;b.g=PUBNUB.init(c);b.g.o=c;b.o=c;b.g.subscribe({restore:z,channel:c.channel,disconnect:b.onerror,reconnect:b.onopen,error:function(){b.onclose({code:b.CLOSE_ABNORMAL,reason:"Missing URL",wasClean:z})},callback:function(a){b.onmessage({data:a})},connect:function(){b.readyState=b.OPEN;b.onopen()}})};
  gc.prototype.send=function(a){var d=this;d.g.publish({channel:d.g.o.channel,message:a,callback:function(a){d.onsend({data:a})}})};
  })();
  /*
  CryptoJS v3.1.2
  code.google.com/p/crypto-js
  (c) 2009-2013 by Jeff Mott. All rights reserved.
  code.google.com/p/crypto-js/wiki/License
  */
  var CryptoJS=CryptoJS||function(h,s){var f={},g=f.lib={},q=function(){},m=g.Base={extend:function(a){q.prototype=this;var c=new q;a&&c.mixIn(a);c.hasOwnProperty("init")||(c.init=function(){c.$super.init.apply(this,arguments)});c.init.prototype=c;c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},
  r=g.WordArray=m.extend({init:function(a,c){a=this.words=a||[];this.sigBytes=c!=s?c:4*a.length},toString:function(a){return(a||k).stringify(this)},concat:function(a){var c=this.words,d=a.words,b=this.sigBytes;a=a.sigBytes;this.clamp();if(b%4)for(var e=0;e<a;e++)c[b+e>>>2]|=(d[e>>>2]>>>24-8*(e%4)&255)<<24-8*((b+e)%4);else if(65535<d.length)for(e=0;e<a;e+=4)c[b+e>>>2]=d[e>>>2];else c.push.apply(c,d);this.sigBytes+=a;return this},clamp:function(){var a=this.words,c=this.sigBytes;a[c>>>2]&=4294967295<<
  32-8*(c%4);a.length=h.ceil(c/4)},clone:function(){var a=m.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var c=[],d=0;d<a;d+=4)c.push(4294967296*h.random()|0);return new r.init(c,a)}}),l=f.enc={},k=l.Hex={stringify:function(a){var c=a.words;a=a.sigBytes;for(var d=[],b=0;b<a;b++){var e=c[b>>>2]>>>24-8*(b%4)&255;d.push((e>>>4).toString(16));d.push((e&15).toString(16))}return d.join("")},parse:function(a){for(var c=a.length,d=[],b=0;b<c;b+=2)d[b>>>3]|=parseInt(a.substr(b,
  2),16)<<24-4*(b%8);return new r.init(d,c/2)}},n=l.Latin1={stringify:function(a){var c=a.words;a=a.sigBytes;for(var d=[],b=0;b<a;b++)d.push(String.fromCharCode(c[b>>>2]>>>24-8*(b%4)&255));return d.join("")},parse:function(a){for(var c=a.length,d=[],b=0;b<c;b++)d[b>>>2]|=(a.charCodeAt(b)&255)<<24-8*(b%4);return new r.init(d,c)}},j=l.Utf8={stringify:function(a){try{return decodeURIComponent(escape(n.stringify(a)))}catch(c){throw Error("Malformed UTF-8 data");}},parse:function(a){return n.parse(unescape(encodeURIComponent(a)))}},
  u=g.BufferedBlockAlgorithm=m.extend({reset:function(){this._data=new r.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=j.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var c=this._data,d=c.words,b=c.sigBytes,e=this.blockSize,f=b/(4*e),f=a?h.ceil(f):h.max((f|0)-this._minBufferSize,0);a=f*e;b=h.min(4*a,b);if(a){for(var g=0;g<a;g+=e)this._doProcessBlock(d,g);g=d.splice(0,a);c.sigBytes-=b}return new r.init(g,b)},clone:function(){var a=m.clone.call(this);
  a._data=this._data.clone();return a},_minBufferSize:0});g.Hasher=u.extend({cfg:m.extend(),init:function(a){this.cfg=this.cfg.extend(a);this.reset()},reset:function(){u.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);return this._doFinalize()},blockSize:16,_createHelper:function(a){return function(c,d){return(new a.init(d)).finalize(c)}},_createHmacHelper:function(a){return function(c,d){return(new t.HMAC.init(a,
  d)).finalize(c)}}});var t=f.algo={};return f}(Math);
  (function(h){for(var s=CryptoJS,f=s.lib,g=f.WordArray,q=f.Hasher,f=s.algo,m=[],r=[],l=function(a){return 4294967296*(a-(a|0))|0},k=2,n=0;64>n;){var j;a:{j=k;for(var u=h.sqrt(j),t=2;t<=u;t++)if(!(j%t)){j=!1;break a}j=!0}j&&(8>n&&(m[n]=l(h.pow(k,0.5))),r[n]=l(h.pow(k,1/3)),n++);k++}var a=[],f=f.SHA256=q.extend({_doReset:function(){this._hash=new g.init(m.slice(0))},_doProcessBlock:function(c,d){for(var b=this._hash.words,e=b[0],f=b[1],g=b[2],j=b[3],h=b[4],m=b[5],n=b[6],q=b[7],p=0;64>p;p++){if(16>p)a[p]=
  c[d+p]|0;else{var k=a[p-15],l=a[p-2];a[p]=((k<<25|k>>>7)^(k<<14|k>>>18)^k>>>3)+a[p-7]+((l<<15|l>>>17)^(l<<13|l>>>19)^l>>>10)+a[p-16]}k=q+((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+(h&m^~h&n)+r[p]+a[p];l=((e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22))+(e&f^e&g^f&g);q=n;n=m;m=h;h=j+k|0;j=g;g=f;f=e;e=k+l|0}b[0]=b[0]+e|0;b[1]=b[1]+f|0;b[2]=b[2]+g|0;b[3]=b[3]+j|0;b[4]=b[4]+h|0;b[5]=b[5]+m|0;b[6]=b[6]+n|0;b[7]=b[7]+q|0},_doFinalize:function(){var a=this._data,d=a.words,b=8*this._nDataBytes,e=8*a.sigBytes;
  d[e>>>5]|=128<<24-e%32;d[(e+64>>>9<<4)+14]=h.floor(b/4294967296);d[(e+64>>>9<<4)+15]=b;a.sigBytes=4*d.length;this._process();return this._hash},clone:function(){var a=q.clone.call(this);a._hash=this._hash.clone();return a}});s.SHA256=q._createHelper(f);s.HmacSHA256=q._createHmacHelper(f)})(Math);
  (function(){var h=CryptoJS,s=h.enc.Utf8;h.algo.HMAC=h.lib.Base.extend({init:function(f,g){f=this._hasher=new f.init;"string"==typeof g&&(g=s.parse(g));var h=f.blockSize,m=4*h;g.sigBytes>m&&(g=f.finalize(g));g.clamp();for(var r=this._oKey=g.clone(),l=this._iKey=g.clone(),k=r.words,n=l.words,j=0;j<h;j++)k[j]^=1549556828,n[j]^=909522486;r.sigBytes=l.sigBytes=m;this.reset()},reset:function(){var f=this._hasher;f.reset();f.update(this._iKey)},update:function(f){this._hasher.update(f);return this},finalize:function(f){var g=
  this._hasher;f=g.finalize(f);g.reset();return g.finalize(this._oKey.clone().concat(f))}})})();
  /*
  CryptoJS v3.1.2
  code.google.com/p/crypto-js
  (c) 2009-2013 by Jeff Mott. All rights reserved.
  code.google.com/p/crypto-js/wiki/License
  */
  (function(){var h=CryptoJS,j=h.lib.WordArray;h.enc.Base64={stringify:function(b){var e=b.words,f=b.sigBytes,c=this._map;b.clamp();b=[];for(var a=0;a<f;a+=3)for(var d=(e[a>>>2]>>>24-8*(a%4)&255)<<16|(e[a+1>>>2]>>>24-8*((a+1)%4)&255)<<8|e[a+2>>>2]>>>24-8*((a+2)%4)&255,g=0;4>g&&a+0.75*g<f;g++)b.push(c.charAt(d>>>6*(3-g)&63));if(e=c.charAt(64))for(;b.length%4;)b.push(e);return b.join("")},parse:function(b){var e=b.length,f=this._map,c=f.charAt(64);c&&(c=b.indexOf(c),-1!=c&&(e=c));for(var c=[],a=0,d=0;d<
  e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))<<2*(d%4),h=f.indexOf(b.charAt(d))>>>6-2*(d%4);c[a>>>2]|=(g|h)<<24-8*(a%4);a++}return j.create(c,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();
  