pusher-js 7.3.0 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release.yml +1 -1
- package/.github/workflows/release_pr.yml +1 -1
- package/.github/workflows/run-tests.yml +2 -2
- package/.gitmodules +1 -1
- package/CHANGELOG.md +4 -0
- package/README.md +10 -30
- package/dist/node/pusher.js +127 -37
- package/dist/node/pusher.js.map +1 -1
- package/dist/react-native/pusher.js +2 -2
- package/dist/react-native/pusher.js.map +1 -1
- package/dist/web/pusher-with-encryption.js +127 -37
- package/dist/web/pusher-with-encryption.js.map +1 -1
- package/dist/web/pusher-with-encryption.min.js +2 -2
- package/dist/web/pusher-with-encryption.min.js.map +1 -1
- package/dist/web/pusher.js +127 -37
- package/dist/web/pusher.js.map +1 -1
- package/dist/web/pusher.min.js +2 -2
- package/dist/web/pusher.min.js.map +1 -1
- package/dist/worker/pusher-with-encryption.worker.js +127 -37
- package/dist/worker/pusher-with-encryption.worker.js.map +1 -1
- package/dist/worker/pusher-with-encryption.worker.min.js +2 -2
- package/dist/worker/pusher-with-encryption.worker.min.js.map +1 -1
- package/dist/worker/pusher.worker.js +127 -37
- package/dist/worker/pusher.worker.js.map +1 -1
- package/dist/worker/pusher.worker.min.js +2 -2
- package/dist/worker/pusher.worker.min.js.map +1 -1
- package/package.json +5 -4
- package/spec/javascripts/helpers/timers/promises.js +9 -0
- package/spec/javascripts/unit/core/channels/presence_channel_spec.js +85 -16
- package/spec/javascripts/unit/core/user_spec.js +13 -6
- package/src/core/channels/presence_channel.ts +21 -12
- package/src/core/http/http_socket.ts +3 -1
- package/src/core/pusher.ts +1 -1
- package/src/core/user.ts +65 -27
- package/src/core/utils/flat_promise.ts +10 -0
- package/src/runtimes/interface.ts +1 -0
- package/src/runtimes/node/runtime.ts +5 -0
- package/src/runtimes/react-native/runtime.ts +5 -0
- package/src/runtimes/web/runtime.ts +14 -0
- package/src/runtimes/worker/runtime.ts +14 -0
- package/types/src/core/strategies/transport_strategy.d.ts +3 -0
- package/types/src/core/user.d.ts +5 -1
- package/types/src/core/utils/flat_promise.d.ts +6 -0
- package/types/src/runtimes/interface.d.ts +1 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Pusher JavaScript Library v7.
|
|
2
|
+
* Pusher JavaScript Library v7.4.0
|
|
3
3
|
* https://pusher.com/
|
|
4
4
|
*
|
|
5
5
|
* Copyright 2020, Pusher
|
|
6
6
|
* Released under the MIT licence.
|
|
7
7
|
*/
|
|
8
|
-
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.Pusher=n():t.Pusher=n()}(window,(function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=3)}([function(t,n,e){"use strict";var r,o=this&&this.__extends||(r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)},function(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function t(t){void 0===t&&(t="="),this._paddingCharacter=t}return t.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(8*t+5)/6|0},t.prototype.encode=function(t){for(var n="",e=0;e<t.length-2;e+=3){var r=t[e]<<16|t[e+1]<<8|t[e+2];n+=this._encodeByte(r>>>18&63),n+=this._encodeByte(r>>>12&63),n+=this._encodeByte(r>>>6&63),n+=this._encodeByte(r>>>0&63)}var o=t.length-e;if(o>0){r=t[e]<<16|(2===o?t[e+1]<<8:0);n+=this._encodeByte(r>>>18&63),n+=this._encodeByte(r>>>12&63),n+=2===o?this._encodeByte(r>>>6&63):this._paddingCharacter||"",n+=this._paddingCharacter||""}return n},t.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(6*t+7)/8|0},t.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},t.prototype.decode=function(t){if(0===t.length)return new Uint8Array(0);for(var n=this._getPaddingLength(t),e=t.length-n,r=new Uint8Array(this.maxDecodedLength(e)),o=0,i=0,s=0,a=0,c=0,u=0,h=0;i<e-4;i+=4)a=this._decodeChar(t.charCodeAt(i+0)),c=this._decodeChar(t.charCodeAt(i+1)),u=this._decodeChar(t.charCodeAt(i+2)),h=this._decodeChar(t.charCodeAt(i+3)),r[o++]=a<<2|c>>>4,r[o++]=c<<4|u>>>2,r[o++]=u<<6|h,s|=256&a,s|=256&c,s|=256&u,s|=256&h;if(i<e-1&&(a=this._decodeChar(t.charCodeAt(i)),c=this._decodeChar(t.charCodeAt(i+1)),r[o++]=a<<2|c>>>4,s|=256&a,s|=256&c),i<e-2&&(u=this._decodeChar(t.charCodeAt(i+2)),r[o++]=c<<4|u>>>2,s|=256&u),i<e-3&&(h=this._decodeChar(t.charCodeAt(i+3)),r[o++]=u<<6|h,s|=256&h),0!==s)throw new Error("Base64Coder: incorrect characters for decoding");return r},t.prototype._encodeByte=function(t){var n=t;return n+=65,n+=25-t>>>8&6,n+=51-t>>>8&-75,n+=61-t>>>8&-15,n+=62-t>>>8&3,String.fromCharCode(n)},t.prototype._decodeChar=function(t){var n=256;return n+=(42-t&t-44)>>>8&-256+t-43+62,n+=(46-t&t-48)>>>8&-256+t-47+63,n+=(47-t&t-58)>>>8&-256+t-48+52,n+=(64-t&t-91)>>>8&-256+t-65+0,n+=(96-t&t-123)>>>8&-256+t-97+26},t.prototype._getPaddingLength=function(t){var n=0;if(this._paddingCharacter){for(var e=t.length-1;e>=0&&t[e]===this._paddingCharacter;e--)n++;if(t.length<4||n>2)throw new Error("Base64Coder: incorrect padding")}return n},t}();n.Coder=i;var s=new i;n.encode=function(t){return s.encode(t)},n.decode=function(t){return s.decode(t)};var a=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return o(n,t),n.prototype._encodeByte=function(t){var n=t;return n+=65,n+=25-t>>>8&6,n+=51-t>>>8&-75,n+=61-t>>>8&-13,n+=62-t>>>8&49,String.fromCharCode(n)},n.prototype._decodeChar=function(t){var n=256;return n+=(44-t&t-46)>>>8&-256+t-45+62,n+=(94-t&t-96)>>>8&-256+t-95+63,n+=(47-t&t-58)>>>8&-256+t-48+52,n+=(64-t&t-91)>>>8&-256+t-65+0,n+=(96-t&t-123)>>>8&-256+t-97+26},n}(i);n.URLSafeCoder=a;var c=new a;n.encodeURLSafe=function(t){return c.encode(t)},n.decodeURLSafe=function(t){return c.decode(t)},n.encodedLength=function(t){return s.encodedLength(t)},n.maxDecodedLength=function(t){return s.maxDecodedLength(t)},n.decodedLength=function(t){return s.decodedLength(t)}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r="utf8: invalid source encoding";function o(t){for(var n=0,e=0;e<t.length;e++){var r=t.charCodeAt(e);if(r<128)n+=1;else if(r<2048)n+=2;else if(r<55296)n+=3;else{if(!(r<=57343))throw new Error("utf8: invalid string");if(e>=t.length-1)throw new Error("utf8: invalid string");e++,n+=4}}return n}n.encode=function(t){for(var n=new Uint8Array(o(t)),e=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);i<128?n[e++]=i:i<2048?(n[e++]=192|i>>6,n[e++]=128|63&i):i<55296?(n[e++]=224|i>>12,n[e++]=128|i>>6&63,n[e++]=128|63&i):(r++,i=(1023&i)<<10,i|=1023&t.charCodeAt(r),i+=65536,n[e++]=240|i>>18,n[e++]=128|i>>12&63,n[e++]=128|i>>6&63,n[e++]=128|63&i)}return n},n.encodedLength=o,n.decode=function(t){for(var n=[],e=0;e<t.length;e++){var o=t[e];if(128&o){var i=void 0;if(o<224){if(e>=t.length)throw new Error(r);if(128!=(192&(s=t[++e])))throw new Error(r);o=(31&o)<<6|63&s,i=128}else if(o<240){if(e>=t.length-1)throw new Error(r);var s=t[++e],a=t[++e];if(128!=(192&s)||128!=(192&a))throw new Error(r);o=(15&o)<<12|(63&s)<<6|63&a,i=2048}else{if(!(o<248))throw new Error(r);if(e>=t.length-2)throw new Error(r);s=t[++e],a=t[++e];var c=t[++e];if(128!=(192&s)||128!=(192&a)||128!=(192&c))throw new Error(r);o=(15&o)<<18|(63&s)<<12|(63&a)<<6|63&c,i=65536}if(o<i||o>=55296&&o<=57343)throw new Error(r);if(o>=65536){if(o>1114111)throw new Error(r);o-=65536,n.push(String.fromCharCode(55296|o>>10)),o=56320|1023&o}}n.push(String.fromCharCode(o))}return n.join("")}},function(t,n,e){!function(t){"use strict";var n=function(t){var n,e=new Float64Array(16);if(t)for(n=0;n<t.length;n++)e[n]=t[n];return e},r=function(){throw new Error("no PRNG")},o=new Uint8Array(16),i=new Uint8Array(32);i[0]=9;var s=n(),a=n([1]),c=n([56129,1]),u=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),p=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),l=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),f=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function d(t,n,e,r){t[n]=e>>24&255,t[n+1]=e>>16&255,t[n+2]=e>>8&255,t[n+3]=255&e,t[n+4]=r>>24&255,t[n+5]=r>>16&255,t[n+6]=r>>8&255,t[n+7]=255&r}function y(t,n,e,r,o){var i,s=0;for(i=0;i<o;i++)s|=t[n+i]^e[r+i];return(1&s-1>>>8)-1}function g(t,n,e,r){return y(t,n,e,r,16)}function v(t,n,e,r){return y(t,n,e,r,32)}function b(t,n,e,r){!function(t,n,e,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,a=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,u=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,h=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,p=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,d=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,g=255&e[16]|(255&e[17])<<8|(255&e[18])<<16|(255&e[19])<<24,v=255&e[20]|(255&e[21])<<8|(255&e[22])<<16|(255&e[23])<<24,b=255&e[24]|(255&e[25])<<8|(255&e[26])<<16|(255&e[27])<<24,m=255&e[28]|(255&e[29])<<8|(255&e[30])<<16|(255&e[31])<<24,w=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,_=i,S=s,k=a,C=c,T=u,P=h,O=p,A=l,E=f,x=d,L=y,U=g,R=v,j=b,M=m,I=w,N=0;N<20;N+=2)_^=(o=(R^=(o=(E^=(o=(T^=(o=_+R|0)<<7|o>>>25)+_|0)<<9|o>>>23)+T|0)<<13|o>>>19)+E|0)<<18|o>>>14,P^=(o=(S^=(o=(j^=(o=(x^=(o=P+S|0)<<7|o>>>25)+P|0)<<9|o>>>23)+x|0)<<13|o>>>19)+j|0)<<18|o>>>14,L^=(o=(O^=(o=(k^=(o=(M^=(o=L+O|0)<<7|o>>>25)+L|0)<<9|o>>>23)+M|0)<<13|o>>>19)+k|0)<<18|o>>>14,I^=(o=(U^=(o=(A^=(o=(C^=(o=I+U|0)<<7|o>>>25)+I|0)<<9|o>>>23)+C|0)<<13|o>>>19)+A|0)<<18|o>>>14,_^=(o=(C^=(o=(k^=(o=(S^=(o=_+C|0)<<7|o>>>25)+_|0)<<9|o>>>23)+S|0)<<13|o>>>19)+k|0)<<18|o>>>14,P^=(o=(T^=(o=(A^=(o=(O^=(o=P+T|0)<<7|o>>>25)+P|0)<<9|o>>>23)+O|0)<<13|o>>>19)+A|0)<<18|o>>>14,L^=(o=(x^=(o=(E^=(o=(U^=(o=L+x|0)<<7|o>>>25)+L|0)<<9|o>>>23)+U|0)<<13|o>>>19)+E|0)<<18|o>>>14,I^=(o=(M^=(o=(j^=(o=(R^=(o=I+M|0)<<7|o>>>25)+I|0)<<9|o>>>23)+R|0)<<13|o>>>19)+j|0)<<18|o>>>14;_=_+i|0,S=S+s|0,k=k+a|0,C=C+c|0,T=T+u|0,P=P+h|0,O=O+p|0,A=A+l|0,E=E+f|0,x=x+d|0,L=L+y|0,U=U+g|0,R=R+v|0,j=j+b|0,M=M+m|0,I=I+w|0,t[0]=_>>>0&255,t[1]=_>>>8&255,t[2]=_>>>16&255,t[3]=_>>>24&255,t[4]=S>>>0&255,t[5]=S>>>8&255,t[6]=S>>>16&255,t[7]=S>>>24&255,t[8]=k>>>0&255,t[9]=k>>>8&255,t[10]=k>>>16&255,t[11]=k>>>24&255,t[12]=C>>>0&255,t[13]=C>>>8&255,t[14]=C>>>16&255,t[15]=C>>>24&255,t[16]=T>>>0&255,t[17]=T>>>8&255,t[18]=T>>>16&255,t[19]=T>>>24&255,t[20]=P>>>0&255,t[21]=P>>>8&255,t[22]=P>>>16&255,t[23]=P>>>24&255,t[24]=O>>>0&255,t[25]=O>>>8&255,t[26]=O>>>16&255,t[27]=O>>>24&255,t[28]=A>>>0&255,t[29]=A>>>8&255,t[30]=A>>>16&255,t[31]=A>>>24&255,t[32]=E>>>0&255,t[33]=E>>>8&255,t[34]=E>>>16&255,t[35]=E>>>24&255,t[36]=x>>>0&255,t[37]=x>>>8&255,t[38]=x>>>16&255,t[39]=x>>>24&255,t[40]=L>>>0&255,t[41]=L>>>8&255,t[42]=L>>>16&255,t[43]=L>>>24&255,t[44]=U>>>0&255,t[45]=U>>>8&255,t[46]=U>>>16&255,t[47]=U>>>24&255,t[48]=R>>>0&255,t[49]=R>>>8&255,t[50]=R>>>16&255,t[51]=R>>>24&255,t[52]=j>>>0&255,t[53]=j>>>8&255,t[54]=j>>>16&255,t[55]=j>>>24&255,t[56]=M>>>0&255,t[57]=M>>>8&255,t[58]=M>>>16&255,t[59]=M>>>24&255,t[60]=I>>>0&255,t[61]=I>>>8&255,t[62]=I>>>16&255,t[63]=I>>>24&255}(t,n,e,r)}function m(t,n,e,r){!function(t,n,e,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,a=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,u=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,h=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,p=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,d=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,g=255&e[16]|(255&e[17])<<8|(255&e[18])<<16|(255&e[19])<<24,v=255&e[20]|(255&e[21])<<8|(255&e[22])<<16|(255&e[23])<<24,b=255&e[24]|(255&e[25])<<8|(255&e[26])<<16|(255&e[27])<<24,m=255&e[28]|(255&e[29])<<8|(255&e[30])<<16|(255&e[31])<<24,w=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,_=0;_<20;_+=2)i^=(o=(v^=(o=(f^=(o=(u^=(o=i+v|0)<<7|o>>>25)+i|0)<<9|o>>>23)+u|0)<<13|o>>>19)+f|0)<<18|o>>>14,h^=(o=(s^=(o=(b^=(o=(d^=(o=h+s|0)<<7|o>>>25)+h|0)<<9|o>>>23)+d|0)<<13|o>>>19)+b|0)<<18|o>>>14,y^=(o=(p^=(o=(a^=(o=(m^=(o=y+p|0)<<7|o>>>25)+y|0)<<9|o>>>23)+m|0)<<13|o>>>19)+a|0)<<18|o>>>14,w^=(o=(g^=(o=(l^=(o=(c^=(o=w+g|0)<<7|o>>>25)+w|0)<<9|o>>>23)+c|0)<<13|o>>>19)+l|0)<<18|o>>>14,i^=(o=(c^=(o=(a^=(o=(s^=(o=i+c|0)<<7|o>>>25)+i|0)<<9|o>>>23)+s|0)<<13|o>>>19)+a|0)<<18|o>>>14,h^=(o=(u^=(o=(l^=(o=(p^=(o=h+u|0)<<7|o>>>25)+h|0)<<9|o>>>23)+p|0)<<13|o>>>19)+l|0)<<18|o>>>14,y^=(o=(d^=(o=(f^=(o=(g^=(o=y+d|0)<<7|o>>>25)+y|0)<<9|o>>>23)+g|0)<<13|o>>>19)+f|0)<<18|o>>>14,w^=(o=(m^=(o=(b^=(o=(v^=(o=w+m|0)<<7|o>>>25)+w|0)<<9|o>>>23)+v|0)<<13|o>>>19)+b|0)<<18|o>>>14;t[0]=i>>>0&255,t[1]=i>>>8&255,t[2]=i>>>16&255,t[3]=i>>>24&255,t[4]=h>>>0&255,t[5]=h>>>8&255,t[6]=h>>>16&255,t[7]=h>>>24&255,t[8]=y>>>0&255,t[9]=y>>>8&255,t[10]=y>>>16&255,t[11]=y>>>24&255,t[12]=w>>>0&255,t[13]=w>>>8&255,t[14]=w>>>16&255,t[15]=w>>>24&255,t[16]=p>>>0&255,t[17]=p>>>8&255,t[18]=p>>>16&255,t[19]=p>>>24&255,t[20]=l>>>0&255,t[21]=l>>>8&255,t[22]=l>>>16&255,t[23]=l>>>24&255,t[24]=f>>>0&255,t[25]=f>>>8&255,t[26]=f>>>16&255,t[27]=f>>>24&255,t[28]=d>>>0&255,t[29]=d>>>8&255,t[30]=d>>>16&255,t[31]=d>>>24&255}(t,n,e,r)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function _(t,n,e,r,o,i,s){var a,c,u=new Uint8Array(16),h=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=i[c];for(;o>=64;){for(b(h,u,s,w),c=0;c<64;c++)t[n+c]=e[r+c]^h[c];for(a=1,c=8;c<16;c++)a=a+(255&u[c])|0,u[c]=255&a,a>>>=8;o-=64,n+=64,r+=64}if(o>0)for(b(h,u,s,w),c=0;c<o;c++)t[n+c]=e[r+c]^h[c];return 0}function S(t,n,e,r,o){var i,s,a=new Uint8Array(16),c=new Uint8Array(64);for(s=0;s<16;s++)a[s]=0;for(s=0;s<8;s++)a[s]=r[s];for(;e>=64;){for(b(c,a,o,w),s=0;s<64;s++)t[n+s]=c[s];for(i=1,s=8;s<16;s++)i=i+(255&a[s])|0,a[s]=255&i,i>>>=8;e-=64,n+=64}if(e>0)for(b(c,a,o,w),s=0;s<e;s++)t[n+s]=c[s];return 0}function k(t,n,e,r,o){var i=new Uint8Array(32);m(i,r,o,w);for(var s=new Uint8Array(8),a=0;a<8;a++)s[a]=r[a+16];return S(t,n,e,s,i)}function C(t,n,e,r,o,i,s){var a=new Uint8Array(32);m(a,i,s,w);for(var c=new Uint8Array(8),u=0;u<8;u++)c[u]=i[u+16];return _(t,n,e,r,o,c,a)}var T=function(t){var n,e,r,o,i,s,a,c;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,n=255&t[0]|(255&t[1])<<8,this.r[0]=8191&n,e=255&t[2]|(255&t[3])<<8,this.r[1]=8191&(n>>>13|e<<3),r=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(e>>>10|r<<6),o=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(r>>>7|o<<9),i=255&t[8]|(255&t[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,s=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(i>>>14|s<<2),a=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(s>>>11|a<<5),c=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(a>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};function P(t,n,e,r,o,i){var s=new T(i);return s.update(e,r,o),s.finish(t,n),0}function O(t,n,e,r,o,i){var s=new Uint8Array(16);return P(s,0,e,r,o,i),g(t,n,s,0)}function A(t,n,e,r,o){var i;if(e<32)return-1;for(C(t,0,n,0,e,r,o),P(t,16,t,32,e-32,t),i=0;i<16;i++)t[i]=0;return 0}function E(t,n,e,r,o){var i,s=new Uint8Array(32);if(e<32)return-1;if(k(s,0,32,r,o),0!==O(n,16,n,32,e-32,s))return-1;for(C(t,0,n,0,e,r,o),i=0;i<32;i++)t[i]=0;return 0}function x(t,n){var e;for(e=0;e<16;e++)t[e]=0|n[e]}function L(t){var n,e,r=1;for(n=0;n<16;n++)e=t[n]+r+65535,r=Math.floor(e/65536),t[n]=e-65536*r;t[0]+=r-1+37*(r-1)}function U(t,n,e){for(var r,o=~(e-1),i=0;i<16;i++)r=o&(t[i]^n[i]),t[i]^=r,n[i]^=r}function R(t,e){var r,o,i,s=n(),a=n();for(r=0;r<16;r++)a[r]=e[r];for(L(a),L(a),L(a),o=0;o<2;o++){for(s[0]=a[0]-65517,r=1;r<15;r++)s[r]=a[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),i=s[15]>>16&1,s[14]&=65535,U(a,s,1-i)}for(r=0;r<16;r++)t[2*r]=255&a[r],t[2*r+1]=a[r]>>8}function j(t,n){var e=new Uint8Array(32),r=new Uint8Array(32);return R(e,t),R(r,n),v(e,0,r,0)}function M(t){var n=new Uint8Array(32);return R(n,t),1&n[0]}function I(t,n){var e;for(e=0;e<16;e++)t[e]=n[2*e]+(n[2*e+1]<<8);t[15]&=32767}function N(t,n,e){for(var r=0;r<16;r++)t[r]=n[r]+e[r]}function D(t,n,e){for(var r=0;r<16;r++)t[r]=n[r]-e[r]}function B(t,n,e){var r,o,i=0,s=0,a=0,c=0,u=0,h=0,p=0,l=0,f=0,d=0,y=0,g=0,v=0,b=0,m=0,w=0,_=0,S=0,k=0,C=0,T=0,P=0,O=0,A=0,E=0,x=0,L=0,U=0,R=0,j=0,M=0,I=e[0],N=e[1],D=e[2],B=e[3],H=e[4],z=e[5],q=e[6],F=e[7],X=e[8],J=e[9],Y=e[10],K=e[11],W=e[12],G=e[13],V=e[14],Z=e[15];i+=(r=n[0])*I,s+=r*N,a+=r*D,c+=r*B,u+=r*H,h+=r*z,p+=r*q,l+=r*F,f+=r*X,d+=r*J,y+=r*Y,g+=r*K,v+=r*W,b+=r*G,m+=r*V,w+=r*Z,s+=(r=n[1])*I,a+=r*N,c+=r*D,u+=r*B,h+=r*H,p+=r*z,l+=r*q,f+=r*F,d+=r*X,y+=r*J,g+=r*Y,v+=r*K,b+=r*W,m+=r*G,w+=r*V,_+=r*Z,a+=(r=n[2])*I,c+=r*N,u+=r*D,h+=r*B,p+=r*H,l+=r*z,f+=r*q,d+=r*F,y+=r*X,g+=r*J,v+=r*Y,b+=r*K,m+=r*W,w+=r*G,_+=r*V,S+=r*Z,c+=(r=n[3])*I,u+=r*N,h+=r*D,p+=r*B,l+=r*H,f+=r*z,d+=r*q,y+=r*F,g+=r*X,v+=r*J,b+=r*Y,m+=r*K,w+=r*W,_+=r*G,S+=r*V,k+=r*Z,u+=(r=n[4])*I,h+=r*N,p+=r*D,l+=r*B,f+=r*H,d+=r*z,y+=r*q,g+=r*F,v+=r*X,b+=r*J,m+=r*Y,w+=r*K,_+=r*W,S+=r*G,k+=r*V,C+=r*Z,h+=(r=n[5])*I,p+=r*N,l+=r*D,f+=r*B,d+=r*H,y+=r*z,g+=r*q,v+=r*F,b+=r*X,m+=r*J,w+=r*Y,_+=r*K,S+=r*W,k+=r*G,C+=r*V,T+=r*Z,p+=(r=n[6])*I,l+=r*N,f+=r*D,d+=r*B,y+=r*H,g+=r*z,v+=r*q,b+=r*F,m+=r*X,w+=r*J,_+=r*Y,S+=r*K,k+=r*W,C+=r*G,T+=r*V,P+=r*Z,l+=(r=n[7])*I,f+=r*N,d+=r*D,y+=r*B,g+=r*H,v+=r*z,b+=r*q,m+=r*F,w+=r*X,_+=r*J,S+=r*Y,k+=r*K,C+=r*W,T+=r*G,P+=r*V,O+=r*Z,f+=(r=n[8])*I,d+=r*N,y+=r*D,g+=r*B,v+=r*H,b+=r*z,m+=r*q,w+=r*F,_+=r*X,S+=r*J,k+=r*Y,C+=r*K,T+=r*W,P+=r*G,O+=r*V,A+=r*Z,d+=(r=n[9])*I,y+=r*N,g+=r*D,v+=r*B,b+=r*H,m+=r*z,w+=r*q,_+=r*F,S+=r*X,k+=r*J,C+=r*Y,T+=r*K,P+=r*W,O+=r*G,A+=r*V,E+=r*Z,y+=(r=n[10])*I,g+=r*N,v+=r*D,b+=r*B,m+=r*H,w+=r*z,_+=r*q,S+=r*F,k+=r*X,C+=r*J,T+=r*Y,P+=r*K,O+=r*W,A+=r*G,E+=r*V,x+=r*Z,g+=(r=n[11])*I,v+=r*N,b+=r*D,m+=r*B,w+=r*H,_+=r*z,S+=r*q,k+=r*F,C+=r*X,T+=r*J,P+=r*Y,O+=r*K,A+=r*W,E+=r*G,x+=r*V,L+=r*Z,v+=(r=n[12])*I,b+=r*N,m+=r*D,w+=r*B,_+=r*H,S+=r*z,k+=r*q,C+=r*F,T+=r*X,P+=r*J,O+=r*Y,A+=r*K,E+=r*W,x+=r*G,L+=r*V,U+=r*Z,b+=(r=n[13])*I,m+=r*N,w+=r*D,_+=r*B,S+=r*H,k+=r*z,C+=r*q,T+=r*F,P+=r*X,O+=r*J,A+=r*Y,E+=r*K,x+=r*W,L+=r*G,U+=r*V,R+=r*Z,m+=(r=n[14])*I,w+=r*N,_+=r*D,S+=r*B,k+=r*H,C+=r*z,T+=r*q,P+=r*F,O+=r*X,A+=r*J,E+=r*Y,x+=r*K,L+=r*W,U+=r*G,R+=r*V,j+=r*Z,w+=(r=n[15])*I,s+=38*(S+=r*D),a+=38*(k+=r*B),c+=38*(C+=r*H),u+=38*(T+=r*z),h+=38*(P+=r*q),p+=38*(O+=r*F),l+=38*(A+=r*X),f+=38*(E+=r*J),d+=38*(x+=r*Y),y+=38*(L+=r*K),g+=38*(U+=r*W),v+=38*(R+=r*G),b+=38*(j+=r*V),m+=38*(M+=r*Z),i=(r=(i+=38*(_+=r*N))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),w=(r=w+o+65535)-65536*(o=Math.floor(r/65536)),i=(r=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),w=(r=w+o+65535)-65536*(o=Math.floor(r/65536)),i+=o-1+37*(o-1),t[0]=i,t[1]=s,t[2]=a,t[3]=c,t[4]=u,t[5]=h,t[6]=p,t[7]=l,t[8]=f,t[9]=d,t[10]=y,t[11]=g,t[12]=v,t[13]=b,t[14]=m,t[15]=w}function H(t,n){B(t,n,n)}function z(t,e){var r,o=n();for(r=0;r<16;r++)o[r]=e[r];for(r=253;r>=0;r--)H(o,o),2!==r&&4!==r&&B(o,o,e);for(r=0;r<16;r++)t[r]=o[r]}function q(t,e){var r,o=n();for(r=0;r<16;r++)o[r]=e[r];for(r=250;r>=0;r--)H(o,o),1!==r&&B(o,o,e);for(r=0;r<16;r++)t[r]=o[r]}function F(t,e,r){var o,i,s=new Uint8Array(32),a=new Float64Array(80),u=n(),h=n(),p=n(),l=n(),f=n(),d=n();for(i=0;i<31;i++)s[i]=e[i];for(s[31]=127&e[31]|64,s[0]&=248,I(a,r),i=0;i<16;i++)h[i]=a[i],l[i]=u[i]=p[i]=0;for(u[0]=l[0]=1,i=254;i>=0;--i)U(u,h,o=s[i>>>3]>>>(7&i)&1),U(p,l,o),N(f,u,p),D(u,u,p),N(p,h,l),D(h,h,l),H(l,f),H(d,u),B(u,p,u),B(p,h,f),N(f,u,p),D(u,u,p),H(h,u),D(p,l,d),B(u,p,c),N(u,u,l),B(p,p,u),B(u,l,d),B(l,h,a),H(h,f),U(u,h,o),U(p,l,o);for(i=0;i<16;i++)a[i+16]=u[i],a[i+32]=p[i],a[i+48]=h[i],a[i+64]=l[i];var y=a.subarray(32),g=a.subarray(16);return z(y,y),B(g,g,y),R(t,g),0}function X(t,n){return F(t,n,i)}function J(t,n){return r(n,32),X(t,n)}function Y(t,n,e){var r=new Uint8Array(32);return F(r,e,n),m(t,o,r,w)}T.prototype.blocks=function(t,n,e){for(var r,o,i,s,a,c,u,h,p,l,f,d,y,g,v,b,m,w,_,S=this.fin?0:2048,k=this.h[0],C=this.h[1],T=this.h[2],P=this.h[3],O=this.h[4],A=this.h[5],E=this.h[6],x=this.h[7],L=this.h[8],U=this.h[9],R=this.r[0],j=this.r[1],M=this.r[2],I=this.r[3],N=this.r[4],D=this.r[5],B=this.r[6],H=this.r[7],z=this.r[8],q=this.r[9];e>=16;)l=p=0,l+=(k+=8191&(r=255&t[n+0]|(255&t[n+1])<<8))*R,l+=(C+=8191&(r>>>13|(o=255&t[n+2]|(255&t[n+3])<<8)<<3))*(5*q),l+=(T+=8191&(o>>>10|(i=255&t[n+4]|(255&t[n+5])<<8)<<6))*(5*z),l+=(P+=8191&(i>>>7|(s=255&t[n+6]|(255&t[n+7])<<8)<<9))*(5*H),p=(l+=(O+=8191&(s>>>4|(a=255&t[n+8]|(255&t[n+9])<<8)<<12))*(5*B))>>>13,l&=8191,l+=(A+=a>>>1&8191)*(5*D),l+=(E+=8191&(a>>>14|(c=255&t[n+10]|(255&t[n+11])<<8)<<2))*(5*N),l+=(x+=8191&(c>>>11|(u=255&t[n+12]|(255&t[n+13])<<8)<<5))*(5*I),l+=(L+=8191&(u>>>8|(h=255&t[n+14]|(255&t[n+15])<<8)<<8))*(5*M),f=p+=(l+=(U+=h>>>5|S)*(5*j))>>>13,f+=k*j,f+=C*R,f+=T*(5*q),f+=P*(5*z),p=(f+=O*(5*H))>>>13,f&=8191,f+=A*(5*B),f+=E*(5*D),f+=x*(5*N),f+=L*(5*I),p+=(f+=U*(5*M))>>>13,f&=8191,d=p,d+=k*M,d+=C*j,d+=T*R,d+=P*(5*q),p=(d+=O*(5*z))>>>13,d&=8191,d+=A*(5*H),d+=E*(5*B),d+=x*(5*D),d+=L*(5*N),y=p+=(d+=U*(5*I))>>>13,y+=k*I,y+=C*M,y+=T*j,y+=P*R,p=(y+=O*(5*q))>>>13,y&=8191,y+=A*(5*z),y+=E*(5*H),y+=x*(5*B),y+=L*(5*D),g=p+=(y+=U*(5*N))>>>13,g+=k*N,g+=C*I,g+=T*M,g+=P*j,p=(g+=O*R)>>>13,g&=8191,g+=A*(5*q),g+=E*(5*z),g+=x*(5*H),g+=L*(5*B),v=p+=(g+=U*(5*D))>>>13,v+=k*D,v+=C*N,v+=T*I,v+=P*M,p=(v+=O*j)>>>13,v&=8191,v+=A*R,v+=E*(5*q),v+=x*(5*z),v+=L*(5*H),b=p+=(v+=U*(5*B))>>>13,b+=k*B,b+=C*D,b+=T*N,b+=P*I,p=(b+=O*M)>>>13,b&=8191,b+=A*j,b+=E*R,b+=x*(5*q),b+=L*(5*z),m=p+=(b+=U*(5*H))>>>13,m+=k*H,m+=C*B,m+=T*D,m+=P*N,p=(m+=O*I)>>>13,m&=8191,m+=A*M,m+=E*j,m+=x*R,m+=L*(5*q),w=p+=(m+=U*(5*z))>>>13,w+=k*z,w+=C*H,w+=T*B,w+=P*D,p=(w+=O*N)>>>13,w&=8191,w+=A*I,w+=E*M,w+=x*j,w+=L*R,_=p+=(w+=U*(5*q))>>>13,_+=k*q,_+=C*z,_+=T*H,_+=P*B,p=(_+=O*D)>>>13,_&=8191,_+=A*N,_+=E*I,_+=x*M,_+=L*j,k=l=8191&(p=(p=((p+=(_+=U*R)>>>13)<<2)+p|0)+(l&=8191)|0),C=f+=p>>>=13,T=d&=8191,P=y&=8191,O=g&=8191,A=v&=8191,E=b&=8191,x=m&=8191,L=w&=8191,U=_&=8191,n+=16,e-=16;this.h[0]=k,this.h[1]=C,this.h[2]=T,this.h[3]=P,this.h[4]=O,this.h[5]=A,this.h[6]=E,this.h[7]=x,this.h[8]=L,this.h[9]=U},T.prototype.finish=function(t,n){var e,r,o,i,s=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(e=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=e,e=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*e,e=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=e,e=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=e,s[0]=this.h[0]+5,e=s[0]>>>13,s[0]&=8191,i=1;i<10;i++)s[i]=this.h[i]+e,e=s[i]>>>13,s[i]&=8191;for(s[9]-=8192,r=(1^e)-1,i=0;i<10;i++)s[i]&=r;for(r=~r,i=0;i<10;i++)this.h[i]=this.h[i]&r|s[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;t[n+0]=this.h[0]>>>0&255,t[n+1]=this.h[0]>>>8&255,t[n+2]=this.h[1]>>>0&255,t[n+3]=this.h[1]>>>8&255,t[n+4]=this.h[2]>>>0&255,t[n+5]=this.h[2]>>>8&255,t[n+6]=this.h[3]>>>0&255,t[n+7]=this.h[3]>>>8&255,t[n+8]=this.h[4]>>>0&255,t[n+9]=this.h[4]>>>8&255,t[n+10]=this.h[5]>>>0&255,t[n+11]=this.h[5]>>>8&255,t[n+12]=this.h[6]>>>0&255,t[n+13]=this.h[6]>>>8&255,t[n+14]=this.h[7]>>>0&255,t[n+15]=this.h[7]>>>8&255},T.prototype.update=function(t,n,e){var r,o;if(this.leftover){for((o=16-this.leftover)>e&&(o=e),r=0;r<o;r++)this.buffer[this.leftover+r]=t[n+r];if(e-=o,n+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(e>=16&&(o=e-e%16,this.blocks(t,n,o),n+=o,e-=o),e){for(r=0;r<e;r++)this.buffer[this.leftover+r]=t[n+r];this.leftover+=e}};var K=A,W=E;var G=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function V(t,n,e,r){for(var o,i,s,a,c,u,h,p,l,f,d,y,g,v,b,m,w,_,S,k,C,T,P,O,A,E,x=new Int32Array(16),L=new Int32Array(16),U=t[0],R=t[1],j=t[2],M=t[3],I=t[4],N=t[5],D=t[6],B=t[7],H=n[0],z=n[1],q=n[2],F=n[3],X=n[4],J=n[5],Y=n[6],K=n[7],W=0;r>=128;){for(S=0;S<16;S++)k=8*S+W,x[S]=e[k+0]<<24|e[k+1]<<16|e[k+2]<<8|e[k+3],L[S]=e[k+4]<<24|e[k+5]<<16|e[k+6]<<8|e[k+7];for(S=0;S<80;S++)if(o=U,i=R,s=j,a=M,c=I,u=N,h=D,B,l=H,f=z,d=q,y=F,g=X,v=J,b=Y,K,P=65535&(T=K),O=T>>>16,A=65535&(C=B),E=C>>>16,P+=65535&(T=(X>>>14|I<<18)^(X>>>18|I<<14)^(I>>>9|X<<23)),O+=T>>>16,A+=65535&(C=(I>>>14|X<<18)^(I>>>18|X<<14)^(X>>>9|I<<23)),E+=C>>>16,P+=65535&(T=X&J^~X&Y),O+=T>>>16,A+=65535&(C=I&N^~I&D),E+=C>>>16,P+=65535&(T=G[2*S+1]),O+=T>>>16,A+=65535&(C=G[2*S]),E+=C>>>16,C=x[S%16],O+=(T=L[S%16])>>>16,A+=65535&C,E+=C>>>16,A+=(O+=(P+=65535&T)>>>16)>>>16,P=65535&(T=_=65535&P|O<<16),O=T>>>16,A=65535&(C=w=65535&A|(E+=A>>>16)<<16),E=C>>>16,P+=65535&(T=(H>>>28|U<<4)^(U>>>2|H<<30)^(U>>>7|H<<25)),O+=T>>>16,A+=65535&(C=(U>>>28|H<<4)^(H>>>2|U<<30)^(H>>>7|U<<25)),E+=C>>>16,O+=(T=H&z^H&q^z&q)>>>16,A+=65535&(C=U&R^U&j^R&j),E+=C>>>16,p=65535&(A+=(O+=(P+=65535&T)>>>16)>>>16)|(E+=A>>>16)<<16,m=65535&P|O<<16,P=65535&(T=y),O=T>>>16,A=65535&(C=a),E=C>>>16,O+=(T=_)>>>16,A+=65535&(C=w),E+=C>>>16,R=o,j=i,M=s,I=a=65535&(A+=(O+=(P+=65535&T)>>>16)>>>16)|(E+=A>>>16)<<16,N=c,D=u,B=h,U=p,z=l,q=f,F=d,X=y=65535&P|O<<16,J=g,Y=v,K=b,H=m,S%16==15)for(k=0;k<16;k++)C=x[k],P=65535&(T=L[k]),O=T>>>16,A=65535&C,E=C>>>16,C=x[(k+9)%16],P+=65535&(T=L[(k+9)%16]),O+=T>>>16,A+=65535&C,E+=C>>>16,w=x[(k+1)%16],P+=65535&(T=((_=L[(k+1)%16])>>>1|w<<31)^(_>>>8|w<<24)^(_>>>7|w<<25)),O+=T>>>16,A+=65535&(C=(w>>>1|_<<31)^(w>>>8|_<<24)^w>>>7),E+=C>>>16,w=x[(k+14)%16],O+=(T=((_=L[(k+14)%16])>>>19|w<<13)^(w>>>29|_<<3)^(_>>>6|w<<26))>>>16,A+=65535&(C=(w>>>19|_<<13)^(_>>>29|w<<3)^w>>>6),E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,x[k]=65535&A|E<<16,L[k]=65535&P|O<<16;P=65535&(T=H),O=T>>>16,A=65535&(C=U),E=C>>>16,C=t[0],O+=(T=n[0])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[0]=U=65535&A|E<<16,n[0]=H=65535&P|O<<16,P=65535&(T=z),O=T>>>16,A=65535&(C=R),E=C>>>16,C=t[1],O+=(T=n[1])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[1]=R=65535&A|E<<16,n[1]=z=65535&P|O<<16,P=65535&(T=q),O=T>>>16,A=65535&(C=j),E=C>>>16,C=t[2],O+=(T=n[2])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[2]=j=65535&A|E<<16,n[2]=q=65535&P|O<<16,P=65535&(T=F),O=T>>>16,A=65535&(C=M),E=C>>>16,C=t[3],O+=(T=n[3])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[3]=M=65535&A|E<<16,n[3]=F=65535&P|O<<16,P=65535&(T=X),O=T>>>16,A=65535&(C=I),E=C>>>16,C=t[4],O+=(T=n[4])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[4]=I=65535&A|E<<16,n[4]=X=65535&P|O<<16,P=65535&(T=J),O=T>>>16,A=65535&(C=N),E=C>>>16,C=t[5],O+=(T=n[5])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[5]=N=65535&A|E<<16,n[5]=J=65535&P|O<<16,P=65535&(T=Y),O=T>>>16,A=65535&(C=D),E=C>>>16,C=t[6],O+=(T=n[6])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[6]=D=65535&A|E<<16,n[6]=Y=65535&P|O<<16,P=65535&(T=K),O=T>>>16,A=65535&(C=B),E=C>>>16,C=t[7],O+=(T=n[7])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[7]=B=65535&A|E<<16,n[7]=K=65535&P|O<<16,W+=128,r-=128}return r}function Z(t,n,e){var r,o=new Int32Array(8),i=new Int32Array(8),s=new Uint8Array(256),a=e;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,V(o,i,n,e),e%=128,r=0;r<e;r++)s[r]=n[a-e+r];for(s[e]=128,s[(e=256-128*(e<112?1:0))-9]=0,d(s,e-8,a/536870912|0,a<<3),V(o,i,s,e),r=0;r<8;r++)d(t,8*r,o[r],i[r]);return 0}function Q(t,e){var r=n(),o=n(),i=n(),s=n(),a=n(),c=n(),u=n(),p=n(),l=n();D(r,t[1],t[0]),D(l,e[1],e[0]),B(r,r,l),N(o,t[0],t[1]),N(l,e[0],e[1]),B(o,o,l),B(i,t[3],e[3]),B(i,i,h),B(s,t[2],e[2]),N(s,s,s),D(a,o,r),D(c,s,i),N(u,s,i),N(p,o,r),B(t[0],a,c),B(t[1],p,u),B(t[2],u,c),B(t[3],a,p)}function $(t,n,e){var r;for(r=0;r<4;r++)U(t[r],n[r],e)}function tt(t,e){var r=n(),o=n(),i=n();z(i,e[2]),B(r,e[0],i),B(o,e[1],i),R(t,o),t[31]^=M(r)<<7}function nt(t,n,e){var r,o;for(x(t[0],s),x(t[1],a),x(t[2],a),x(t[3],s),o=255;o>=0;--o)$(t,n,r=e[o/8|0]>>(7&o)&1),Q(n,t),Q(t,t),$(t,n,r)}function et(t,e){var r=[n(),n(),n(),n()];x(r[0],p),x(r[1],l),x(r[2],a),B(r[3],p,l),nt(t,r,e)}function rt(t,e,o){var i,s=new Uint8Array(64),a=[n(),n(),n(),n()];for(o||r(e,32),Z(s,e,32),s[0]&=248,s[31]&=127,s[31]|=64,et(a,s),tt(t,a),i=0;i<32;i++)e[i+32]=t[i];return 0}var ot=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function it(t,n){var e,r,o,i;for(r=63;r>=32;--r){for(e=0,o=r-32,i=r-12;o<i;++o)n[o]+=e-16*n[r]*ot[o-(r-32)],e=Math.floor((n[o]+128)/256),n[o]-=256*e;n[o]+=e,n[r]=0}for(e=0,o=0;o<32;o++)n[o]+=e-(n[31]>>4)*ot[o],e=n[o]>>8,n[o]&=255;for(o=0;o<32;o++)n[o]-=e*ot[o];for(r=0;r<32;r++)n[r+1]+=n[r]>>8,t[r]=255&n[r]}function st(t){var n,e=new Float64Array(64);for(n=0;n<64;n++)e[n]=t[n];for(n=0;n<64;n++)t[n]=0;it(t,e)}function at(t,e,r,o){var i,s,a=new Uint8Array(64),c=new Uint8Array(64),u=new Uint8Array(64),h=new Float64Array(64),p=[n(),n(),n(),n()];Z(a,o,32),a[0]&=248,a[31]&=127,a[31]|=64;var l=r+64;for(i=0;i<r;i++)t[64+i]=e[i];for(i=0;i<32;i++)t[32+i]=a[32+i];for(Z(u,t.subarray(32),r+32),st(u),et(p,u),tt(t,p),i=32;i<64;i++)t[i]=o[i];for(Z(c,t,r+64),st(c),i=0;i<64;i++)h[i]=0;for(i=0;i<32;i++)h[i]=u[i];for(i=0;i<32;i++)for(s=0;s<32;s++)h[i+s]+=c[i]*a[s];return it(t.subarray(32),h),l}function ct(t,e,r,o){var i,c=new Uint8Array(32),h=new Uint8Array(64),p=[n(),n(),n(),n()],l=[n(),n(),n(),n()];if(r<64)return-1;if(function(t,e){var r=n(),o=n(),i=n(),c=n(),h=n(),p=n(),l=n();return x(t[2],a),I(t[1],e),H(i,t[1]),B(c,i,u),D(i,i,t[2]),N(c,t[2],c),H(h,c),H(p,h),B(l,p,h),B(r,l,i),B(r,r,c),q(r,r),B(r,r,i),B(r,r,c),B(r,r,c),B(t[0],r,c),H(o,t[0]),B(o,o,c),j(o,i)&&B(t[0],t[0],f),H(o,t[0]),B(o,o,c),j(o,i)?-1:(M(t[0])===e[31]>>7&&D(t[0],s,t[0]),B(t[3],t[0],t[1]),0)}(l,o))return-1;for(i=0;i<r;i++)t[i]=e[i];for(i=0;i<32;i++)t[i+32]=o[i];if(Z(h,t,r),st(h),nt(p,l,h),et(l,e.subarray(32)),Q(p,l),tt(c,p),r-=64,v(e,0,c,0)){for(i=0;i<r;i++)t[i]=0;return-1}for(i=0;i<r;i++)t[i]=e[i+64];return r}function ut(t,n){if(32!==t.length)throw new Error("bad key size");if(24!==n.length)throw new Error("bad nonce size")}function ht(){for(var t=0;t<arguments.length;t++)if(!(arguments[t]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function pt(t){for(var n=0;n<t.length;n++)t[n]=0}t.lowlevel={crypto_core_hsalsa20:m,crypto_stream_xor:C,crypto_stream:k,crypto_stream_salsa20_xor:_,crypto_stream_salsa20:S,crypto_onetimeauth:P,crypto_onetimeauth_verify:O,crypto_verify_16:g,crypto_verify_32:v,crypto_secretbox:A,crypto_secretbox_open:E,crypto_scalarmult:F,crypto_scalarmult_base:X,crypto_box_beforenm:Y,crypto_box_afternm:K,crypto_box:function(t,n,e,r,o,i){var s=new Uint8Array(32);return Y(s,o,i),K(t,n,e,r,s)},crypto_box_open:function(t,n,e,r,o,i){var s=new Uint8Array(32);return Y(s,o,i),W(t,n,e,r,s)},crypto_box_keypair:J,crypto_hash:Z,crypto_sign:at,crypto_sign_keypair:rt,crypto_sign_open:ct,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:64,crypto_sign_PUBLICKEYBYTES:32,crypto_sign_SECRETKEYBYTES:64,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:n,D:u,L:ot,pack25519:R,unpack25519:I,M:B,A:N,S:H,Z:D,pow2523:q,add:Q,set25519:x,modL:it,scalarmult:nt,scalarbase:et},t.randomBytes=function(t){var n=new Uint8Array(t);return r(n,t),n},t.secretbox=function(t,n,e){ht(t,n,e),ut(e,n);for(var r=new Uint8Array(32+t.length),o=new Uint8Array(r.length),i=0;i<t.length;i++)r[i+32]=t[i];return A(o,r,r.length,n,e),o.subarray(16)},t.secretbox.open=function(t,n,e){ht(t,n,e),ut(e,n);for(var r=new Uint8Array(16+t.length),o=new Uint8Array(r.length),i=0;i<t.length;i++)r[i+16]=t[i];return r.length<32||0!==E(o,r,r.length,n,e)?null:o.subarray(32)},t.secretbox.keyLength=32,t.secretbox.nonceLength=24,t.secretbox.overheadLength=16,t.scalarMult=function(t,n){if(ht(t,n),32!==t.length)throw new Error("bad n size");if(32!==n.length)throw new Error("bad p size");var e=new Uint8Array(32);return F(e,t,n),e},t.scalarMult.base=function(t){if(ht(t),32!==t.length)throw new Error("bad n size");var n=new Uint8Array(32);return X(n,t),n},t.scalarMult.scalarLength=32,t.scalarMult.groupElementLength=32,t.box=function(n,e,r,o){var i=t.box.before(r,o);return t.secretbox(n,e,i)},t.box.before=function(t,n){ht(t,n),function(t,n){if(32!==t.length)throw new Error("bad public key size");if(32!==n.length)throw new Error("bad secret key size")}(t,n);var e=new Uint8Array(32);return Y(e,t,n),e},t.box.after=t.secretbox,t.box.open=function(n,e,r,o){var i=t.box.before(r,o);return t.secretbox.open(n,e,i)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var t=new Uint8Array(32),n=new Uint8Array(32);return J(t,n),{publicKey:t,secretKey:n}},t.box.keyPair.fromSecretKey=function(t){if(ht(t),32!==t.length)throw new Error("bad secret key size");var n=new Uint8Array(32);return X(n,t),{publicKey:n,secretKey:new Uint8Array(t)}},t.box.publicKeyLength=32,t.box.secretKeyLength=32,t.box.sharedKeyLength=32,t.box.nonceLength=24,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(t,n){if(ht(t,n),64!==n.length)throw new Error("bad secret key size");var e=new Uint8Array(64+t.length);return at(e,t,t.length,n),e},t.sign.open=function(t,n){if(ht(t,n),32!==n.length)throw new Error("bad public key size");var e=new Uint8Array(t.length),r=ct(e,t,t.length,n);if(r<0)return null;for(var o=new Uint8Array(r),i=0;i<o.length;i++)o[i]=e[i];return o},t.sign.detached=function(n,e){for(var r=t.sign(n,e),o=new Uint8Array(64),i=0;i<o.length;i++)o[i]=r[i];return o},t.sign.detached.verify=function(t,n,e){if(ht(t,n,e),64!==n.length)throw new Error("bad signature size");if(32!==e.length)throw new Error("bad public key size");var r,o=new Uint8Array(64+t.length),i=new Uint8Array(64+t.length);for(r=0;r<64;r++)o[r]=n[r];for(r=0;r<t.length;r++)o[r+64]=t[r];return ct(i,o,o.length,e)>=0},t.sign.keyPair=function(){var t=new Uint8Array(32),n=new Uint8Array(64);return rt(t,n),{publicKey:t,secretKey:n}},t.sign.keyPair.fromSecretKey=function(t){if(ht(t),64!==t.length)throw new Error("bad secret key size");for(var n=new Uint8Array(32),e=0;e<n.length;e++)n[e]=t[32+e];return{publicKey:n,secretKey:new Uint8Array(t)}},t.sign.keyPair.fromSeed=function(t){if(ht(t),32!==t.length)throw new Error("bad seed size");for(var n=new Uint8Array(32),e=new Uint8Array(64),r=0;r<32;r++)e[r]=t[r];return rt(n,e,!0),{publicKey:n,secretKey:e}},t.sign.publicKeyLength=32,t.sign.secretKeyLength=64,t.sign.seedLength=32,t.sign.signatureLength=64,t.hash=function(t){ht(t);var n=new Uint8Array(64);return Z(n,t,t.length),n},t.hash.hashLength=64,t.verify=function(t,n){return ht(t,n),0!==t.length&&0!==n.length&&(t.length===n.length&&0===y(t,0,n,0,t.length))},t.setPRNG=function(t){r=t},function(){var n="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(n&&n.getRandomValues){t.setPRNG((function(t,e){var r,o=new Uint8Array(e);for(r=0;r<e;r+=65536)n.getRandomValues(o.subarray(r,r+Math.min(e-r,65536)));for(r=0;r<e;r++)t[r]=o[r];pt(o)}))}else(n=e(4))&&n.randomBytes&&t.setPRNG((function(t,e){var r,o=n.randomBytes(e);for(r=0;r<e;r++)t[r]=o[r];pt(o)}))}()}(t.exports?t.exports:self.nacl=self.nacl||{})},function(t,n,e){t.exports=e(5).default},function(t,n){},function(t,n,e){"use strict";e.r(n);var r,o=function(){function t(t,n){this.lastId=0,this.prefix=t,this.name=n}return t.prototype.create=function(t){this.lastId++;var n=this.lastId,e=this.prefix+n,r=this.name+"["+n+"]",o=!1,i=function(){o||(t.apply(null,arguments),o=!0)};return this[n]=i,{number:n,id:e,name:r,callback:i}},t.prototype.remove=function(t){delete this[t.number]},t}(),i=new o("_pusher_script_","Pusher.ScriptReceivers"),s={VERSION:"7.3.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,cluster:"mt1",userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},a=function(){function t(t){this.options=t,this.receivers=t.receivers||i,this.loading={}}return t.prototype.load=function(t,n,e){var r=this;if(r.loading[t]&&r.loading[t].length>0)r.loading[t].push(e);else{r.loading[t]=[e];var o=kn.createScriptRequest(r.getPath(t,n)),i=r.receivers.create((function(n){if(r.receivers.remove(i),r.loading[t]){var e=r.loading[t];delete r.loading[t];for(var s=function(t){t||o.cleanup()},a=0;a<e.length;a++)e[a](n,s)}}));o.send(i)}},t.prototype.getRoot=function(t){var n=kn.getDocument().location.protocol;return(t&&t.useTLS||"https:"===n?this.options.cdn_https:this.options.cdn_http).replace(/\/*$/,"")+"/"+this.options.version},t.prototype.getPath=function(t,n){return this.getRoot(n)+"/"+t+this.options.suffix+".js"},t}(),c=new o("_pusher_dependencies","Pusher.DependenciesReceivers"),u=new a({cdn_http:s.cdn_http,cdn_https:s.cdn_https,version:s.VERSION,suffix:s.dependency_suffix,receivers:c}),h={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},p=function(t){var n,e=h.urls[t];return e?(e.fullUrl?n=e.fullUrl:e.path&&(n=h.baseUrl+e.path),n?"See: "+n:""):""};!function(t){t.UserAuthentication="user-authentication",t.ChannelAuthorization="channel-authorization"}(r||(r={}));var l,f=(l=function(t,n){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)},function(t,n){function e(){this.constructor=t}l(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),d=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return f(n,t),n}(Error),y=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return f(n,t),n}(Error),g=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return f(n,t),n}(Error),v=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return f(n,t),n}(Error),b=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return f(n,t),n}(Error),m=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return f(n,t),n}(Error),w=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return f(n,t),n}(Error),_=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return f(n,t),n}(Error),S=function(t){function n(n,e){var r=this.constructor,o=t.call(this,e)||this;return o.status=n,Object.setPrototypeOf(o,r.prototype),o}return f(n,t),n}(Error),k=function(t,n,e,o,i){var s=kn.createXHR();for(var a in s.open("POST",e.endpoint,!0),s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),e.headers)s.setRequestHeader(a,e.headers[a]);return s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status){var t=void 0,n=!1;try{t=JSON.parse(s.responseText),n=!0}catch(t){i(new S(200,"JSON returned from "+o.toString()+" endpoint was invalid, yet status code was 200. Data was: "+s.responseText),null)}n&&i(null,t)}else{var a="";switch(o){case r.UserAuthentication:a=p("authenticationEndpoint");break;case r.ChannelAuthorization:a="Clients must be authenticated to join private or presence channels. "+p("authorizationEndpoint")}i(new S(s.status,"Unable to retrieve auth string from "+o.toString()+" endpoint - received status: "+s.status+" from "+e.endpoint+". "+a),null)}},s.send(n),s};for(var C=String.fromCharCode,T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",P={},O=0,A=T.length;O<A;O++)P[T.charAt(O)]=O;var E=function(t){var n=t.charCodeAt(0);return n<128?t:n<2048?C(192|n>>>6)+C(128|63&n):C(224|n>>>12&15)+C(128|n>>>6&63)+C(128|63&n)},x=function(t){return t.replace(/[^\x00-\x7F]/g,E)},L=function(t){var n=[0,2,1][t.length%3],e=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[T.charAt(e>>>18),T.charAt(e>>>12&63),n>=2?"=":T.charAt(e>>>6&63),n>=1?"=":T.charAt(63&e)].join("")},U=window.btoa||function(t){return t.replace(/[\s\S]{1,3}/g,L)},R=function(){function t(t,n,e,r){var o=this;this.clear=n,this.timer=t((function(){o.timer&&(o.timer=r(o.timer))}),e)}return t.prototype.isRunning=function(){return null!==this.timer},t.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},t}(),j=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();function M(t){window.clearTimeout(t)}function I(t){window.clearInterval(t)}var N=function(t){function n(n,e){return t.call(this,setTimeout,M,n,(function(t){return e(),null}))||this}return j(n,t),n}(R),D=function(t){function n(n,e){return t.call(this,setInterval,I,n,(function(t){return e(),t}))||this}return j(n,t),n}(R),B={now:function(){return Date.now?Date.now():(new Date).valueOf()},defer:function(t){return new N(0,t)},method:function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var r=Array.prototype.slice.call(arguments,1);return function(n){return n[t].apply(n,r.concat(arguments))}}};function H(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];for(var r=0;r<n.length;r++){var o=n[r];for(var i in o)o[i]&&o[i].constructor&&o[i].constructor===Object?t[i]=H(t[i]||{},o[i]):t[i]=o[i]}return t}function z(){for(var t=["Pusher"],n=0;n<arguments.length;n++)"string"==typeof arguments[n]?t.push(arguments[n]):t.push(Q(arguments[n]));return t.join(" : ")}function q(t,n){var e=Array.prototype.indexOf;if(null===t)return-1;if(e&&t.indexOf===e)return t.indexOf(n);for(var r=0,o=t.length;r<o;r++)if(t[r]===n)return r;return-1}function F(t,n){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&n(t[e],e,t)}function X(t){var n=[];return F(t,(function(t,e){n.push(e)})),n}function J(t,n,e){for(var r=0;r<t.length;r++)n.call(e||window,t[r],r,t)}function Y(t,n){for(var e=[],r=0;r<t.length;r++)e.push(n(t[r],r,t,e));return e}function K(t,n){n=n||function(t){return!!t};for(var e=[],r=0;r<t.length;r++)n(t[r],r,t,e)&&e.push(t[r]);return e}function W(t,n){var e={};return F(t,(function(r,o){(n&&n(r,o,t,e)||Boolean(r))&&(e[o]=r)})),e}function G(t,n){for(var e=0;e<t.length;e++)if(n(t[e],e,t))return!0;return!1}function V(t){return n=function(t){return"object"==typeof t&&(t=Q(t)),encodeURIComponent((n=t.toString(),U(x(n))));var n},e={},F(t,(function(t,r){e[r]=n(t)})),e;var n,e}function Z(t){var n,e,r=W(t,(function(t){return void 0!==t}));return Y((n=V(r),e=[],F(n,(function(t,n){e.push([n,t])})),e),B.method("join","=")).join("&")}function Q(t){try{return JSON.stringify(t)}catch(r){return JSON.stringify((n=[],e=[],function t(r,o){var i,s,a;switch(typeof r){case"object":if(!r)return null;for(i=0;i<n.length;i+=1)if(n[i]===r)return{$ref:e[i]};if(n.push(r),e.push(o),"[object Array]"===Object.prototype.toString.apply(r))for(a=[],i=0;i<r.length;i+=1)a[i]=t(r[i],o+"["+i+"]");else for(s in a={},r)Object.prototype.hasOwnProperty.call(r,s)&&(a[s]=t(r[s],o+"["+JSON.stringify(s)+"]"));return a;case"number":case"string":case"boolean":return r}}(t,"$")))}var n,e}var $=new(function(){function t(){this.globalLog=function(t){window.console&&window.console.log&&window.console.log(t)}}return t.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.log(this.globalLog,t)},t.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.log(this.globalLogWarn,t)},t.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.log(this.globalLogError,t)},t.prototype.globalLogWarn=function(t){window.console&&window.console.warn?window.console.warn(t):this.globalLog(t)},t.prototype.globalLogError=function(t){window.console&&window.console.error?window.console.error(t):this.globalLogWarn(t)},t.prototype.log=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var r=z.apply(this,arguments);if(Xn.log)Xn.log(r);else if(Xn.logToConsole){var o=t.bind(this);o(r)}},t}()),tt=function(t,n,e,r,o){void 0!==e.headers&&$.warn("To send headers with the "+r.toString()+" request, you must use AJAX, rather than JSONP.");var i=t.nextAuthCallbackID.toString();t.nextAuthCallbackID++;var s=t.getDocument(),a=s.createElement("script");t.auth_callbacks[i]=function(t){o(null,t)};var c="Pusher.auth_callbacks['"+i+"']";a.src=e.endpoint+"?callback="+encodeURIComponent(c)+"&"+n;var u=s.getElementsByTagName("head")[0]||s.documentElement;u.insertBefore(a,u.firstChild)},nt=function(){function t(t){this.src=t}return t.prototype.send=function(t){var n=this,e="Error loading "+n.src;n.script=document.createElement("script"),n.script.id=t.id,n.script.src=n.src,n.script.type="text/javascript",n.script.charset="UTF-8",n.script.addEventListener?(n.script.onerror=function(){t.callback(e)},n.script.onload=function(){t.callback(null)}):n.script.onreadystatechange=function(){"loaded"!==n.script.readyState&&"complete"!==n.script.readyState||t.callback(null)},void 0===n.script.async&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(n.errorScript=document.createElement("script"),n.errorScript.id=t.id+"_error",n.errorScript.text=t.name+"('"+e+"');",n.script.async=n.errorScript.async=!1):n.script.async=!0;var r=document.getElementsByTagName("head")[0];r.insertBefore(n.script,r.firstChild),n.errorScript&&r.insertBefore(n.errorScript,n.script.nextSibling)},t.prototype.cleanup=function(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null},t}(),et=function(){function t(t,n){this.url=t,this.data=n}return t.prototype.send=function(t){if(!this.request){var n=Z(this.data),e=this.url+"/"+t.number+"?"+n;this.request=kn.createScriptRequest(e),this.request.send(t)}},t.prototype.cleanup=function(){this.request&&this.request.cleanup()},t}(),rt={name:"jsonp",getAgent:function(t,n){return function(e,r){var o="http"+(n?"s":"")+"://"+(t.host||t.options.host)+t.options.path,s=kn.createJSONPRequest(o,e),a=kn.ScriptReceivers.create((function(n,e){i.remove(a),s.cleanup(),e&&e.host&&(t.host=e.host),r&&r(n,e)}));s.send(a)}}};function ot(t,n,e){return t+(n.useTLS?"s":"")+"://"+(n.useTLS?n.hostTLS:n.hostNonTLS)+e}function it(t,n){return"/app/"+t+("?protocol="+s.PROTOCOL+"&client=js&version="+s.VERSION+(n?"&"+n:""))}var st={getInitial:function(t,n){return ot("ws",n,(n.httpPath||"")+it(t,"flash=false"))}},at={getInitial:function(t,n){return ot("http",n,(n.httpPath||"/pusher")+it(t))}},ct={getInitial:function(t,n){return ot("http",n,n.httpPath||"/pusher")},getPath:function(t,n){return it(t)}},ut=function(){function t(){this._callbacks={}}return t.prototype.get=function(t){return this._callbacks[ht(t)]},t.prototype.add=function(t,n,e){var r=ht(t);this._callbacks[r]=this._callbacks[r]||[],this._callbacks[r].push({fn:n,context:e})},t.prototype.remove=function(t,n,e){if(t||n||e){var r=t?[ht(t)]:X(this._callbacks);n||e?this.removeCallback(r,n,e):this.removeAllCallbacks(r)}else this._callbacks={}},t.prototype.removeCallback=function(t,n,e){J(t,(function(t){this._callbacks[t]=K(this._callbacks[t]||[],(function(t){return n&&n!==t.fn||e&&e!==t.context})),0===this._callbacks[t].length&&delete this._callbacks[t]}),this)},t.prototype.removeAllCallbacks=function(t){J(t,(function(t){delete this._callbacks[t]}),this)},t}();function ht(t){return"_"+t}var pt=function(){function t(t){this.callbacks=new ut,this.global_callbacks=[],this.failThrough=t}return t.prototype.bind=function(t,n,e){return this.callbacks.add(t,n,e),this},t.prototype.bind_global=function(t){return this.global_callbacks.push(t),this},t.prototype.unbind=function(t,n,e){return this.callbacks.remove(t,n,e),this},t.prototype.unbind_global=function(t){return t?(this.global_callbacks=K(this.global_callbacks||[],(function(n){return n!==t})),this):(this.global_callbacks=[],this)},t.prototype.unbind_all=function(){return this.unbind(),this.unbind_global(),this},t.prototype.emit=function(t,n,e){for(var r=0;r<this.global_callbacks.length;r++)this.global_callbacks[r](t,n);var o=this.callbacks.get(t),i=[];if(e?i.push(n,e):n&&i.push(n),o&&o.length>0)for(r=0;r<o.length;r++)o[r].fn.apply(o[r].context||window,i);else this.failThrough&&this.failThrough(t,n);return this},t}(),lt=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),ft=function(t){function n(n,e,r,o,i){var s=t.call(this)||this;return s.initialize=kn.transportConnectionInitializer,s.hooks=n,s.name=e,s.priority=r,s.key=o,s.options=i,s.state="new",s.timeline=i.timeline,s.activityTimeout=i.activityTimeout,s.id=s.timeline.generateUniqueID(),s}return lt(n,t),n.prototype.handlesActivityChecks=function(){return Boolean(this.hooks.handlesActivityChecks)},n.prototype.supportsPing=function(){return Boolean(this.hooks.supportsPing)},n.prototype.connect=function(){var t=this;if(this.socket||"initialized"!==this.state)return!1;var n=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(n,this.options)}catch(n){return B.defer((function(){t.onError(n),t.changeState("closed")})),!1}return this.bindListeners(),$.debug("Connecting",{transport:this.name,url:n}),this.changeState("connecting"),!0},n.prototype.close=function(){return!!this.socket&&(this.socket.close(),!0)},n.prototype.send=function(t){var n=this;return"open"===this.state&&(B.defer((function(){n.socket&&n.socket.send(t)})),!0)},n.prototype.ping=function(){"open"===this.state&&this.supportsPing()&&this.socket.ping()},n.prototype.onOpen=function(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0},n.prototype.onError=function(t){this.emit("error",{type:"WebSocketError",error:t}),this.timeline.error(this.buildTimelineMessage({error:t.toString()}))},n.prototype.onClose=function(t){t?this.changeState("closed",{code:t.code,reason:t.reason,wasClean:t.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0},n.prototype.onMessage=function(t){this.emit("message",t)},n.prototype.onActivity=function(){this.emit("activity")},n.prototype.bindListeners=function(){var t=this;this.socket.onopen=function(){t.onOpen()},this.socket.onerror=function(n){t.onError(n)},this.socket.onclose=function(n){t.onClose(n)},this.socket.onmessage=function(n){t.onMessage(n)},this.supportsPing()&&(this.socket.onactivity=function(){t.onActivity()})},n.prototype.unbindListeners=function(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))},n.prototype.changeState=function(t,n){this.state=t,this.timeline.info(this.buildTimelineMessage({state:t,params:n})),this.emit(t,n)},n.prototype.buildTimelineMessage=function(t){return H({cid:this.id},t)},n}(pt),dt=function(){function t(t){this.hooks=t}return t.prototype.isSupported=function(t){return this.hooks.isSupported(t)},t.prototype.createConnection=function(t,n,e,r){return new ft(this.hooks,t,n,e,r)},t}(),yt=new dt({urls:st,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return Boolean(kn.getWebSocketAPI())},isSupported:function(){return Boolean(kn.getWebSocketAPI())},getSocket:function(t){return kn.createWebSocket(t)}}),gt={urls:at,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},vt=H({getSocket:function(t){return kn.HTTPFactory.createStreamingSocket(t)}},gt),bt=H({getSocket:function(t){return kn.HTTPFactory.createPollingSocket(t)}},gt),mt={isSupported:function(){return kn.isXHRSupported()}},wt={ws:yt,xhr_streaming:new dt(H({},vt,mt)),xhr_polling:new dt(H({},bt,mt))},_t=new dt({file:"sockjs",urls:ct,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return void 0!==window.SockJS},getSocket:function(t,n){return new window.SockJS(t,null,{js_path:u.getPath("sockjs",{useTLS:n.useTLS}),ignore_null_origin:n.ignoreNullOrigin})},beforeOpen:function(t,n){t.send(JSON.stringify({path:n}))}}),St={isSupported:function(t){return kn.isXDRSupported(t.useTLS)}},kt=new dt(H({},vt,St)),Ct=new dt(H({},bt,St));wt.xdr_streaming=kt,wt.xdr_polling=Ct,wt.sockjs=_t;var Tt=wt,Pt=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Ot=new(function(t){function n(){var n=t.call(this)||this,e=n;return void 0!==window.addEventListener&&(window.addEventListener("online",(function(){e.emit("online")}),!1),window.addEventListener("offline",(function(){e.emit("offline")}),!1)),n}return Pt(n,t),n.prototype.isOnline=function(){return void 0===window.navigator.onLine||window.navigator.onLine},n}(pt)),At=function(){function t(t,n,e){this.manager=t,this.transport=n,this.minPingDelay=e.minPingDelay,this.maxPingDelay=e.maxPingDelay,this.pingDelay=void 0}return t.prototype.createConnection=function(t,n,e,r){var o=this;r=H({},r,{activityTimeout:this.pingDelay});var i=this.transport.createConnection(t,n,e,r),s=null,a=function(){i.unbind("open",a),i.bind("closed",c),s=B.now()},c=function(t){if(i.unbind("closed",c),1002===t.code||1003===t.code)o.manager.reportDeath();else if(!t.wasClean&&s){var n=B.now()-s;n<2*o.maxPingDelay&&(o.manager.reportDeath(),o.pingDelay=Math.max(n/2,o.minPingDelay))}};return i.bind("open",a),i},t.prototype.isSupported=function(t){return this.manager.isAlive()&&this.transport.isSupported(t)},t}(),Et={decodeMessage:function(t){try{var n=JSON.parse(t.data),e=n.data;if("string"==typeof e)try{e=JSON.parse(n.data)}catch(t){}var r={event:n.event,channel:n.channel,data:e};return n.user_id&&(r.user_id=n.user_id),r}catch(n){throw{type:"MessageParseError",error:n,data:t.data}}},encodeMessage:function(t){return JSON.stringify(t)},processHandshake:function(t){var n=Et.decodeMessage(t);if("pusher:connection_established"===n.event){if(!n.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:n.data.socket_id,activityTimeout:1e3*n.data.activity_timeout}}if("pusher:error"===n.event)return{action:this.getCloseAction(n.data),error:this.getCloseError(n.data)};throw"Invalid handshake"},getCloseAction:function(t){return t.code<4e3?t.code>=1002&&t.code<=1004?"backoff":null:4e3===t.code?"tls_only":t.code<4100?"refused":t.code<4200?"backoff":t.code<4300?"retry":"refused"},getCloseError:function(t){return 1e3!==t.code&&1001!==t.code?{type:"PusherError",data:{code:t.code,message:t.reason||t.message}}:null}},xt=Et,Lt=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Ut=function(t){function n(n,e){var r=t.call(this)||this;return r.id=n,r.transport=e,r.activityTimeout=e.activityTimeout,r.bindListeners(),r}return Lt(n,t),n.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},n.prototype.send=function(t){return this.transport.send(t)},n.prototype.send_event=function(t,n,e){var r={event:t,data:n};return e&&(r.channel=e),$.debug("Event sent",r),this.send(xt.encodeMessage(r))},n.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},n.prototype.close=function(){this.transport.close()},n.prototype.bindListeners=function(){var t=this,n={message:function(n){var e;try{e=xt.decodeMessage(n)}catch(e){t.emit("error",{type:"MessageParseError",error:e,data:n.data})}if(void 0!==e){switch($.debug("Event recd",e),e.event){case"pusher:error":t.emit("error",{type:"PusherError",data:e.data});break;case"pusher:ping":t.emit("ping");break;case"pusher:pong":t.emit("pong")}t.emit("message",e)}},activity:function(){t.emit("activity")},error:function(n){t.emit("error",n)},closed:function(n){e(),n&&n.code&&t.handleCloseEvent(n),t.transport=null,t.emit("closed")}},e=function(){F(n,(function(n,e){t.transport.unbind(e,n)}))};F(n,(function(n,e){t.transport.bind(e,n)}))},n.prototype.handleCloseEvent=function(t){var n=xt.getCloseAction(t),e=xt.getCloseError(t);e&&this.emit("error",e),n&&this.emit(n,{action:n,error:e})},n}(pt),Rt=function(){function t(t,n){this.transport=t,this.callback=n,this.bindListeners()}return t.prototype.close=function(){this.unbindListeners(),this.transport.close()},t.prototype.bindListeners=function(){var t=this;this.onMessage=function(n){var e;t.unbindListeners();try{e=xt.processHandshake(n)}catch(n){return t.finish("error",{error:n}),void t.transport.close()}"connected"===e.action?t.finish("connected",{connection:new Ut(e.id,t.transport),activityTimeout:e.activityTimeout}):(t.finish(e.action,{error:e.error}),t.transport.close())},this.onClosed=function(n){t.unbindListeners();var e=xt.getCloseAction(n)||"backoff",r=xt.getCloseError(n);t.finish(e,{error:r})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},t.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},t.prototype.finish=function(t,n){this.callback(H({transport:this.transport,action:t},n))},t}(),jt=function(){function t(t,n){this.timeline=t,this.options=n||{}}return t.prototype.send=function(t,n){this.timeline.isEmpty()||this.timeline.send(kn.TimelineTransport.getAgent(this,t),n)},t}(),Mt=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),It=function(t){function n(n,e){var r=t.call(this,(function(t,e){$.debug("No callbacks on "+n+" for "+t)}))||this;return r.name=n,r.pusher=e,r.subscribed=!1,r.subscriptionPending=!1,r.subscriptionCancelled=!1,r}return Mt(n,t),n.prototype.authorize=function(t,n){return n(null,{auth:""})},n.prototype.trigger=function(t,n){if(0!==t.indexOf("client-"))throw new d("Event '"+t+"' does not start with 'client-'");if(!this.subscribed){var e=p("triggeringClientEvents");$.warn("Client event triggered before channel 'subscription_succeeded' event . "+e)}return this.pusher.send_event(t,n,this.name)},n.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},n.prototype.handleEvent=function(t){var n=t.event,e=t.data;if("pusher_internal:subscription_succeeded"===n)this.handleSubscriptionSucceededEvent(t);else if("pusher_internal:subscription_count"===n)this.handleSubscriptionCountEvent(t);else if(0!==n.indexOf("pusher_internal:")){this.emit(n,e,{})}},n.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",t.data)},n.prototype.handleSubscriptionCountEvent=function(t){t.data.subscription_count&&(this.subscriptionCount=t.data.subscription_count),this.emit("pusher:subscription_count",t.data)},n.prototype.subscribe=function(){var t=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(function(n,e){n?(t.subscriptionPending=!1,$.error(n.toString()),t.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:n.message},n instanceof S?{status:n.status}:{}))):t.pusher.send_event("pusher:subscribe",{auth:e.auth,channel_data:e.channel_data,channel:t.name})})))},n.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},n.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},n.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},n}(pt),Nt=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Dt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return Nt(n,t),n.prototype.authorize=function(t,n){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:t},n)},n}(It),Bt=function(){function t(){this.reset()}return t.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null},t.prototype.each=function(t){var n=this;F(this.members,(function(e,r){t(n.get(r))}))},t.prototype.setMyID=function(t){this.myID=t},t.prototype.onSubscription=function(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)},t.prototype.addMember=function(t){return null===this.get(t.user_id)&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)},t.prototype.removeMember=function(t){var n=this.get(t.user_id);return n&&(delete this.members[t.user_id],this.count--),n},t.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},t}(),Ht=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),zt=function(t){function n(n,e){var r=t.call(this,n,e)||this;return r.members=new Bt,r}return Ht(n,t),n.prototype.authorize=function(n,e){var r=this;t.prototype.authorize.call(this,n,(function(t,n){if(!t){if(void 0===(n=n).channel_data){var o=p("authenticationEndpoint");return $.error("Invalid auth response for channel '"+r.name+"',expected 'channel_data' field. "+o),void e("Invalid auth response")}var i=JSON.parse(n.channel_data);r.members.setMyID(i.user_id)}e(t,n)}))},n.prototype.handleEvent=function(t){var n=t.event;if(0===n.indexOf("pusher_internal:"))this.handleInternalEvent(t);else{var e=t.data,r={};t.user_id&&(r.user_id=t.user_id),this.emit(n,e,r)}},n.prototype.handleInternalEvent=function(t){var n=t.event,e=t.data;switch(n){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(t);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(t);break;case"pusher_internal:member_added":var r=this.members.addMember(e);this.emit("pusher:member_added",r);break;case"pusher_internal:member_removed":var o=this.members.removeMember(e);o&&this.emit("pusher:member_removed",o)}},n.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(t.data),this.emit("pusher:subscription_succeeded",this.members))},n.prototype.disconnect=function(){this.members.reset(),t.prototype.disconnect.call(this)},n}(Dt),qt=e(1),Ft=e(0),Xt=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Jt=function(t){function n(n,e,r){var o=t.call(this,n,e)||this;return o.key=null,o.nacl=r,o}return Xt(n,t),n.prototype.authorize=function(n,e){var r=this;t.prototype.authorize.call(this,n,(function(t,n){if(t)e(t,n);else{var o=n.shared_secret;o?(r.key=Object(Ft.decode)(o),delete n.shared_secret,e(null,n)):e(new Error("No shared_secret key in auth payload for encrypted channel: "+r.name),null)}}))},n.prototype.trigger=function(t,n){throw new m("Client events are not currently supported for encrypted channels")},n.prototype.handleEvent=function(n){var e=n.event,r=n.data;0!==e.indexOf("pusher_internal:")&&0!==e.indexOf("pusher:")?this.handleEncryptedEvent(e,r):t.prototype.handleEvent.call(this,n)},n.prototype.handleEncryptedEvent=function(t,n){var e=this;if(this.key)if(n.ciphertext&&n.nonce){var r=Object(Ft.decode)(n.ciphertext);if(r.length<this.nacl.secretbox.overheadLength)$.error("Expected encrypted event ciphertext length to be "+this.nacl.secretbox.overheadLength+", got: "+r.length);else{var o=Object(Ft.decode)(n.nonce);if(o.length<this.nacl.secretbox.nonceLength)$.error("Expected encrypted event nonce length to be "+this.nacl.secretbox.nonceLength+", got: "+o.length);else{var i=this.nacl.secretbox.open(r,o,this.key);if(null===i)return $.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),void this.authorize(this.pusher.connection.socket_id,(function(n,s){n?$.error("Failed to make a request to the authEndpoint: "+s+". Unable to fetch new key, so dropping encrypted event"):null!==(i=e.nacl.secretbox.open(r,o,e.key))?e.emit(t,e.getDataToEmit(i)):$.error("Failed to decrypt event with new key. Dropping encrypted event")}));this.emit(t,this.getDataToEmit(i))}}}else $.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+n);else $.debug("Received encrypted event before key has been retrieved from the authEndpoint")},n.prototype.getDataToEmit=function(t){var n=Object(qt.decode)(t);try{return JSON.parse(n)}catch(t){return n}},n}(Dt),Yt=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Kt=function(t){function n(n,e){var r=t.call(this)||this;r.state="initialized",r.connection=null,r.key=n,r.options=e,r.timeline=r.options.timeline,r.usingTLS=r.options.useTLS,r.errorCallbacks=r.buildErrorCallbacks(),r.connectionCallbacks=r.buildConnectionCallbacks(r.errorCallbacks),r.handshakeCallbacks=r.buildHandshakeCallbacks(r.errorCallbacks);var o=kn.getNetwork();return o.bind("online",(function(){r.timeline.info({netinfo:"online"}),"connecting"!==r.state&&"unavailable"!==r.state||r.retryIn(0)})),o.bind("offline",(function(){r.timeline.info({netinfo:"offline"}),r.connection&&r.sendActivityCheck()})),r.updateStrategy(),r}return Yt(n,t),n.prototype.connect=function(){this.connection||this.runner||(this.strategy.isSupported()?(this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()):this.updateState("failed"))},n.prototype.send=function(t){return!!this.connection&&this.connection.send(t)},n.prototype.send_event=function(t,n,e){return!!this.connection&&this.connection.send_event(t,n,e)},n.prototype.disconnect=function(){this.disconnectInternally(),this.updateState("disconnected")},n.prototype.isUsingTLS=function(){return this.usingTLS},n.prototype.startConnecting=function(){var t=this,n=function(e,r){e?t.runner=t.strategy.connect(0,n):"error"===r.action?(t.emit("error",{type:"HandshakeError",error:r.error}),t.timeline.error({handshakeError:r.error})):(t.abortConnecting(),t.handshakeCallbacks[r.action](r))};this.runner=this.strategy.connect(0,n)},n.prototype.abortConnecting=function(){this.runner&&(this.runner.abort(),this.runner=null)},n.prototype.disconnectInternally=function(){(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection)&&this.abandonConnection().close()},n.prototype.updateStrategy=function(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})},n.prototype.retryIn=function(t){var n=this;this.timeline.info({action:"retry",delay:t}),t>0&&this.emit("connecting_in",Math.round(t/1e3)),this.retryTimer=new N(t||0,(function(){n.disconnectInternally(),n.connect()}))},n.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},n.prototype.setUnavailableTimer=function(){var t=this;this.unavailableTimer=new N(this.options.unavailableTimeout,(function(){t.updateState("unavailable")}))},n.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},n.prototype.sendActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new N(this.options.pongTimeout,(function(){t.timeline.error({pong_timed_out:t.options.pongTimeout}),t.retryIn(0)}))},n.prototype.resetActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new N(this.activityTimeout,(function(){t.sendActivityCheck()})))},n.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},n.prototype.buildConnectionCallbacks=function(t){var n=this;return H({},t,{message:function(t){n.resetActivityCheck(),n.emit("message",t)},ping:function(){n.send_event("pusher:pong",{})},activity:function(){n.resetActivityCheck()},error:function(t){n.emit("error",t)},closed:function(){n.abandonConnection(),n.shouldRetry()&&n.retryIn(1e3)}})},n.prototype.buildHandshakeCallbacks=function(t){var n=this;return H({},t,{connected:function(t){n.activityTimeout=Math.min(n.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),n.clearUnavailableTimer(),n.setConnection(t.connection),n.socket_id=n.connection.id,n.updateState("connected",{socket_id:n.socket_id})}})},n.prototype.buildErrorCallbacks=function(){var t=this,n=function(n){return function(e){e.error&&t.emit("error",{type:"WebSocketError",error:e.error}),n(e)}};return{tls_only:n((function(){t.usingTLS=!0,t.updateStrategy(),t.retryIn(0)})),refused:n((function(){t.disconnect()})),backoff:n((function(){t.retryIn(1e3)})),retry:n((function(){t.retryIn(0)}))}},n.prototype.setConnection=function(t){for(var n in this.connection=t,this.connectionCallbacks)this.connection.bind(n,this.connectionCallbacks[n]);this.resetActivityCheck()},n.prototype.abandonConnection=function(){if(this.connection){for(var t in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(t,this.connectionCallbacks[t]);var n=this.connection;return this.connection=null,n}},n.prototype.updateState=function(t,n){var e=this.state;if(this.state=t,e!==t){var r=t;"connected"===r&&(r+=" with new socket ID "+n.socket_id),$.debug("State changed",e+" -> "+r),this.timeline.info({state:t,params:n}),this.emit("state_change",{previous:e,current:t}),this.emit(t,n)}},n.prototype.shouldRetry=function(){return"connecting"===this.state||"connected"===this.state},n}(pt),Wt=function(){function t(){this.channels={}}return t.prototype.add=function(t,n){return this.channels[t]||(this.channels[t]=function(t,n){if(0===t.indexOf("private-encrypted-")){if(n.config.nacl)return Gt.createEncryptedChannel(t,n,n.config.nacl);var e=p("encryptedChannelSupport");throw new m("Tried to subscribe to a private-encrypted- channel but no nacl implementation available. "+e)}if(0===t.indexOf("private-"))return Gt.createPrivateChannel(t,n);if(0===t.indexOf("presence-"))return Gt.createPresenceChannel(t,n);if(0===t.indexOf("#"))throw new y('Cannot create a channel with name "'+t+'".');return Gt.createChannel(t,n)}(t,n)),this.channels[t]},t.prototype.all=function(){return function(t){var n=[];return F(t,(function(t){n.push(t)})),n}(this.channels)},t.prototype.find=function(t){return this.channels[t]},t.prototype.remove=function(t){var n=this.channels[t];return delete this.channels[t],n},t.prototype.disconnect=function(){F(this.channels,(function(t){t.disconnect()}))},t}();var Gt={createChannels:function(){return new Wt},createConnectionManager:function(t,n){return new Kt(t,n)},createChannel:function(t,n){return new It(t,n)},createPrivateChannel:function(t,n){return new Dt(t,n)},createPresenceChannel:function(t,n){return new zt(t,n)},createEncryptedChannel:function(t,n,e){return new Jt(t,n,e)},createTimelineSender:function(t,n){return new jt(t,n)},createHandshake:function(t,n){return new Rt(t,n)},createAssistantToTheTransportManager:function(t,n,e){return new At(t,n,e)}},Vt=function(){function t(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}return t.prototype.getAssistant=function(t){return Gt.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},t.prototype.isAlive=function(){return this.livesLeft>0},t.prototype.reportDeath=function(){this.livesLeft-=1},t}(),Zt=function(){function t(t,n){this.strategies=t,this.loop=Boolean(n.loop),this.failFast=Boolean(n.failFast),this.timeout=n.timeout,this.timeoutLimit=n.timeoutLimit}return t.prototype.isSupported=function(){return G(this.strategies,B.method("isSupported"))},t.prototype.connect=function(t,n){var e=this,r=this.strategies,o=0,i=this.timeout,s=null,a=function(c,u){u?n(null,u):(o+=1,e.loop&&(o%=r.length),o<r.length?(i&&(i*=2,e.timeoutLimit&&(i=Math.min(i,e.timeoutLimit))),s=e.tryStrategy(r[o],t,{timeout:i,failFast:e.failFast},a)):n(!0))};return s=this.tryStrategy(r[o],t,{timeout:i,failFast:this.failFast},a),{abort:function(){s.abort()},forceMinPriority:function(n){t=n,s&&s.forceMinPriority(n)}}},t.prototype.tryStrategy=function(t,n,e,r){var o=null,i=null;return e.timeout>0&&(o=new N(e.timeout,(function(){i.abort(),r(!0)}))),i=t.connect(n,(function(t,n){t&&o&&o.isRunning()&&!e.failFast||(o&&o.ensureAborted(),r(t,n))})),{abort:function(){o&&o.ensureAborted(),i.abort()},forceMinPriority:function(t){i.forceMinPriority(t)}}},t}(),Qt=function(){function t(t){this.strategies=t}return t.prototype.isSupported=function(){return G(this.strategies,B.method("isSupported"))},t.prototype.connect=function(t,n){return function(t,n,e){var r=Y(t,(function(t,r,o,i){return t.connect(n,e(r,i))}));return{abort:function(){J(r,$t)},forceMinPriority:function(t){J(r,(function(n){n.forceMinPriority(t)}))}}}(this.strategies,t,(function(t,e){return function(r,o){e[t].error=r,r?function(t){return function(t,n){for(var e=0;e<t.length;e++)if(!n(t[e],e,t))return!1;return!0}(t,(function(t){return Boolean(t.error)}))}(e)&&n(!0):(J(e,(function(t){t.forceMinPriority(o.transport.priority)})),n(null,o))}}))},t}();function $t(t){t.error||t.aborted||(t.abort(),t.aborted=!0)}var tn=function(){function t(t,n,e){this.strategy=t,this.transports=n,this.ttl=e.ttl||18e5,this.usingTLS=e.useTLS,this.timeline=e.timeline}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,n){var e=this.usingTLS,r=function(t){var n=kn.getLocalStorage();if(n)try{var e=n[nn(t)];if(e)return JSON.parse(e)}catch(n){en(t)}return null}(e),o=[this.strategy];if(r&&r.timestamp+this.ttl>=B.now()){var i=this.transports[r.transport];i&&(this.timeline.info({cached:!0,transport:r.transport,latency:r.latency}),o.push(new Zt([i],{timeout:2*r.latency+1e3,failFast:!0})))}var s=B.now(),a=o.pop().connect(t,(function r(i,c){i?(en(e),o.length>0?(s=B.now(),a=o.pop().connect(t,r)):n(i)):(!function(t,n,e){var r=kn.getLocalStorage();if(r)try{r[nn(t)]=Q({timestamp:B.now(),transport:n,latency:e})}catch(t){}}(e,c.transport.name,B.now()-s),n(null,c))}));return{abort:function(){a.abort()},forceMinPriority:function(n){t=n,a&&a.forceMinPriority(n)}}},t}();function nn(t){return"pusherTransport"+(t?"TLS":"NonTLS")}function en(t){var n=kn.getLocalStorage();if(n)try{delete n[nn(t)]}catch(t){}}var rn=function(){function t(t,n){var e=n.delay;this.strategy=t,this.options={delay:e}}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,n){var e,r=this.strategy,o=new N(this.options.delay,(function(){e=r.connect(t,n)}));return{abort:function(){o.ensureAborted(),e&&e.abort()},forceMinPriority:function(n){t=n,e&&e.forceMinPriority(n)}}},t}(),on=function(){function t(t,n,e){this.test=t,this.trueBranch=n,this.falseBranch=e}return t.prototype.isSupported=function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()},t.prototype.connect=function(t,n){return(this.test()?this.trueBranch:this.falseBranch).connect(t,n)},t}(),sn=function(){function t(t){this.strategy=t}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,n){var e=this.strategy.connect(t,(function(t,r){r&&e.abort(),n(t,r)}));return e},t}();function an(t){return function(){return t.isSupported()}}var cn,un=function(t,n,e){var r={};function o(n,o,i,s,a){var c=e(t,n,o,i,s,a);return r[n]=c,c}var i,s=Object.assign({},n,{hostNonTLS:t.wsHost+":"+t.wsPort,hostTLS:t.wsHost+":"+t.wssPort,httpPath:t.wsPath}),a=Object.assign({},s,{useTLS:!0}),c=Object.assign({},n,{hostNonTLS:t.httpHost+":"+t.httpPort,hostTLS:t.httpHost+":"+t.httpsPort,httpPath:t.httpPath}),u={loop:!0,timeout:15e3,timeoutLimit:6e4},h=new Vt({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),p=new Vt({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),l=o("ws","ws",3,s,h),f=o("wss","ws",3,a,h),d=o("sockjs","sockjs",1,c),y=o("xhr_streaming","xhr_streaming",1,c,p),g=o("xdr_streaming","xdr_streaming",1,c,p),v=o("xhr_polling","xhr_polling",1,c),b=o("xdr_polling","xdr_polling",1,c),m=new Zt([l],u),w=new Zt([f],u),_=new Zt([d],u),S=new Zt([new on(an(y),y,g)],u),k=new Zt([new on(an(v),v,b)],u),C=new Zt([new on(an(S),new Qt([S,new rn(k,{delay:4e3})]),k)],u),T=new on(an(C),C,_);return i=n.useTLS?new Qt([m,new rn(T,{delay:2e3})]):new Qt([m,new rn(w,{delay:2e3}),new rn(T,{delay:5e3})]),new tn(new sn(new on(an(l),i,T)),r,{ttl:18e5,timeline:n.timeline,useTLS:n.useTLS})},hn={getRequest:function(t){var n=new window.XDomainRequest;return n.ontimeout=function(){t.emit("error",new g),t.close()},n.onerror=function(n){t.emit("error",n),t.close()},n.onprogress=function(){n.responseText&&n.responseText.length>0&&t.onChunk(200,n.responseText)},n.onload=function(){n.responseText&&n.responseText.length>0&&t.onChunk(200,n.responseText),t.emit("finished",200),t.close()},n},abortRequest:function(t){t.ontimeout=t.onerror=t.onprogress=t.onload=null,t.abort()}},pn=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),ln=function(t){function n(n,e,r){var o=t.call(this)||this;return o.hooks=n,o.method=e,o.url=r,o}return pn(n,t),n.prototype.start=function(t){var n=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){n.close()},kn.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(t)},n.prototype.close=function(){this.unloader&&(kn.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},n.prototype.onChunk=function(t,n){for(;;){var e=this.advanceBuffer(n);if(!e)break;this.emit("chunk",{status:t,data:e})}this.isBufferTooLong(n)&&this.emit("buffer_too_long")},n.prototype.advanceBuffer=function(t){var n=t.slice(this.position),e=n.indexOf("\n");return-1!==e?(this.position+=e+1,n.slice(0,e)):null},n.prototype.isBufferTooLong=function(t){return this.position===t.length&&t.length>262144},n}(pt);!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSED=3]="CLOSED"}(cn||(cn={}));var fn=cn,dn=1;function yn(t){var n=-1===t.indexOf("?")?"?":"&";return t+n+"t="+ +new Date+"&n="+dn++}function gn(t){return Math.floor(Math.random()*t)}var vn,bn=function(){function t(t,n){this.hooks=t,this.session=gn(1e3)+"/"+function(t){for(var n=[],e=0;e<t;e++)n.push(gn(32).toString(32));return n.join("")}(8),this.location=function(t){var n=/([^\?]*)\/*(\??.*)/.exec(t);return{base:n[1],queryString:n[2]}}(n),this.readyState=fn.CONNECTING,this.openStream()}return t.prototype.send=function(t){return this.sendRaw(JSON.stringify([t]))},t.prototype.ping=function(){this.hooks.sendHeartbeat(this)},t.prototype.close=function(t,n){this.onClose(t,n,!0)},t.prototype.sendRaw=function(t){if(this.readyState!==fn.OPEN)return!1;try{return kn.createSocketRequest("POST",yn((n=this.location,e=this.session,n.base+"/"+e+"/xhr_send"))).start(t),!0}catch(t){return!1}var n,e},t.prototype.reconnect=function(){this.closeStream(),this.openStream()},t.prototype.onClose=function(t,n,e){this.closeStream(),this.readyState=fn.CLOSED,this.onclose&&this.onclose({code:t,reason:n,wasClean:e})},t.prototype.onChunk=function(t){var n;if(200===t.status)switch(this.readyState===fn.OPEN&&this.onActivity(),t.data.slice(0,1)){case"o":n=JSON.parse(t.data.slice(1)||"{}"),this.onOpen(n);break;case"a":n=JSON.parse(t.data.slice(1)||"[]");for(var e=0;e<n.length;e++)this.onEvent(n[e]);break;case"m":n=JSON.parse(t.data.slice(1)||"null"),this.onEvent(n);break;case"h":this.hooks.onHeartbeat(this);break;case"c":n=JSON.parse(t.data.slice(1)||"[]"),this.onClose(n[0],n[1],!0)}},t.prototype.onOpen=function(t){var n,e,r;this.readyState===fn.CONNECTING?(t&&t.hostname&&(this.location.base=(n=this.location.base,e=t.hostname,(r=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(n))[1]+e+r[3])),this.readyState=fn.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)},t.prototype.onEvent=function(t){this.readyState===fn.OPEN&&this.onmessage&&this.onmessage({data:t})},t.prototype.onActivity=function(){this.onactivity&&this.onactivity()},t.prototype.onError=function(t){this.onerror&&this.onerror(t)},t.prototype.openStream=function(){var t=this;this.stream=kn.createSocketRequest("POST",yn(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",(function(n){t.onChunk(n)})),this.stream.bind("finished",(function(n){t.hooks.onFinished(t,n)})),this.stream.bind("buffer_too_long",(function(){t.reconnect()}));try{this.stream.start()}catch(n){B.defer((function(){t.onError(n),t.onClose(1006,"Could not start streaming",!1)}))}},t.prototype.closeStream=function(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)},t}(),mn={getReceiveURL:function(t,n){return t.base+"/"+n+"/xhr_streaming"+t.queryString},onHeartbeat:function(t){t.sendRaw("[]")},sendHeartbeat:function(t){t.sendRaw("[]")},onFinished:function(t,n){t.onClose(1006,"Connection interrupted ("+n+")",!1)}},wn={getReceiveURL:function(t,n){return t.base+"/"+n+"/xhr"+t.queryString},onHeartbeat:function(){},sendHeartbeat:function(t){t.sendRaw("[]")},onFinished:function(t,n){200===n?t.reconnect():t.onClose(1006,"Connection interrupted ("+n+")",!1)}},_n={getRequest:function(t){var n=new(kn.getXHRAPI());return n.onreadystatechange=n.onprogress=function(){switch(n.readyState){case 3:n.responseText&&n.responseText.length>0&&t.onChunk(n.status,n.responseText);break;case 4:n.responseText&&n.responseText.length>0&&t.onChunk(n.status,n.responseText),t.emit("finished",n.status),t.close()}},n},abortRequest:function(t){t.onreadystatechange=null,t.abort()}},Sn={createStreamingSocket:function(t){return this.createSocket(mn,t)},createPollingSocket:function(t){return this.createSocket(wn,t)},createSocket:function(t,n){return new bn(t,n)},createXHR:function(t,n){return this.createRequest(_n,t,n)},createRequest:function(t,n,e){return new ln(t,n,e)},createXDR:function(t,n){return this.createRequest(hn,t,n)}},kn={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:i,DependenciesReceivers:c,getDefaultStrategy:un,Transports:Tt,transportConnectionInitializer:function(){var t=this;t.timeline.info(t.buildTimelineMessage({transport:t.name+(t.options.useTLS?"s":"")})),t.hooks.isInitialized()?t.changeState("initialized"):t.hooks.file?(t.changeState("initializing"),u.load(t.hooks.file,{useTLS:t.options.useTLS},(function(n,e){t.hooks.isInitialized()?(t.changeState("initialized"),e(!0)):(n&&t.onError(n),t.onClose(),e(!1))}))):t.onClose()},HTTPFactory:Sn,TimelineTransport:rt,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(t){var n=this;window.Pusher=t;var e=function(){n.onDocumentBody(t.ready)};window.JSON?e():u.load("json2",{},e)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:k,jsonp:tt}},onDocumentBody:function(t){var n=this;document.body?t():setTimeout((function(){n.onDocumentBody(t)}),0)},createJSONPRequest:function(t,n){return new et(t,n)},createScriptRequest:function(t){return new nt(t)},getLocalStorage:function(){try{return window.localStorage}catch(t){return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){return new(this.getXHRAPI())},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return Ot},createWebSocket:function(t){return new(this.getWebSocketAPI())(t)},createSocketRequest:function(t,n){if(this.isXHRSupported())return this.HTTPFactory.createXHR(t,n);if(this.isXDRSupported(0===n.indexOf("https:")))return this.HTTPFactory.createXDR(t,n);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var t=this.getXHRAPI();return Boolean(t)&&void 0!==(new t).withCredentials},isXDRSupported:function(t){var n=t?"https:":"http:",e=this.getProtocol();return Boolean(window.XDomainRequest)&&e===n},addUnloadListener:function(t){void 0!==window.addEventListener?window.addEventListener("unload",t,!1):void 0!==window.attachEvent&&window.attachEvent("onunload",t)},removeUnloadListener:function(t){void 0!==window.addEventListener?window.removeEventListener("unload",t,!1):void 0!==window.detachEvent&&window.detachEvent("onunload",t)}};!function(t){t[t.ERROR=3]="ERROR",t[t.INFO=6]="INFO",t[t.DEBUG=7]="DEBUG"}(vn||(vn={}));var Cn=vn,Tn=function(){function t(t,n,e){this.key=t,this.session=n,this.events=[],this.options=e||{},this.sent=0,this.uniqueID=0}return t.prototype.log=function(t,n){t<=this.options.level&&(this.events.push(H({},n,{timestamp:B.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},t.prototype.error=function(t){this.log(Cn.ERROR,t)},t.prototype.info=function(t){this.log(Cn.INFO,t)},t.prototype.debug=function(t){this.log(Cn.DEBUG,t)},t.prototype.isEmpty=function(){return 0===this.events.length},t.prototype.send=function(t,n){var e=this,r=H({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],t(r,(function(t,r){t||e.sent++,n&&n(t,r)})),!0},t.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},t}(),Pn=function(){function t(t,n,e,r){this.name=t,this.priority=n,this.transport=e,this.options=r||{}}return t.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},t.prototype.connect=function(t,n){var e=this;if(!this.isSupported())return On(new _,n);if(this.priority<t)return On(new v,n);var r=!1,o=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),i=null,s=function(){o.unbind("initialized",s),o.connect()},a=function(){i=Gt.createHandshake(o,(function(t){r=!0,h(),n(null,t)}))},c=function(t){h(),n(t)},u=function(){var t;h(),t=Q(o),n(new b(t))},h=function(){o.unbind("initialized",s),o.unbind("open",a),o.unbind("error",c),o.unbind("closed",u)};return o.bind("initialized",s),o.bind("open",a),o.bind("error",c),o.bind("closed",u),o.initialize(),{abort:function(){r||(h(),i?i.close():o.close())},forceMinPriority:function(t){r||e.priority<t&&(i?i.close():o.close())}}},t}();function On(t,n){return B.defer((function(){n(t)})),{abort:function(){},forceMinPriority:function(){}}}var An=kn.Transports,En=function(t,n,e,r,o,i){var s,a=An[e];if(!a)throw new w(e);return!(t.enabledTransports&&-1===q(t.enabledTransports,n)||t.disabledTransports&&-1!==q(t.disabledTransports,n))?(o=Object.assign({ignoreNullOrigin:t.ignoreNullOrigin},o),s=new Pn(n,r,i?i.getAssistant(a):a,o)):s=xn,s},xn={isSupported:function(){return!1},connect:function(t,n){var e=B.defer((function(){n(new _)}));return{abort:function(){e.ensureAborted()},forceMinPriority:function(){}}}},Ln=function(t){if(void 0===kn.getAuthorizers()[t.transport])throw"'"+t.transport+"' is not a recognized auth transport";return function(n,e){var o=function(t,n){var e="socket_id="+encodeURIComponent(t.socketId);for(var r in n.params)e+="&"+encodeURIComponent(r)+"="+encodeURIComponent(n.params[r]);return e}(n,t);kn.getAuthorizers()[t.transport](kn,o,t,r.UserAuthentication,e)}},Un=function(t){if(void 0===kn.getAuthorizers()[t.transport])throw"'"+t.transport+"' is not a recognized auth transport";return function(n,e){var o=function(t,n){var e="socket_id="+encodeURIComponent(t.socketId);for(var r in e+="&channel_name="+encodeURIComponent(t.channelName),n.params)e+="&"+encodeURIComponent(r)+"="+encodeURIComponent(n.params[r]);return e}(n,t);kn.getAuthorizers()[t.transport](kn,o,t,r.ChannelAuthorization,e)}},Rn=function(){return(Rn=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};function jn(t){return t.httpHost?t.httpHost:t.cluster?"sockjs-"+t.cluster+".pusher.com":s.httpHost}function Mn(t){return t.wsHost?t.wsHost:t.cluster?In(t.cluster):In(s.cluster)}function In(t){return"ws-"+t+".pusher.com"}function Nn(t){return"https:"===kn.getProtocol()||!1!==t.forceTLS}function Dn(t){return"enableStats"in t?t.enableStats:"disableStats"in t&&!t.disableStats}function Bn(t){var n=Rn({},s.userAuthentication,t.userAuthentication);return"customHandler"in n&&null!=n.customHandler?n.customHandler:Ln(n)}function Hn(t,n){var e=function(t,n){var e;return"channelAuthorization"in t?e=Rn({},s.channelAuthorization,t.channelAuthorization):(e={transport:t.authTransport||s.authTransport,endpoint:t.authEndpoint||s.authEndpoint},"auth"in t&&("params"in t.auth&&(e.params=t.auth.params),"headers"in t.auth&&(e.headers=t.auth.headers)),"authorizer"in t&&(e.customHandler=function(t,n,e){var r={authTransport:n.transport,authEndpoint:n.endpoint,auth:{params:n.params,headers:n.headers}};return function(n,o){var i=t.channel(n.channelName);e(i,r).authorize(n.socketId,o)}}(n,e,t.authorizer))),e}(t,n);return"customHandler"in e&&null!=e.customHandler?e.customHandler:Un(e)}var zn=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),qn=function(t){function n(n){var e=t.call(this,(function(t,n){$.debug("No callbacks on user for "+t)}))||this;return e.signin_requested=!1,e.user_data=null,e.serverToUserChannel=null,e.pusher=n,e.pusher.connection.bind("connected",(function(){e._signin()})),e.pusher.connection.bind("connecting",(function(){e._disconnect()})),e.pusher.connection.bind("disconnected",(function(){e._disconnect()})),e.pusher.connection.bind("message",(function(t){"pusher:signin_success"===t.event&&e._onSigninSuccess(t.data),e.serverToUserChannel&&e.serverToUserChannel.name===t.channel&&e.serverToUserChannel.handleEvent(t)})),e}return zn(n,t),n.prototype.signin=function(){this.signin_requested||(this.signin_requested=!0,this._signin())},n.prototype._signin=function(){var t=this;if(this.signin_requested&&"connected"===this.pusher.connection.state){this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},(function(n,e){n?$.warn("Error during signin: "+n):t.pusher.send_event("pusher:signin",{auth:e.auth,user_data:e.user_data})}))}},n.prototype._onSigninSuccess=function(t){try{this.user_data=JSON.parse(t.user_data)}catch(n){return void $.error("Failed parsing user data after signin: "+t.user_data)}"string"==typeof this.user_data.id&&""!==this.user_data.id?this._subscribeChannels():$.error("user_data doesn't contain an id. user_data: "+this.user_data)},n.prototype._subscribeChannels=function(){var t,n=this;this.serverToUserChannel=new It("#server-to-user-"+this.user_data.id,this.pusher),this.serverToUserChannel.bind_global((function(t,e){0!==t.indexOf("pusher_internal:")&&0!==t.indexOf("pusher:")&&n.emit(t,e)})),(t=this.serverToUserChannel).subscriptionPending&&t.subscriptionCancelled?t.reinstateSubscription():t.subscriptionPending||"connected"!==n.pusher.connection.state||t.subscribe()},n.prototype._disconnect=function(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null)},n}(pt),Fn=function(){function t(n,e){var r,o,i,a=this;if(function(t){if(null==t)throw"You must pass your app key when you instantiate Pusher."}(n),!(e=e||{}).cluster&&!e.wsHost&&!e.httpHost){var c=p("javascriptQuickStart");$.warn("You should always specify a cluster when connecting. "+c)}"disableStats"in e&&$.warn("The disableStats option is deprecated in favor of enableStats"),this.key=n,this.config=(o=this,i={activityTimeout:(r=e).activityTimeout||s.activityTimeout,cluster:r.cluster||s.cluster,httpPath:r.httpPath||s.httpPath,httpPort:r.httpPort||s.httpPort,httpsPort:r.httpsPort||s.httpsPort,pongTimeout:r.pongTimeout||s.pongTimeout,statsHost:r.statsHost||s.stats_host,unavailableTimeout:r.unavailableTimeout||s.unavailableTimeout,wsPath:r.wsPath||s.wsPath,wsPort:r.wsPort||s.wsPort,wssPort:r.wssPort||s.wssPort,enableStats:Dn(r),httpHost:jn(r),useTLS:Nn(r),wsHost:Mn(r),userAuthenticator:Bn(r),channelAuthorizer:Hn(r,o)},"disabledTransports"in r&&(i.disabledTransports=r.disabledTransports),"enabledTransports"in r&&(i.enabledTransports=r.enabledTransports),"ignoreNullOrigin"in r&&(i.ignoreNullOrigin=r.ignoreNullOrigin),"timelineParams"in r&&(i.timelineParams=r.timelineParams),"nacl"in r&&(i.nacl=r.nacl),i),this.channels=Gt.createChannels(),this.global_emitter=new pt,this.sessionID=Math.floor(1e9*Math.random()),this.timeline=new Tn(this.key,this.sessionID,{cluster:this.config.cluster,features:t.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Cn.INFO,version:s.VERSION}),this.config.enableStats&&(this.timelineSender=Gt.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+kn.TimelineTransport.name}));this.connection=Gt.createConnectionManager(this.key,{getStrategy:function(t){return kn.getDefaultStrategy(a.config,t,En)},timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:Boolean(this.config.useTLS)}),this.connection.bind("connected",(function(){a.subscribeAll(),a.timelineSender&&a.timelineSender.send(a.connection.isUsingTLS())})),this.connection.bind("message",(function(t){var n=0===t.event.indexOf("pusher_internal:");if(t.channel){var e=a.channel(t.channel);e&&e.handleEvent(t)}n||a.global_emitter.emit(t.event,t.data)})),this.connection.bind("connecting",(function(){a.channels.disconnect()})),this.connection.bind("disconnected",(function(){a.channels.disconnect()})),this.connection.bind("error",(function(t){$.warn(t)})),t.instances.push(this),this.timeline.info({instances:t.instances.length}),this.user=new qn(this),t.isReady&&this.connect()}return t.ready=function(){t.isReady=!0;for(var n=0,e=t.instances.length;n<e;n++)t.instances[n].connect()},t.getClientFeatures=function(){return X(W({ws:kn.Transports.ws},(function(t){return t.isSupported({})})))},t.prototype.channel=function(t){return this.channels.find(t)},t.prototype.allChannels=function(){return this.channels.all()},t.prototype.connect=function(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var t=this.connection.isUsingTLS(),n=this.timelineSender;this.timelineSenderTimer=new D(6e4,(function(){n.send(t)}))}},t.prototype.disconnect=function(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)},t.prototype.bind=function(t,n,e){return this.global_emitter.bind(t,n,e),this},t.prototype.unbind=function(t,n,e){return this.global_emitter.unbind(t,n,e),this},t.prototype.bind_global=function(t){return this.global_emitter.bind_global(t),this},t.prototype.unbind_global=function(t){return this.global_emitter.unbind_global(t),this},t.prototype.unbind_all=function(t){return this.global_emitter.unbind_all(),this},t.prototype.subscribeAll=function(){var t;for(t in this.channels.channels)this.channels.channels.hasOwnProperty(t)&&this.subscribe(t)},t.prototype.subscribe=function(t){var n=this.channels.add(t,this);return n.subscriptionPending&&n.subscriptionCancelled?n.reinstateSubscription():n.subscriptionPending||"connected"!==this.connection.state||n.subscribe(),n},t.prototype.unsubscribe=function(t){var n=this.channels.find(t);n&&n.subscriptionPending?n.cancelSubscription():(n=this.channels.remove(t))&&n.subscribed&&n.unsubscribe()},t.prototype.send_event=function(t,n,e){return this.connection.send_event(t,n,e)},t.prototype.shouldUseTLS=function(){return this.config.useTLS},t.prototype.signin=function(){this.user.signin()},t.instances=[],t.isReady=!1,t.logToConsole=!1,t.Runtime=kn,t.ScriptReceivers=kn.ScriptReceivers,t.DependenciesReceivers=kn.DependenciesReceivers,t.auth_callbacks=kn.auth_callbacks,t}(),Xn=Fn;kn.setup(Fn);var Jn=e(2),Yn=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Kn=function(t){function n(e,r){return Xn.logToConsole=n.logToConsole,Xn.log=n.log,(r=r||{}).nacl=Jn,t.call(this,e,r)||this}return Yn(n,t),n}(Xn);n.default=Kn}])}));
|
|
8
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Pusher=e():t.Pusher=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){void 0===t&&(t="="),this._paddingCharacter=t}return t.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(8*t+5)/6|0},t.prototype.encode=function(t){for(var e="",n=0;n<t.length-2;n+=3){var r=t[n]<<16|t[n+1]<<8|t[n+2];e+=this._encodeByte(r>>>18&63),e+=this._encodeByte(r>>>12&63),e+=this._encodeByte(r>>>6&63),e+=this._encodeByte(r>>>0&63)}var o=t.length-n;if(o>0){r=t[n]<<16|(2===o?t[n+1]<<8:0);e+=this._encodeByte(r>>>18&63),e+=this._encodeByte(r>>>12&63),e+=2===o?this._encodeByte(r>>>6&63):this._paddingCharacter||"",e+=this._paddingCharacter||""}return e},t.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(6*t+7)/8|0},t.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},t.prototype.decode=function(t){if(0===t.length)return new Uint8Array(0);for(var e=this._getPaddingLength(t),n=t.length-e,r=new Uint8Array(this.maxDecodedLength(n)),o=0,i=0,s=0,a=0,c=0,u=0,h=0;i<n-4;i+=4)a=this._decodeChar(t.charCodeAt(i+0)),c=this._decodeChar(t.charCodeAt(i+1)),u=this._decodeChar(t.charCodeAt(i+2)),h=this._decodeChar(t.charCodeAt(i+3)),r[o++]=a<<2|c>>>4,r[o++]=c<<4|u>>>2,r[o++]=u<<6|h,s|=256&a,s|=256&c,s|=256&u,s|=256&h;if(i<n-1&&(a=this._decodeChar(t.charCodeAt(i)),c=this._decodeChar(t.charCodeAt(i+1)),r[o++]=a<<2|c>>>4,s|=256&a,s|=256&c),i<n-2&&(u=this._decodeChar(t.charCodeAt(i+2)),r[o++]=c<<4|u>>>2,s|=256&u),i<n-3&&(h=this._decodeChar(t.charCodeAt(i+3)),r[o++]=u<<6|h,s|=256&h),0!==s)throw new Error("Base64Coder: incorrect characters for decoding");return r},t.prototype._encodeByte=function(t){var e=t;return e+=65,e+=25-t>>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-15,e+=62-t>>>8&3,String.fromCharCode(e)},t.prototype._decodeChar=function(t){var e=256;return e+=(42-t&t-44)>>>8&-256+t-43+62,e+=(46-t&t-48)>>>8&-256+t-47+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},t.prototype._getPaddingLength=function(t){var e=0;if(this._paddingCharacter){for(var n=t.length-1;n>=0&&t[n]===this._paddingCharacter;n--)e++;if(t.length<4||e>2)throw new Error("Base64Coder: incorrect padding")}return e},t}();e.Coder=i;var s=new i;e.encode=function(t){return s.encode(t)},e.decode=function(t){return s.decode(t)};var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype._encodeByte=function(t){var e=t;return e+=65,e+=25-t>>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-13,e+=62-t>>>8&49,String.fromCharCode(e)},e.prototype._decodeChar=function(t){var e=256;return e+=(44-t&t-46)>>>8&-256+t-45+62,e+=(94-t&t-96)>>>8&-256+t-95+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},e}(i);e.URLSafeCoder=a;var c=new a;e.encodeURLSafe=function(t){return c.encode(t)},e.decodeURLSafe=function(t){return c.decode(t)},e.encodedLength=function(t){return s.encodedLength(t)},e.maxDecodedLength=function(t){return s.maxDecodedLength(t)},e.decodedLength=function(t){return s.decodedLength(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="utf8: invalid source encoding";function o(t){for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r<128)e+=1;else if(r<2048)e+=2;else if(r<55296)e+=3;else{if(!(r<=57343))throw new Error("utf8: invalid string");if(n>=t.length-1)throw new Error("utf8: invalid string");n++,e+=4}}return e}e.encode=function(t){for(var e=new Uint8Array(o(t)),n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=192|i>>6,e[n++]=128|63&i):i<55296?(e[n++]=224|i>>12,e[n++]=128|i>>6&63,e[n++]=128|63&i):(r++,i=(1023&i)<<10,i|=1023&t.charCodeAt(r),i+=65536,e[n++]=240|i>>18,e[n++]=128|i>>12&63,e[n++]=128|i>>6&63,e[n++]=128|63&i)}return e},e.encodedLength=o,e.decode=function(t){for(var e=[],n=0;n<t.length;n++){var o=t[n];if(128&o){var i=void 0;if(o<224){if(n>=t.length)throw new Error(r);if(128!=(192&(s=t[++n])))throw new Error(r);o=(31&o)<<6|63&s,i=128}else if(o<240){if(n>=t.length-1)throw new Error(r);var s=t[++n],a=t[++n];if(128!=(192&s)||128!=(192&a))throw new Error(r);o=(15&o)<<12|(63&s)<<6|63&a,i=2048}else{if(!(o<248))throw new Error(r);if(n>=t.length-2)throw new Error(r);s=t[++n],a=t[++n];var c=t[++n];if(128!=(192&s)||128!=(192&a)||128!=(192&c))throw new Error(r);o=(15&o)<<18|(63&s)<<12|(63&a)<<6|63&c,i=65536}if(o<i||o>=55296&&o<=57343)throw new Error(r);if(o>=65536){if(o>1114111)throw new Error(r);o-=65536,e.push(String.fromCharCode(55296|o>>10)),o=56320|1023&o}}e.push(String.fromCharCode(o))}return e.join("")}},function(t,e,n){!function(t){"use strict";var e=function(t){var e,n=new Float64Array(16);if(t)for(e=0;e<t.length;e++)n[e]=t[e];return n},r=function(){throw new Error("no PRNG")},o=new Uint8Array(16),i=new Uint8Array(32);i[0]=9;var s=e(),a=e([1]),c=e([56129,1]),u=e([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=e([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),p=e([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),l=e([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),f=e([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function d(t,e,n,r){t[e]=n>>24&255,t[e+1]=n>>16&255,t[e+2]=n>>8&255,t[e+3]=255&n,t[e+4]=r>>24&255,t[e+5]=r>>16&255,t[e+6]=r>>8&255,t[e+7]=255&r}function y(t,e,n,r,o){var i,s=0;for(i=0;i<o;i++)s|=t[e+i]^n[r+i];return(1&s-1>>>8)-1}function g(t,e,n,r){return y(t,e,n,r,16)}function v(t,e,n,r){return y(t,e,n,r,32)}function b(t,e,n,r){!function(t,e,n,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,h=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,p=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,l=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,f=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,d=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,m=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,w=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,_=i,S=s,k=a,C=c,T=u,P=h,O=p,A=l,E=f,x=d,L=y,R=g,U=v,j=b,M=m,I=w,D=0;D<20;D+=2)_^=(o=(U^=(o=(E^=(o=(T^=(o=_+U|0)<<7|o>>>25)+_|0)<<9|o>>>23)+T|0)<<13|o>>>19)+E|0)<<18|o>>>14,P^=(o=(S^=(o=(j^=(o=(x^=(o=P+S|0)<<7|o>>>25)+P|0)<<9|o>>>23)+x|0)<<13|o>>>19)+j|0)<<18|o>>>14,L^=(o=(O^=(o=(k^=(o=(M^=(o=L+O|0)<<7|o>>>25)+L|0)<<9|o>>>23)+M|0)<<13|o>>>19)+k|0)<<18|o>>>14,I^=(o=(R^=(o=(A^=(o=(C^=(o=I+R|0)<<7|o>>>25)+I|0)<<9|o>>>23)+C|0)<<13|o>>>19)+A|0)<<18|o>>>14,_^=(o=(C^=(o=(k^=(o=(S^=(o=_+C|0)<<7|o>>>25)+_|0)<<9|o>>>23)+S|0)<<13|o>>>19)+k|0)<<18|o>>>14,P^=(o=(T^=(o=(A^=(o=(O^=(o=P+T|0)<<7|o>>>25)+P|0)<<9|o>>>23)+O|0)<<13|o>>>19)+A|0)<<18|o>>>14,L^=(o=(x^=(o=(E^=(o=(R^=(o=L+x|0)<<7|o>>>25)+L|0)<<9|o>>>23)+R|0)<<13|o>>>19)+E|0)<<18|o>>>14,I^=(o=(M^=(o=(j^=(o=(U^=(o=I+M|0)<<7|o>>>25)+I|0)<<9|o>>>23)+U|0)<<13|o>>>19)+j|0)<<18|o>>>14;_=_+i|0,S=S+s|0,k=k+a|0,C=C+c|0,T=T+u|0,P=P+h|0,O=O+p|0,A=A+l|0,E=E+f|0,x=x+d|0,L=L+y|0,R=R+g|0,U=U+v|0,j=j+b|0,M=M+m|0,I=I+w|0,t[0]=_>>>0&255,t[1]=_>>>8&255,t[2]=_>>>16&255,t[3]=_>>>24&255,t[4]=S>>>0&255,t[5]=S>>>8&255,t[6]=S>>>16&255,t[7]=S>>>24&255,t[8]=k>>>0&255,t[9]=k>>>8&255,t[10]=k>>>16&255,t[11]=k>>>24&255,t[12]=C>>>0&255,t[13]=C>>>8&255,t[14]=C>>>16&255,t[15]=C>>>24&255,t[16]=T>>>0&255,t[17]=T>>>8&255,t[18]=T>>>16&255,t[19]=T>>>24&255,t[20]=P>>>0&255,t[21]=P>>>8&255,t[22]=P>>>16&255,t[23]=P>>>24&255,t[24]=O>>>0&255,t[25]=O>>>8&255,t[26]=O>>>16&255,t[27]=O>>>24&255,t[28]=A>>>0&255,t[29]=A>>>8&255,t[30]=A>>>16&255,t[31]=A>>>24&255,t[32]=E>>>0&255,t[33]=E>>>8&255,t[34]=E>>>16&255,t[35]=E>>>24&255,t[36]=x>>>0&255,t[37]=x>>>8&255,t[38]=x>>>16&255,t[39]=x>>>24&255,t[40]=L>>>0&255,t[41]=L>>>8&255,t[42]=L>>>16&255,t[43]=L>>>24&255,t[44]=R>>>0&255,t[45]=R>>>8&255,t[46]=R>>>16&255,t[47]=R>>>24&255,t[48]=U>>>0&255,t[49]=U>>>8&255,t[50]=U>>>16&255,t[51]=U>>>24&255,t[52]=j>>>0&255,t[53]=j>>>8&255,t[54]=j>>>16&255,t[55]=j>>>24&255,t[56]=M>>>0&255,t[57]=M>>>8&255,t[58]=M>>>16&255,t[59]=M>>>24&255,t[60]=I>>>0&255,t[61]=I>>>8&255,t[62]=I>>>16&255,t[63]=I>>>24&255}(t,e,n,r)}function m(t,e,n,r){!function(t,e,n,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,h=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,p=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,l=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,f=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,d=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,m=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,w=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,_=0;_<20;_+=2)i^=(o=(v^=(o=(f^=(o=(u^=(o=i+v|0)<<7|o>>>25)+i|0)<<9|o>>>23)+u|0)<<13|o>>>19)+f|0)<<18|o>>>14,h^=(o=(s^=(o=(b^=(o=(d^=(o=h+s|0)<<7|o>>>25)+h|0)<<9|o>>>23)+d|0)<<13|o>>>19)+b|0)<<18|o>>>14,y^=(o=(p^=(o=(a^=(o=(m^=(o=y+p|0)<<7|o>>>25)+y|0)<<9|o>>>23)+m|0)<<13|o>>>19)+a|0)<<18|o>>>14,w^=(o=(g^=(o=(l^=(o=(c^=(o=w+g|0)<<7|o>>>25)+w|0)<<9|o>>>23)+c|0)<<13|o>>>19)+l|0)<<18|o>>>14,i^=(o=(c^=(o=(a^=(o=(s^=(o=i+c|0)<<7|o>>>25)+i|0)<<9|o>>>23)+s|0)<<13|o>>>19)+a|0)<<18|o>>>14,h^=(o=(u^=(o=(l^=(o=(p^=(o=h+u|0)<<7|o>>>25)+h|0)<<9|o>>>23)+p|0)<<13|o>>>19)+l|0)<<18|o>>>14,y^=(o=(d^=(o=(f^=(o=(g^=(o=y+d|0)<<7|o>>>25)+y|0)<<9|o>>>23)+g|0)<<13|o>>>19)+f|0)<<18|o>>>14,w^=(o=(m^=(o=(b^=(o=(v^=(o=w+m|0)<<7|o>>>25)+w|0)<<9|o>>>23)+v|0)<<13|o>>>19)+b|0)<<18|o>>>14;t[0]=i>>>0&255,t[1]=i>>>8&255,t[2]=i>>>16&255,t[3]=i>>>24&255,t[4]=h>>>0&255,t[5]=h>>>8&255,t[6]=h>>>16&255,t[7]=h>>>24&255,t[8]=y>>>0&255,t[9]=y>>>8&255,t[10]=y>>>16&255,t[11]=y>>>24&255,t[12]=w>>>0&255,t[13]=w>>>8&255,t[14]=w>>>16&255,t[15]=w>>>24&255,t[16]=p>>>0&255,t[17]=p>>>8&255,t[18]=p>>>16&255,t[19]=p>>>24&255,t[20]=l>>>0&255,t[21]=l>>>8&255,t[22]=l>>>16&255,t[23]=l>>>24&255,t[24]=f>>>0&255,t[25]=f>>>8&255,t[26]=f>>>16&255,t[27]=f>>>24&255,t[28]=d>>>0&255,t[29]=d>>>8&255,t[30]=d>>>16&255,t[31]=d>>>24&255}(t,e,n,r)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function _(t,e,n,r,o,i,s){var a,c,u=new Uint8Array(16),h=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=i[c];for(;o>=64;){for(b(h,u,s,w),c=0;c<64;c++)t[e+c]=n[r+c]^h[c];for(a=1,c=8;c<16;c++)a=a+(255&u[c])|0,u[c]=255&a,a>>>=8;o-=64,e+=64,r+=64}if(o>0)for(b(h,u,s,w),c=0;c<o;c++)t[e+c]=n[r+c]^h[c];return 0}function S(t,e,n,r,o){var i,s,a=new Uint8Array(16),c=new Uint8Array(64);for(s=0;s<16;s++)a[s]=0;for(s=0;s<8;s++)a[s]=r[s];for(;n>=64;){for(b(c,a,o,w),s=0;s<64;s++)t[e+s]=c[s];for(i=1,s=8;s<16;s++)i=i+(255&a[s])|0,a[s]=255&i,i>>>=8;n-=64,e+=64}if(n>0)for(b(c,a,o,w),s=0;s<n;s++)t[e+s]=c[s];return 0}function k(t,e,n,r,o){var i=new Uint8Array(32);m(i,r,o,w);for(var s=new Uint8Array(8),a=0;a<8;a++)s[a]=r[a+16];return S(t,e,n,s,i)}function C(t,e,n,r,o,i,s){var a=new Uint8Array(32);m(a,i,s,w);for(var c=new Uint8Array(8),u=0;u<8;u++)c[u]=i[u+16];return _(t,e,n,r,o,c,a)}var T=function(t){var e,n,r,o,i,s,a,c;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,e=255&t[0]|(255&t[1])<<8,this.r[0]=8191&e,n=255&t[2]|(255&t[3])<<8,this.r[1]=8191&(e>>>13|n<<3),r=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(n>>>10|r<<6),o=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(r>>>7|o<<9),i=255&t[8]|(255&t[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,s=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(i>>>14|s<<2),a=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(s>>>11|a<<5),c=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(a>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};function P(t,e,n,r,o,i){var s=new T(i);return s.update(n,r,o),s.finish(t,e),0}function O(t,e,n,r,o,i){var s=new Uint8Array(16);return P(s,0,n,r,o,i),g(t,e,s,0)}function A(t,e,n,r,o){var i;if(n<32)return-1;for(C(t,0,e,0,n,r,o),P(t,16,t,32,n-32,t),i=0;i<16;i++)t[i]=0;return 0}function E(t,e,n,r,o){var i,s=new Uint8Array(32);if(n<32)return-1;if(k(s,0,32,r,o),0!==O(e,16,e,32,n-32,s))return-1;for(C(t,0,e,0,n,r,o),i=0;i<32;i++)t[i]=0;return 0}function x(t,e){var n;for(n=0;n<16;n++)t[n]=0|e[n]}function L(t){var e,n,r=1;for(e=0;e<16;e++)n=t[e]+r+65535,r=Math.floor(n/65536),t[e]=n-65536*r;t[0]+=r-1+37*(r-1)}function R(t,e,n){for(var r,o=~(n-1),i=0;i<16;i++)r=o&(t[i]^e[i]),t[i]^=r,e[i]^=r}function U(t,n){var r,o,i,s=e(),a=e();for(r=0;r<16;r++)a[r]=n[r];for(L(a),L(a),L(a),o=0;o<2;o++){for(s[0]=a[0]-65517,r=1;r<15;r++)s[r]=a[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),i=s[15]>>16&1,s[14]&=65535,R(a,s,1-i)}for(r=0;r<16;r++)t[2*r]=255&a[r],t[2*r+1]=a[r]>>8}function j(t,e){var n=new Uint8Array(32),r=new Uint8Array(32);return U(n,t),U(r,e),v(n,0,r,0)}function M(t){var e=new Uint8Array(32);return U(e,t),1&e[0]}function I(t,e){var n;for(n=0;n<16;n++)t[n]=e[2*n]+(e[2*n+1]<<8);t[15]&=32767}function D(t,e,n){for(var r=0;r<16;r++)t[r]=e[r]+n[r]}function N(t,e,n){for(var r=0;r<16;r++)t[r]=e[r]-n[r]}function B(t,e,n){var r,o,i=0,s=0,a=0,c=0,u=0,h=0,p=0,l=0,f=0,d=0,y=0,g=0,v=0,b=0,m=0,w=0,_=0,S=0,k=0,C=0,T=0,P=0,O=0,A=0,E=0,x=0,L=0,R=0,U=0,j=0,M=0,I=n[0],D=n[1],N=n[2],B=n[3],z=n[4],H=n[5],q=n[6],F=n[7],X=n[8],J=n[9],Y=n[10],K=n[11],W=n[12],G=n[13],V=n[14],Z=n[15];i+=(r=e[0])*I,s+=r*D,a+=r*N,c+=r*B,u+=r*z,h+=r*H,p+=r*q,l+=r*F,f+=r*X,d+=r*J,y+=r*Y,g+=r*K,v+=r*W,b+=r*G,m+=r*V,w+=r*Z,s+=(r=e[1])*I,a+=r*D,c+=r*N,u+=r*B,h+=r*z,p+=r*H,l+=r*q,f+=r*F,d+=r*X,y+=r*J,g+=r*Y,v+=r*K,b+=r*W,m+=r*G,w+=r*V,_+=r*Z,a+=(r=e[2])*I,c+=r*D,u+=r*N,h+=r*B,p+=r*z,l+=r*H,f+=r*q,d+=r*F,y+=r*X,g+=r*J,v+=r*Y,b+=r*K,m+=r*W,w+=r*G,_+=r*V,S+=r*Z,c+=(r=e[3])*I,u+=r*D,h+=r*N,p+=r*B,l+=r*z,f+=r*H,d+=r*q,y+=r*F,g+=r*X,v+=r*J,b+=r*Y,m+=r*K,w+=r*W,_+=r*G,S+=r*V,k+=r*Z,u+=(r=e[4])*I,h+=r*D,p+=r*N,l+=r*B,f+=r*z,d+=r*H,y+=r*q,g+=r*F,v+=r*X,b+=r*J,m+=r*Y,w+=r*K,_+=r*W,S+=r*G,k+=r*V,C+=r*Z,h+=(r=e[5])*I,p+=r*D,l+=r*N,f+=r*B,d+=r*z,y+=r*H,g+=r*q,v+=r*F,b+=r*X,m+=r*J,w+=r*Y,_+=r*K,S+=r*W,k+=r*G,C+=r*V,T+=r*Z,p+=(r=e[6])*I,l+=r*D,f+=r*N,d+=r*B,y+=r*z,g+=r*H,v+=r*q,b+=r*F,m+=r*X,w+=r*J,_+=r*Y,S+=r*K,k+=r*W,C+=r*G,T+=r*V,P+=r*Z,l+=(r=e[7])*I,f+=r*D,d+=r*N,y+=r*B,g+=r*z,v+=r*H,b+=r*q,m+=r*F,w+=r*X,_+=r*J,S+=r*Y,k+=r*K,C+=r*W,T+=r*G,P+=r*V,O+=r*Z,f+=(r=e[8])*I,d+=r*D,y+=r*N,g+=r*B,v+=r*z,b+=r*H,m+=r*q,w+=r*F,_+=r*X,S+=r*J,k+=r*Y,C+=r*K,T+=r*W,P+=r*G,O+=r*V,A+=r*Z,d+=(r=e[9])*I,y+=r*D,g+=r*N,v+=r*B,b+=r*z,m+=r*H,w+=r*q,_+=r*F,S+=r*X,k+=r*J,C+=r*Y,T+=r*K,P+=r*W,O+=r*G,A+=r*V,E+=r*Z,y+=(r=e[10])*I,g+=r*D,v+=r*N,b+=r*B,m+=r*z,w+=r*H,_+=r*q,S+=r*F,k+=r*X,C+=r*J,T+=r*Y,P+=r*K,O+=r*W,A+=r*G,E+=r*V,x+=r*Z,g+=(r=e[11])*I,v+=r*D,b+=r*N,m+=r*B,w+=r*z,_+=r*H,S+=r*q,k+=r*F,C+=r*X,T+=r*J,P+=r*Y,O+=r*K,A+=r*W,E+=r*G,x+=r*V,L+=r*Z,v+=(r=e[12])*I,b+=r*D,m+=r*N,w+=r*B,_+=r*z,S+=r*H,k+=r*q,C+=r*F,T+=r*X,P+=r*J,O+=r*Y,A+=r*K,E+=r*W,x+=r*G,L+=r*V,R+=r*Z,b+=(r=e[13])*I,m+=r*D,w+=r*N,_+=r*B,S+=r*z,k+=r*H,C+=r*q,T+=r*F,P+=r*X,O+=r*J,A+=r*Y,E+=r*K,x+=r*W,L+=r*G,R+=r*V,U+=r*Z,m+=(r=e[14])*I,w+=r*D,_+=r*N,S+=r*B,k+=r*z,C+=r*H,T+=r*q,P+=r*F,O+=r*X,A+=r*J,E+=r*Y,x+=r*K,L+=r*W,R+=r*G,U+=r*V,j+=r*Z,w+=(r=e[15])*I,s+=38*(S+=r*N),a+=38*(k+=r*B),c+=38*(C+=r*z),u+=38*(T+=r*H),h+=38*(P+=r*q),p+=38*(O+=r*F),l+=38*(A+=r*X),f+=38*(E+=r*J),d+=38*(x+=r*Y),y+=38*(L+=r*K),g+=38*(R+=r*W),v+=38*(U+=r*G),b+=38*(j+=r*V),m+=38*(M+=r*Z),i=(r=(i+=38*(_+=r*D))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),w=(r=w+o+65535)-65536*(o=Math.floor(r/65536)),i=(r=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),w=(r=w+o+65535)-65536*(o=Math.floor(r/65536)),i+=o-1+37*(o-1),t[0]=i,t[1]=s,t[2]=a,t[3]=c,t[4]=u,t[5]=h,t[6]=p,t[7]=l,t[8]=f,t[9]=d,t[10]=y,t[11]=g,t[12]=v,t[13]=b,t[14]=m,t[15]=w}function z(t,e){B(t,e,e)}function H(t,n){var r,o=e();for(r=0;r<16;r++)o[r]=n[r];for(r=253;r>=0;r--)z(o,o),2!==r&&4!==r&&B(o,o,n);for(r=0;r<16;r++)t[r]=o[r]}function q(t,n){var r,o=e();for(r=0;r<16;r++)o[r]=n[r];for(r=250;r>=0;r--)z(o,o),1!==r&&B(o,o,n);for(r=0;r<16;r++)t[r]=o[r]}function F(t,n,r){var o,i,s=new Uint8Array(32),a=new Float64Array(80),u=e(),h=e(),p=e(),l=e(),f=e(),d=e();for(i=0;i<31;i++)s[i]=n[i];for(s[31]=127&n[31]|64,s[0]&=248,I(a,r),i=0;i<16;i++)h[i]=a[i],l[i]=u[i]=p[i]=0;for(u[0]=l[0]=1,i=254;i>=0;--i)R(u,h,o=s[i>>>3]>>>(7&i)&1),R(p,l,o),D(f,u,p),N(u,u,p),D(p,h,l),N(h,h,l),z(l,f),z(d,u),B(u,p,u),B(p,h,f),D(f,u,p),N(u,u,p),z(h,u),N(p,l,d),B(u,p,c),D(u,u,l),B(p,p,u),B(u,l,d),B(l,h,a),z(h,f),R(u,h,o),R(p,l,o);for(i=0;i<16;i++)a[i+16]=u[i],a[i+32]=p[i],a[i+48]=h[i],a[i+64]=l[i];var y=a.subarray(32),g=a.subarray(16);return H(y,y),B(g,g,y),U(t,g),0}function X(t,e){return F(t,e,i)}function J(t,e){return r(e,32),X(t,e)}function Y(t,e,n){var r=new Uint8Array(32);return F(r,n,e),m(t,o,r,w)}T.prototype.blocks=function(t,e,n){for(var r,o,i,s,a,c,u,h,p,l,f,d,y,g,v,b,m,w,_,S=this.fin?0:2048,k=this.h[0],C=this.h[1],T=this.h[2],P=this.h[3],O=this.h[4],A=this.h[5],E=this.h[6],x=this.h[7],L=this.h[8],R=this.h[9],U=this.r[0],j=this.r[1],M=this.r[2],I=this.r[3],D=this.r[4],N=this.r[5],B=this.r[6],z=this.r[7],H=this.r[8],q=this.r[9];n>=16;)l=p=0,l+=(k+=8191&(r=255&t[e+0]|(255&t[e+1])<<8))*U,l+=(C+=8191&(r>>>13|(o=255&t[e+2]|(255&t[e+3])<<8)<<3))*(5*q),l+=(T+=8191&(o>>>10|(i=255&t[e+4]|(255&t[e+5])<<8)<<6))*(5*H),l+=(P+=8191&(i>>>7|(s=255&t[e+6]|(255&t[e+7])<<8)<<9))*(5*z),p=(l+=(O+=8191&(s>>>4|(a=255&t[e+8]|(255&t[e+9])<<8)<<12))*(5*B))>>>13,l&=8191,l+=(A+=a>>>1&8191)*(5*N),l+=(E+=8191&(a>>>14|(c=255&t[e+10]|(255&t[e+11])<<8)<<2))*(5*D),l+=(x+=8191&(c>>>11|(u=255&t[e+12]|(255&t[e+13])<<8)<<5))*(5*I),l+=(L+=8191&(u>>>8|(h=255&t[e+14]|(255&t[e+15])<<8)<<8))*(5*M),f=p+=(l+=(R+=h>>>5|S)*(5*j))>>>13,f+=k*j,f+=C*U,f+=T*(5*q),f+=P*(5*H),p=(f+=O*(5*z))>>>13,f&=8191,f+=A*(5*B),f+=E*(5*N),f+=x*(5*D),f+=L*(5*I),p+=(f+=R*(5*M))>>>13,f&=8191,d=p,d+=k*M,d+=C*j,d+=T*U,d+=P*(5*q),p=(d+=O*(5*H))>>>13,d&=8191,d+=A*(5*z),d+=E*(5*B),d+=x*(5*N),d+=L*(5*D),y=p+=(d+=R*(5*I))>>>13,y+=k*I,y+=C*M,y+=T*j,y+=P*U,p=(y+=O*(5*q))>>>13,y&=8191,y+=A*(5*H),y+=E*(5*z),y+=x*(5*B),y+=L*(5*N),g=p+=(y+=R*(5*D))>>>13,g+=k*D,g+=C*I,g+=T*M,g+=P*j,p=(g+=O*U)>>>13,g&=8191,g+=A*(5*q),g+=E*(5*H),g+=x*(5*z),g+=L*(5*B),v=p+=(g+=R*(5*N))>>>13,v+=k*N,v+=C*D,v+=T*I,v+=P*M,p=(v+=O*j)>>>13,v&=8191,v+=A*U,v+=E*(5*q),v+=x*(5*H),v+=L*(5*z),b=p+=(v+=R*(5*B))>>>13,b+=k*B,b+=C*N,b+=T*D,b+=P*I,p=(b+=O*M)>>>13,b&=8191,b+=A*j,b+=E*U,b+=x*(5*q),b+=L*(5*H),m=p+=(b+=R*(5*z))>>>13,m+=k*z,m+=C*B,m+=T*N,m+=P*D,p=(m+=O*I)>>>13,m&=8191,m+=A*M,m+=E*j,m+=x*U,m+=L*(5*q),w=p+=(m+=R*(5*H))>>>13,w+=k*H,w+=C*z,w+=T*B,w+=P*N,p=(w+=O*D)>>>13,w&=8191,w+=A*I,w+=E*M,w+=x*j,w+=L*U,_=p+=(w+=R*(5*q))>>>13,_+=k*q,_+=C*H,_+=T*z,_+=P*B,p=(_+=O*N)>>>13,_&=8191,_+=A*D,_+=E*I,_+=x*M,_+=L*j,k=l=8191&(p=(p=((p+=(_+=R*U)>>>13)<<2)+p|0)+(l&=8191)|0),C=f+=p>>>=13,T=d&=8191,P=y&=8191,O=g&=8191,A=v&=8191,E=b&=8191,x=m&=8191,L=w&=8191,R=_&=8191,e+=16,n-=16;this.h[0]=k,this.h[1]=C,this.h[2]=T,this.h[3]=P,this.h[4]=O,this.h[5]=A,this.h[6]=E,this.h[7]=x,this.h[8]=L,this.h[9]=R},T.prototype.finish=function(t,e){var n,r,o,i,s=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,s[0]=this.h[0]+5,n=s[0]>>>13,s[0]&=8191,i=1;i<10;i++)s[i]=this.h[i]+n,n=s[i]>>>13,s[i]&=8191;for(s[9]-=8192,r=(1^n)-1,i=0;i<10;i++)s[i]&=r;for(r=~r,i=0;i<10;i++)this.h[i]=this.h[i]&r|s[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;t[e+0]=this.h[0]>>>0&255,t[e+1]=this.h[0]>>>8&255,t[e+2]=this.h[1]>>>0&255,t[e+3]=this.h[1]>>>8&255,t[e+4]=this.h[2]>>>0&255,t[e+5]=this.h[2]>>>8&255,t[e+6]=this.h[3]>>>0&255,t[e+7]=this.h[3]>>>8&255,t[e+8]=this.h[4]>>>0&255,t[e+9]=this.h[4]>>>8&255,t[e+10]=this.h[5]>>>0&255,t[e+11]=this.h[5]>>>8&255,t[e+12]=this.h[6]>>>0&255,t[e+13]=this.h[6]>>>8&255,t[e+14]=this.h[7]>>>0&255,t[e+15]=this.h[7]>>>8&255},T.prototype.update=function(t,e,n){var r,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),r=0;r<o;r++)this.buffer[this.leftover+r]=t[e+r];if(n-=o,e+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(o=n-n%16,this.blocks(t,e,o),e+=o,n-=o),n){for(r=0;r<n;r++)this.buffer[this.leftover+r]=t[e+r];this.leftover+=n}};var K=A,W=E;var G=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function V(t,e,n,r){for(var o,i,s,a,c,u,h,p,l,f,d,y,g,v,b,m,w,_,S,k,C,T,P,O,A,E,x=new Int32Array(16),L=new Int32Array(16),R=t[0],U=t[1],j=t[2],M=t[3],I=t[4],D=t[5],N=t[6],B=t[7],z=e[0],H=e[1],q=e[2],F=e[3],X=e[4],J=e[5],Y=e[6],K=e[7],W=0;r>=128;){for(S=0;S<16;S++)k=8*S+W,x[S]=n[k+0]<<24|n[k+1]<<16|n[k+2]<<8|n[k+3],L[S]=n[k+4]<<24|n[k+5]<<16|n[k+6]<<8|n[k+7];for(S=0;S<80;S++)if(o=R,i=U,s=j,a=M,c=I,u=D,h=N,B,l=z,f=H,d=q,y=F,g=X,v=J,b=Y,K,P=65535&(T=K),O=T>>>16,A=65535&(C=B),E=C>>>16,P+=65535&(T=(X>>>14|I<<18)^(X>>>18|I<<14)^(I>>>9|X<<23)),O+=T>>>16,A+=65535&(C=(I>>>14|X<<18)^(I>>>18|X<<14)^(X>>>9|I<<23)),E+=C>>>16,P+=65535&(T=X&J^~X&Y),O+=T>>>16,A+=65535&(C=I&D^~I&N),E+=C>>>16,P+=65535&(T=G[2*S+1]),O+=T>>>16,A+=65535&(C=G[2*S]),E+=C>>>16,C=x[S%16],O+=(T=L[S%16])>>>16,A+=65535&C,E+=C>>>16,A+=(O+=(P+=65535&T)>>>16)>>>16,P=65535&(T=_=65535&P|O<<16),O=T>>>16,A=65535&(C=w=65535&A|(E+=A>>>16)<<16),E=C>>>16,P+=65535&(T=(z>>>28|R<<4)^(R>>>2|z<<30)^(R>>>7|z<<25)),O+=T>>>16,A+=65535&(C=(R>>>28|z<<4)^(z>>>2|R<<30)^(z>>>7|R<<25)),E+=C>>>16,O+=(T=z&H^z&q^H&q)>>>16,A+=65535&(C=R&U^R&j^U&j),E+=C>>>16,p=65535&(A+=(O+=(P+=65535&T)>>>16)>>>16)|(E+=A>>>16)<<16,m=65535&P|O<<16,P=65535&(T=y),O=T>>>16,A=65535&(C=a),E=C>>>16,O+=(T=_)>>>16,A+=65535&(C=w),E+=C>>>16,U=o,j=i,M=s,I=a=65535&(A+=(O+=(P+=65535&T)>>>16)>>>16)|(E+=A>>>16)<<16,D=c,N=u,B=h,R=p,H=l,q=f,F=d,X=y=65535&P|O<<16,J=g,Y=v,K=b,z=m,S%16==15)for(k=0;k<16;k++)C=x[k],P=65535&(T=L[k]),O=T>>>16,A=65535&C,E=C>>>16,C=x[(k+9)%16],P+=65535&(T=L[(k+9)%16]),O+=T>>>16,A+=65535&C,E+=C>>>16,w=x[(k+1)%16],P+=65535&(T=((_=L[(k+1)%16])>>>1|w<<31)^(_>>>8|w<<24)^(_>>>7|w<<25)),O+=T>>>16,A+=65535&(C=(w>>>1|_<<31)^(w>>>8|_<<24)^w>>>7),E+=C>>>16,w=x[(k+14)%16],O+=(T=((_=L[(k+14)%16])>>>19|w<<13)^(w>>>29|_<<3)^(_>>>6|w<<26))>>>16,A+=65535&(C=(w>>>19|_<<13)^(_>>>29|w<<3)^w>>>6),E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,x[k]=65535&A|E<<16,L[k]=65535&P|O<<16;P=65535&(T=z),O=T>>>16,A=65535&(C=R),E=C>>>16,C=t[0],O+=(T=e[0])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[0]=R=65535&A|E<<16,e[0]=z=65535&P|O<<16,P=65535&(T=H),O=T>>>16,A=65535&(C=U),E=C>>>16,C=t[1],O+=(T=e[1])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[1]=U=65535&A|E<<16,e[1]=H=65535&P|O<<16,P=65535&(T=q),O=T>>>16,A=65535&(C=j),E=C>>>16,C=t[2],O+=(T=e[2])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[2]=j=65535&A|E<<16,e[2]=q=65535&P|O<<16,P=65535&(T=F),O=T>>>16,A=65535&(C=M),E=C>>>16,C=t[3],O+=(T=e[3])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[3]=M=65535&A|E<<16,e[3]=F=65535&P|O<<16,P=65535&(T=X),O=T>>>16,A=65535&(C=I),E=C>>>16,C=t[4],O+=(T=e[4])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[4]=I=65535&A|E<<16,e[4]=X=65535&P|O<<16,P=65535&(T=J),O=T>>>16,A=65535&(C=D),E=C>>>16,C=t[5],O+=(T=e[5])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[5]=D=65535&A|E<<16,e[5]=J=65535&P|O<<16,P=65535&(T=Y),O=T>>>16,A=65535&(C=N),E=C>>>16,C=t[6],O+=(T=e[6])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[6]=N=65535&A|E<<16,e[6]=Y=65535&P|O<<16,P=65535&(T=K),O=T>>>16,A=65535&(C=B),E=C>>>16,C=t[7],O+=(T=e[7])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[7]=B=65535&A|E<<16,e[7]=K=65535&P|O<<16,W+=128,r-=128}return r}function Z(t,e,n){var r,o=new Int32Array(8),i=new Int32Array(8),s=new Uint8Array(256),a=n;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,V(o,i,e,n),n%=128,r=0;r<n;r++)s[r]=e[a-n+r];for(s[n]=128,s[(n=256-128*(n<112?1:0))-9]=0,d(s,n-8,a/536870912|0,a<<3),V(o,i,s,n),r=0;r<8;r++)d(t,8*r,o[r],i[r]);return 0}function Q(t,n){var r=e(),o=e(),i=e(),s=e(),a=e(),c=e(),u=e(),p=e(),l=e();N(r,t[1],t[0]),N(l,n[1],n[0]),B(r,r,l),D(o,t[0],t[1]),D(l,n[0],n[1]),B(o,o,l),B(i,t[3],n[3]),B(i,i,h),B(s,t[2],n[2]),D(s,s,s),N(a,o,r),N(c,s,i),D(u,s,i),D(p,o,r),B(t[0],a,c),B(t[1],p,u),B(t[2],u,c),B(t[3],a,p)}function $(t,e,n){var r;for(r=0;r<4;r++)R(t[r],e[r],n)}function tt(t,n){var r=e(),o=e(),i=e();H(i,n[2]),B(r,n[0],i),B(o,n[1],i),U(t,o),t[31]^=M(r)<<7}function et(t,e,n){var r,o;for(x(t[0],s),x(t[1],a),x(t[2],a),x(t[3],s),o=255;o>=0;--o)$(t,e,r=n[o/8|0]>>(7&o)&1),Q(e,t),Q(t,t),$(t,e,r)}function nt(t,n){var r=[e(),e(),e(),e()];x(r[0],p),x(r[1],l),x(r[2],a),B(r[3],p,l),et(t,r,n)}function rt(t,n,o){var i,s=new Uint8Array(64),a=[e(),e(),e(),e()];for(o||r(n,32),Z(s,n,32),s[0]&=248,s[31]&=127,s[31]|=64,nt(a,s),tt(t,a),i=0;i<32;i++)n[i+32]=t[i];return 0}var ot=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function it(t,e){var n,r,o,i;for(r=63;r>=32;--r){for(n=0,o=r-32,i=r-12;o<i;++o)e[o]+=n-16*e[r]*ot[o-(r-32)],n=Math.floor((e[o]+128)/256),e[o]-=256*n;e[o]+=n,e[r]=0}for(n=0,o=0;o<32;o++)e[o]+=n-(e[31]>>4)*ot[o],n=e[o]>>8,e[o]&=255;for(o=0;o<32;o++)e[o]-=n*ot[o];for(r=0;r<32;r++)e[r+1]+=e[r]>>8,t[r]=255&e[r]}function st(t){var e,n=new Float64Array(64);for(e=0;e<64;e++)n[e]=t[e];for(e=0;e<64;e++)t[e]=0;it(t,n)}function at(t,n,r,o){var i,s,a=new Uint8Array(64),c=new Uint8Array(64),u=new Uint8Array(64),h=new Float64Array(64),p=[e(),e(),e(),e()];Z(a,o,32),a[0]&=248,a[31]&=127,a[31]|=64;var l=r+64;for(i=0;i<r;i++)t[64+i]=n[i];for(i=0;i<32;i++)t[32+i]=a[32+i];for(Z(u,t.subarray(32),r+32),st(u),nt(p,u),tt(t,p),i=32;i<64;i++)t[i]=o[i];for(Z(c,t,r+64),st(c),i=0;i<64;i++)h[i]=0;for(i=0;i<32;i++)h[i]=u[i];for(i=0;i<32;i++)for(s=0;s<32;s++)h[i+s]+=c[i]*a[s];return it(t.subarray(32),h),l}function ct(t,n,r,o){var i,c=new Uint8Array(32),h=new Uint8Array(64),p=[e(),e(),e(),e()],l=[e(),e(),e(),e()];if(r<64)return-1;if(function(t,n){var r=e(),o=e(),i=e(),c=e(),h=e(),p=e(),l=e();return x(t[2],a),I(t[1],n),z(i,t[1]),B(c,i,u),N(i,i,t[2]),D(c,t[2],c),z(h,c),z(p,h),B(l,p,h),B(r,l,i),B(r,r,c),q(r,r),B(r,r,i),B(r,r,c),B(r,r,c),B(t[0],r,c),z(o,t[0]),B(o,o,c),j(o,i)&&B(t[0],t[0],f),z(o,t[0]),B(o,o,c),j(o,i)?-1:(M(t[0])===n[31]>>7&&N(t[0],s,t[0]),B(t[3],t[0],t[1]),0)}(l,o))return-1;for(i=0;i<r;i++)t[i]=n[i];for(i=0;i<32;i++)t[i+32]=o[i];if(Z(h,t,r),st(h),et(p,l,h),nt(l,n.subarray(32)),Q(p,l),tt(c,p),r-=64,v(n,0,c,0)){for(i=0;i<r;i++)t[i]=0;return-1}for(i=0;i<r;i++)t[i]=n[i+64];return r}function ut(t,e){if(32!==t.length)throw new Error("bad key size");if(24!==e.length)throw new Error("bad nonce size")}function ht(){for(var t=0;t<arguments.length;t++)if(!(arguments[t]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function pt(t){for(var e=0;e<t.length;e++)t[e]=0}t.lowlevel={crypto_core_hsalsa20:m,crypto_stream_xor:C,crypto_stream:k,crypto_stream_salsa20_xor:_,crypto_stream_salsa20:S,crypto_onetimeauth:P,crypto_onetimeauth_verify:O,crypto_verify_16:g,crypto_verify_32:v,crypto_secretbox:A,crypto_secretbox_open:E,crypto_scalarmult:F,crypto_scalarmult_base:X,crypto_box_beforenm:Y,crypto_box_afternm:K,crypto_box:function(t,e,n,r,o,i){var s=new Uint8Array(32);return Y(s,o,i),K(t,e,n,r,s)},crypto_box_open:function(t,e,n,r,o,i){var s=new Uint8Array(32);return Y(s,o,i),W(t,e,n,r,s)},crypto_box_keypair:J,crypto_hash:Z,crypto_sign:at,crypto_sign_keypair:rt,crypto_sign_open:ct,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:64,crypto_sign_PUBLICKEYBYTES:32,crypto_sign_SECRETKEYBYTES:64,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:e,D:u,L:ot,pack25519:U,unpack25519:I,M:B,A:D,S:z,Z:N,pow2523:q,add:Q,set25519:x,modL:it,scalarmult:et,scalarbase:nt},t.randomBytes=function(t){var e=new Uint8Array(t);return r(e,t),e},t.secretbox=function(t,e,n){ht(t,e,n),ut(n,e);for(var r=new Uint8Array(32+t.length),o=new Uint8Array(r.length),i=0;i<t.length;i++)r[i+32]=t[i];return A(o,r,r.length,e,n),o.subarray(16)},t.secretbox.open=function(t,e,n){ht(t,e,n),ut(n,e);for(var r=new Uint8Array(16+t.length),o=new Uint8Array(r.length),i=0;i<t.length;i++)r[i+16]=t[i];return r.length<32||0!==E(o,r,r.length,e,n)?null:o.subarray(32)},t.secretbox.keyLength=32,t.secretbox.nonceLength=24,t.secretbox.overheadLength=16,t.scalarMult=function(t,e){if(ht(t,e),32!==t.length)throw new Error("bad n size");if(32!==e.length)throw new Error("bad p size");var n=new Uint8Array(32);return F(n,t,e),n},t.scalarMult.base=function(t){if(ht(t),32!==t.length)throw new Error("bad n size");var e=new Uint8Array(32);return X(e,t),e},t.scalarMult.scalarLength=32,t.scalarMult.groupElementLength=32,t.box=function(e,n,r,o){var i=t.box.before(r,o);return t.secretbox(e,n,i)},t.box.before=function(t,e){ht(t,e),function(t,e){if(32!==t.length)throw new Error("bad public key size");if(32!==e.length)throw new Error("bad secret key size")}(t,e);var n=new Uint8Array(32);return Y(n,t,e),n},t.box.after=t.secretbox,t.box.open=function(e,n,r,o){var i=t.box.before(r,o);return t.secretbox.open(e,n,i)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var t=new Uint8Array(32),e=new Uint8Array(32);return J(t,e),{publicKey:t,secretKey:e}},t.box.keyPair.fromSecretKey=function(t){if(ht(t),32!==t.length)throw new Error("bad secret key size");var e=new Uint8Array(32);return X(e,t),{publicKey:e,secretKey:new Uint8Array(t)}},t.box.publicKeyLength=32,t.box.secretKeyLength=32,t.box.sharedKeyLength=32,t.box.nonceLength=24,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(t,e){if(ht(t,e),64!==e.length)throw new Error("bad secret key size");var n=new Uint8Array(64+t.length);return at(n,t,t.length,e),n},t.sign.open=function(t,e){if(ht(t,e),32!==e.length)throw new Error("bad public key size");var n=new Uint8Array(t.length),r=ct(n,t,t.length,e);if(r<0)return null;for(var o=new Uint8Array(r),i=0;i<o.length;i++)o[i]=n[i];return o},t.sign.detached=function(e,n){for(var r=t.sign(e,n),o=new Uint8Array(64),i=0;i<o.length;i++)o[i]=r[i];return o},t.sign.detached.verify=function(t,e,n){if(ht(t,e,n),64!==e.length)throw new Error("bad signature size");if(32!==n.length)throw new Error("bad public key size");var r,o=new Uint8Array(64+t.length),i=new Uint8Array(64+t.length);for(r=0;r<64;r++)o[r]=e[r];for(r=0;r<t.length;r++)o[r+64]=t[r];return ct(i,o,o.length,n)>=0},t.sign.keyPair=function(){var t=new Uint8Array(32),e=new Uint8Array(64);return rt(t,e),{publicKey:t,secretKey:e}},t.sign.keyPair.fromSecretKey=function(t){if(ht(t),64!==t.length)throw new Error("bad secret key size");for(var e=new Uint8Array(32),n=0;n<e.length;n++)e[n]=t[32+n];return{publicKey:e,secretKey:new Uint8Array(t)}},t.sign.keyPair.fromSeed=function(t){if(ht(t),32!==t.length)throw new Error("bad seed size");for(var e=new Uint8Array(32),n=new Uint8Array(64),r=0;r<32;r++)n[r]=t[r];return rt(e,n,!0),{publicKey:e,secretKey:n}},t.sign.publicKeyLength=32,t.sign.secretKeyLength=64,t.sign.seedLength=32,t.sign.signatureLength=64,t.hash=function(t){ht(t);var e=new Uint8Array(64);return Z(e,t,t.length),e},t.hash.hashLength=64,t.verify=function(t,e){return ht(t,e),0!==t.length&&0!==e.length&&(t.length===e.length&&0===y(t,0,e,0,t.length))},t.setPRNG=function(t){r=t},function(){var e="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(e&&e.getRandomValues){t.setPRNG((function(t,n){var r,o=new Uint8Array(n);for(r=0;r<n;r+=65536)e.getRandomValues(o.subarray(r,r+Math.min(n-r,65536)));for(r=0;r<n;r++)t[r]=o[r];pt(o)}))}else(e=n(4))&&e.randomBytes&&t.setPRNG((function(t,n){var r,o=e.randomBytes(n);for(r=0;r<n;r++)t[r]=o[r];pt(o)}))}()}(t.exports?t.exports:self.nacl=self.nacl||{})},function(t,e,n){t.exports=n(5).default},function(t,e){},function(t,e,n){"use strict";n.r(e);var r,o=function(){function t(t,e){this.lastId=0,this.prefix=t,this.name=e}return t.prototype.create=function(t){this.lastId++;var e=this.lastId,n=this.prefix+e,r=this.name+"["+e+"]",o=!1,i=function(){o||(t.apply(null,arguments),o=!0)};return this[e]=i,{number:e,id:n,name:r,callback:i}},t.prototype.remove=function(t){delete this[t.number]},t}(),i=new o("_pusher_script_","Pusher.ScriptReceivers"),s={VERSION:"7.4.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,cluster:"mt1",userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},a=function(){function t(t){this.options=t,this.receivers=t.receivers||i,this.loading={}}return t.prototype.load=function(t,e,n){var r=this;if(r.loading[t]&&r.loading[t].length>0)r.loading[t].push(n);else{r.loading[t]=[n];var o=Ce.createScriptRequest(r.getPath(t,e)),i=r.receivers.create((function(e){if(r.receivers.remove(i),r.loading[t]){var n=r.loading[t];delete r.loading[t];for(var s=function(t){t||o.cleanup()},a=0;a<n.length;a++)n[a](e,s)}}));o.send(i)}},t.prototype.getRoot=function(t){var e=Ce.getDocument().location.protocol;return(t&&t.useTLS||"https:"===e?this.options.cdn_https:this.options.cdn_http).replace(/\/*$/,"")+"/"+this.options.version},t.prototype.getPath=function(t,e){return this.getRoot(e)+"/"+t+this.options.suffix+".js"},t}(),c=new o("_pusher_dependencies","Pusher.DependenciesReceivers"),u=new a({cdn_http:s.cdn_http,cdn_https:s.cdn_https,version:s.VERSION,suffix:s.dependency_suffix,receivers:c}),h={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},p=function(t){var e,n=h.urls[t];return n?(n.fullUrl?e=n.fullUrl:n.path&&(e=h.baseUrl+n.path),e?"See: "+e:""):""};!function(t){t.UserAuthentication="user-authentication",t.ChannelAuthorization="channel-authorization"}(r||(r={}));var l,f=(l=function(t,e){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return f(e,t),e}(Error),y=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return f(e,t),e}(Error),g=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return f(e,t),e}(Error),v=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return f(e,t),e}(Error),b=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return f(e,t),e}(Error),m=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return f(e,t),e}(Error),w=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return f(e,t),e}(Error),_=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return f(e,t),e}(Error),S=function(t){function e(e,n){var r=this.constructor,o=t.call(this,n)||this;return o.status=e,Object.setPrototypeOf(o,r.prototype),o}return f(e,t),e}(Error),k=function(t,e,n,o,i){var s=Ce.createXHR();for(var a in s.open("POST",n.endpoint,!0),s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.headers)s.setRequestHeader(a,n.headers[a]);return s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status){var t=void 0,e=!1;try{t=JSON.parse(s.responseText),e=!0}catch(t){i(new S(200,"JSON returned from "+o.toString()+" endpoint was invalid, yet status code was 200. Data was: "+s.responseText),null)}e&&i(null,t)}else{var a="";switch(o){case r.UserAuthentication:a=p("authenticationEndpoint");break;case r.ChannelAuthorization:a="Clients must be authenticated to join private or presence channels. "+p("authorizationEndpoint")}i(new S(s.status,"Unable to retrieve auth string from "+o.toString()+" endpoint - received status: "+s.status+" from "+n.endpoint+". "+a),null)}},s.send(e),s};for(var C=String.fromCharCode,T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",P={},O=0,A=T.length;O<A;O++)P[T.charAt(O)]=O;var E=function(t){var e=t.charCodeAt(0);return e<128?t:e<2048?C(192|e>>>6)+C(128|63&e):C(224|e>>>12&15)+C(128|e>>>6&63)+C(128|63&e)},x=function(t){return t.replace(/[^\x00-\x7F]/g,E)},L=function(t){var e=[0,2,1][t.length%3],n=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[T.charAt(n>>>18),T.charAt(n>>>12&63),e>=2?"=":T.charAt(n>>>6&63),e>=1?"=":T.charAt(63&n)].join("")},R=window.btoa||function(t){return t.replace(/[\s\S]{1,3}/g,L)},U=function(){function t(t,e,n,r){var o=this;this.clear=e,this.timer=t((function(){o.timer&&(o.timer=r(o.timer))}),n)}return t.prototype.isRunning=function(){return null!==this.timer},t.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},t}(),j=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function M(t){window.clearTimeout(t)}function I(t){window.clearInterval(t)}var D=function(t){function e(e,n){return t.call(this,setTimeout,M,e,(function(t){return n(),null}))||this}return j(e,t),e}(U),N=function(t){function e(e,n){return t.call(this,setInterval,I,e,(function(t){return n(),t}))||this}return j(e,t),e}(U),B={now:function(){return Date.now?Date.now():(new Date).valueOf()},defer:function(t){return new D(0,t)},method:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=Array.prototype.slice.call(arguments,1);return function(e){return e[t].apply(e,r.concat(arguments))}}};function z(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o=e[r];for(var i in o)o[i]&&o[i].constructor&&o[i].constructor===Object?t[i]=z(t[i]||{},o[i]):t[i]=o[i]}return t}function H(){for(var t=["Pusher"],e=0;e<arguments.length;e++)"string"==typeof arguments[e]?t.push(arguments[e]):t.push(Q(arguments[e]));return t.join(" : ")}function q(t,e){var n=Array.prototype.indexOf;if(null===t)return-1;if(n&&t.indexOf===n)return t.indexOf(e);for(var r=0,o=t.length;r<o;r++)if(t[r]===e)return r;return-1}function F(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(t[n],n,t)}function X(t){var e=[];return F(t,(function(t,n){e.push(n)})),e}function J(t,e,n){for(var r=0;r<t.length;r++)e.call(n||window,t[r],r,t)}function Y(t,e){for(var n=[],r=0;r<t.length;r++)n.push(e(t[r],r,t,n));return n}function K(t,e){e=e||function(t){return!!t};for(var n=[],r=0;r<t.length;r++)e(t[r],r,t,n)&&n.push(t[r]);return n}function W(t,e){var n={};return F(t,(function(r,o){(e&&e(r,o,t,n)||Boolean(r))&&(n[o]=r)})),n}function G(t,e){for(var n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1}function V(t){return e=function(t){return"object"==typeof t&&(t=Q(t)),encodeURIComponent((e=t.toString(),R(x(e))));var e},n={},F(t,(function(t,r){n[r]=e(t)})),n;var e,n}function Z(t){var e,n,r=W(t,(function(t){return void 0!==t}));return Y((e=V(r),n=[],F(e,(function(t,e){n.push([e,t])})),n),B.method("join","=")).join("&")}function Q(t){try{return JSON.stringify(t)}catch(r){return JSON.stringify((e=[],n=[],function t(r,o){var i,s,a;switch(typeof r){case"object":if(!r)return null;for(i=0;i<e.length;i+=1)if(e[i]===r)return{$ref:n[i]};if(e.push(r),n.push(o),"[object Array]"===Object.prototype.toString.apply(r))for(a=[],i=0;i<r.length;i+=1)a[i]=t(r[i],o+"["+i+"]");else for(s in a={},r)Object.prototype.hasOwnProperty.call(r,s)&&(a[s]=t(r[s],o+"["+JSON.stringify(s)+"]"));return a;case"number":case"string":case"boolean":return r}}(t,"$")))}var e,n}var $=new(function(){function t(){this.globalLog=function(t){window.console&&window.console.log&&window.console.log(t)}}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.log(this.globalLog,t)},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.log(this.globalLogWarn,t)},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.log(this.globalLogError,t)},t.prototype.globalLogWarn=function(t){window.console&&window.console.warn?window.console.warn(t):this.globalLog(t)},t.prototype.globalLogError=function(t){window.console&&window.console.error?window.console.error(t):this.globalLogWarn(t)},t.prototype.log=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=H.apply(this,arguments);if(Ye.log)Ye.log(r);else if(Ye.logToConsole){var o=t.bind(this);o(r)}},t}()),tt=function(t,e,n,r,o){void 0!==n.headers&&$.warn("To send headers with the "+r.toString()+" request, you must use AJAX, rather than JSONP.");var i=t.nextAuthCallbackID.toString();t.nextAuthCallbackID++;var s=t.getDocument(),a=s.createElement("script");t.auth_callbacks[i]=function(t){o(null,t)};var c="Pusher.auth_callbacks['"+i+"']";a.src=n.endpoint+"?callback="+encodeURIComponent(c)+"&"+e;var u=s.getElementsByTagName("head")[0]||s.documentElement;u.insertBefore(a,u.firstChild)},et=function(){function t(t){this.src=t}return t.prototype.send=function(t){var e=this,n="Error loading "+e.src;e.script=document.createElement("script"),e.script.id=t.id,e.script.src=e.src,e.script.type="text/javascript",e.script.charset="UTF-8",e.script.addEventListener?(e.script.onerror=function(){t.callback(n)},e.script.onload=function(){t.callback(null)}):e.script.onreadystatechange=function(){"loaded"!==e.script.readyState&&"complete"!==e.script.readyState||t.callback(null)},void 0===e.script.async&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(e.errorScript=document.createElement("script"),e.errorScript.id=t.id+"_error",e.errorScript.text=t.name+"('"+n+"');",e.script.async=e.errorScript.async=!1):e.script.async=!0;var r=document.getElementsByTagName("head")[0];r.insertBefore(e.script,r.firstChild),e.errorScript&&r.insertBefore(e.errorScript,e.script.nextSibling)},t.prototype.cleanup=function(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null},t}(),nt=function(){function t(t,e){this.url=t,this.data=e}return t.prototype.send=function(t){if(!this.request){var e=Z(this.data),n=this.url+"/"+t.number+"?"+e;this.request=Ce.createScriptRequest(n),this.request.send(t)}},t.prototype.cleanup=function(){this.request&&this.request.cleanup()},t}(),rt={name:"jsonp",getAgent:function(t,e){return function(n,r){var o="http"+(e?"s":"")+"://"+(t.host||t.options.host)+t.options.path,s=Ce.createJSONPRequest(o,n),a=Ce.ScriptReceivers.create((function(e,n){i.remove(a),s.cleanup(),n&&n.host&&(t.host=n.host),r&&r(e,n)}));s.send(a)}}};function ot(t,e,n){return t+(e.useTLS?"s":"")+"://"+(e.useTLS?e.hostTLS:e.hostNonTLS)+n}function it(t,e){return"/app/"+t+("?protocol="+s.PROTOCOL+"&client=js&version="+s.VERSION+(e?"&"+e:""))}var st={getInitial:function(t,e){return ot("ws",e,(e.httpPath||"")+it(t,"flash=false"))}},at={getInitial:function(t,e){return ot("http",e,(e.httpPath||"/pusher")+it(t))}},ct={getInitial:function(t,e){return ot("http",e,e.httpPath||"/pusher")},getPath:function(t,e){return it(t)}},ut=function(){function t(){this._callbacks={}}return t.prototype.get=function(t){return this._callbacks[ht(t)]},t.prototype.add=function(t,e,n){var r=ht(t);this._callbacks[r]=this._callbacks[r]||[],this._callbacks[r].push({fn:e,context:n})},t.prototype.remove=function(t,e,n){if(t||e||n){var r=t?[ht(t)]:X(this._callbacks);e||n?this.removeCallback(r,e,n):this.removeAllCallbacks(r)}else this._callbacks={}},t.prototype.removeCallback=function(t,e,n){J(t,(function(t){this._callbacks[t]=K(this._callbacks[t]||[],(function(t){return e&&e!==t.fn||n&&n!==t.context})),0===this._callbacks[t].length&&delete this._callbacks[t]}),this)},t.prototype.removeAllCallbacks=function(t){J(t,(function(t){delete this._callbacks[t]}),this)},t}();function ht(t){return"_"+t}var pt=function(){function t(t){this.callbacks=new ut,this.global_callbacks=[],this.failThrough=t}return t.prototype.bind=function(t,e,n){return this.callbacks.add(t,e,n),this},t.prototype.bind_global=function(t){return this.global_callbacks.push(t),this},t.prototype.unbind=function(t,e,n){return this.callbacks.remove(t,e,n),this},t.prototype.unbind_global=function(t){return t?(this.global_callbacks=K(this.global_callbacks||[],(function(e){return e!==t})),this):(this.global_callbacks=[],this)},t.prototype.unbind_all=function(){return this.unbind(),this.unbind_global(),this},t.prototype.emit=function(t,e,n){for(var r=0;r<this.global_callbacks.length;r++)this.global_callbacks[r](t,e);var o=this.callbacks.get(t),i=[];if(n?i.push(e,n):e&&i.push(e),o&&o.length>0)for(r=0;r<o.length;r++)o[r].fn.apply(o[r].context||window,i);else this.failThrough&&this.failThrough(t,e);return this},t}(),lt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ft=function(t){function e(e,n,r,o,i){var s=t.call(this)||this;return s.initialize=Ce.transportConnectionInitializer,s.hooks=e,s.name=n,s.priority=r,s.key=o,s.options=i,s.state="new",s.timeline=i.timeline,s.activityTimeout=i.activityTimeout,s.id=s.timeline.generateUniqueID(),s}return lt(e,t),e.prototype.handlesActivityChecks=function(){return Boolean(this.hooks.handlesActivityChecks)},e.prototype.supportsPing=function(){return Boolean(this.hooks.supportsPing)},e.prototype.connect=function(){var t=this;if(this.socket||"initialized"!==this.state)return!1;var e=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(e,this.options)}catch(e){return B.defer((function(){t.onError(e),t.changeState("closed")})),!1}return this.bindListeners(),$.debug("Connecting",{transport:this.name,url:e}),this.changeState("connecting"),!0},e.prototype.close=function(){return!!this.socket&&(this.socket.close(),!0)},e.prototype.send=function(t){var e=this;return"open"===this.state&&(B.defer((function(){e.socket&&e.socket.send(t)})),!0)},e.prototype.ping=function(){"open"===this.state&&this.supportsPing()&&this.socket.ping()},e.prototype.onOpen=function(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0},e.prototype.onError=function(t){this.emit("error",{type:"WebSocketError",error:t}),this.timeline.error(this.buildTimelineMessage({error:t.toString()}))},e.prototype.onClose=function(t){t?this.changeState("closed",{code:t.code,reason:t.reason,wasClean:t.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0},e.prototype.onMessage=function(t){this.emit("message",t)},e.prototype.onActivity=function(){this.emit("activity")},e.prototype.bindListeners=function(){var t=this;this.socket.onopen=function(){t.onOpen()},this.socket.onerror=function(e){t.onError(e)},this.socket.onclose=function(e){t.onClose(e)},this.socket.onmessage=function(e){t.onMessage(e)},this.supportsPing()&&(this.socket.onactivity=function(){t.onActivity()})},e.prototype.unbindListeners=function(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))},e.prototype.changeState=function(t,e){this.state=t,this.timeline.info(this.buildTimelineMessage({state:t,params:e})),this.emit(t,e)},e.prototype.buildTimelineMessage=function(t){return z({cid:this.id},t)},e}(pt),dt=function(){function t(t){this.hooks=t}return t.prototype.isSupported=function(t){return this.hooks.isSupported(t)},t.prototype.createConnection=function(t,e,n,r){return new ft(this.hooks,t,e,n,r)},t}(),yt=new dt({urls:st,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return Boolean(Ce.getWebSocketAPI())},isSupported:function(){return Boolean(Ce.getWebSocketAPI())},getSocket:function(t){return Ce.createWebSocket(t)}}),gt={urls:at,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},vt=z({getSocket:function(t){return Ce.HTTPFactory.createStreamingSocket(t)}},gt),bt=z({getSocket:function(t){return Ce.HTTPFactory.createPollingSocket(t)}},gt),mt={isSupported:function(){return Ce.isXHRSupported()}},wt={ws:yt,xhr_streaming:new dt(z({},vt,mt)),xhr_polling:new dt(z({},bt,mt))},_t=new dt({file:"sockjs",urls:ct,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return void 0!==window.SockJS},getSocket:function(t,e){return new window.SockJS(t,null,{js_path:u.getPath("sockjs",{useTLS:e.useTLS}),ignore_null_origin:e.ignoreNullOrigin})},beforeOpen:function(t,e){t.send(JSON.stringify({path:e}))}}),St={isSupported:function(t){return Ce.isXDRSupported(t.useTLS)}},kt=new dt(z({},vt,St)),Ct=new dt(z({},bt,St));wt.xdr_streaming=kt,wt.xdr_polling=Ct,wt.sockjs=_t;var Tt=wt,Pt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ot=new(function(t){function e(){var e=t.call(this)||this,n=e;return void 0!==window.addEventListener&&(window.addEventListener("online",(function(){n.emit("online")}),!1),window.addEventListener("offline",(function(){n.emit("offline")}),!1)),e}return Pt(e,t),e.prototype.isOnline=function(){return void 0===window.navigator.onLine||window.navigator.onLine},e}(pt)),At=function(){function t(t,e,n){this.manager=t,this.transport=e,this.minPingDelay=n.minPingDelay,this.maxPingDelay=n.maxPingDelay,this.pingDelay=void 0}return t.prototype.createConnection=function(t,e,n,r){var o=this;r=z({},r,{activityTimeout:this.pingDelay});var i=this.transport.createConnection(t,e,n,r),s=null,a=function(){i.unbind("open",a),i.bind("closed",c),s=B.now()},c=function(t){if(i.unbind("closed",c),1002===t.code||1003===t.code)o.manager.reportDeath();else if(!t.wasClean&&s){var e=B.now()-s;e<2*o.maxPingDelay&&(o.manager.reportDeath(),o.pingDelay=Math.max(e/2,o.minPingDelay))}};return i.bind("open",a),i},t.prototype.isSupported=function(t){return this.manager.isAlive()&&this.transport.isSupported(t)},t}(),Et={decodeMessage:function(t){try{var e=JSON.parse(t.data),n=e.data;if("string"==typeof n)try{n=JSON.parse(e.data)}catch(t){}var r={event:e.event,channel:e.channel,data:n};return e.user_id&&(r.user_id=e.user_id),r}catch(e){throw{type:"MessageParseError",error:e,data:t.data}}},encodeMessage:function(t){return JSON.stringify(t)},processHandshake:function(t){var e=Et.decodeMessage(t);if("pusher:connection_established"===e.event){if(!e.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:e.data.socket_id,activityTimeout:1e3*e.data.activity_timeout}}if("pusher:error"===e.event)return{action:this.getCloseAction(e.data),error:this.getCloseError(e.data)};throw"Invalid handshake"},getCloseAction:function(t){return t.code<4e3?t.code>=1002&&t.code<=1004?"backoff":null:4e3===t.code?"tls_only":t.code<4100?"refused":t.code<4200?"backoff":t.code<4300?"retry":"refused"},getCloseError:function(t){return 1e3!==t.code&&1001!==t.code?{type:"PusherError",data:{code:t.code,message:t.reason||t.message}}:null}},xt=Et,Lt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rt=function(t){function e(e,n){var r=t.call(this)||this;return r.id=e,r.transport=n,r.activityTimeout=n.activityTimeout,r.bindListeners(),r}return Lt(e,t),e.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},e.prototype.send=function(t){return this.transport.send(t)},e.prototype.send_event=function(t,e,n){var r={event:t,data:e};return n&&(r.channel=n),$.debug("Event sent",r),this.send(xt.encodeMessage(r))},e.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},e.prototype.close=function(){this.transport.close()},e.prototype.bindListeners=function(){var t=this,e={message:function(e){var n;try{n=xt.decodeMessage(e)}catch(n){t.emit("error",{type:"MessageParseError",error:n,data:e.data})}if(void 0!==n){switch($.debug("Event recd",n),n.event){case"pusher:error":t.emit("error",{type:"PusherError",data:n.data});break;case"pusher:ping":t.emit("ping");break;case"pusher:pong":t.emit("pong")}t.emit("message",n)}},activity:function(){t.emit("activity")},error:function(e){t.emit("error",e)},closed:function(e){n(),e&&e.code&&t.handleCloseEvent(e),t.transport=null,t.emit("closed")}},n=function(){F(e,(function(e,n){t.transport.unbind(n,e)}))};F(e,(function(e,n){t.transport.bind(n,e)}))},e.prototype.handleCloseEvent=function(t){var e=xt.getCloseAction(t),n=xt.getCloseError(t);n&&this.emit("error",n),e&&this.emit(e,{action:e,error:n})},e}(pt),Ut=function(){function t(t,e){this.transport=t,this.callback=e,this.bindListeners()}return t.prototype.close=function(){this.unbindListeners(),this.transport.close()},t.prototype.bindListeners=function(){var t=this;this.onMessage=function(e){var n;t.unbindListeners();try{n=xt.processHandshake(e)}catch(e){return t.finish("error",{error:e}),void t.transport.close()}"connected"===n.action?t.finish("connected",{connection:new Rt(n.id,t.transport),activityTimeout:n.activityTimeout}):(t.finish(n.action,{error:n.error}),t.transport.close())},this.onClosed=function(e){t.unbindListeners();var n=xt.getCloseAction(e)||"backoff",r=xt.getCloseError(e);t.finish(n,{error:r})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},t.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},t.prototype.finish=function(t,e){this.callback(z({transport:this.transport,action:t},e))},t}(),jt=function(){function t(t,e){this.timeline=t,this.options=e||{}}return t.prototype.send=function(t,e){this.timeline.isEmpty()||this.timeline.send(Ce.TimelineTransport.getAgent(this,t),e)},t}(),Mt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),It=function(t){function e(e,n){var r=t.call(this,(function(t,n){$.debug("No callbacks on "+e+" for "+t)}))||this;return r.name=e,r.pusher=n,r.subscribed=!1,r.subscriptionPending=!1,r.subscriptionCancelled=!1,r}return Mt(e,t),e.prototype.authorize=function(t,e){return e(null,{auth:""})},e.prototype.trigger=function(t,e){if(0!==t.indexOf("client-"))throw new d("Event '"+t+"' does not start with 'client-'");if(!this.subscribed){var n=p("triggeringClientEvents");$.warn("Client event triggered before channel 'subscription_succeeded' event . "+n)}return this.pusher.send_event(t,e,this.name)},e.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},e.prototype.handleEvent=function(t){var e=t.event,n=t.data;if("pusher_internal:subscription_succeeded"===e)this.handleSubscriptionSucceededEvent(t);else if("pusher_internal:subscription_count"===e)this.handleSubscriptionCountEvent(t);else if(0!==e.indexOf("pusher_internal:")){this.emit(e,n,{})}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",t.data)},e.prototype.handleSubscriptionCountEvent=function(t){t.data.subscription_count&&(this.subscriptionCount=t.data.subscription_count),this.emit("pusher:subscription_count",t.data)},e.prototype.subscribe=function(){var t=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(function(e,n){e?(t.subscriptionPending=!1,$.error(e.toString()),t.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:e.message},e instanceof S?{status:e.status}:{}))):t.pusher.send_event("pusher:subscribe",{auth:n.auth,channel_data:n.channel_data,channel:t.name})})))},e.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},e.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},e.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},e}(pt),Dt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Dt(e,t),e.prototype.authorize=function(t,e){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:t},e)},e}(It),Bt=function(){function t(){this.reset()}return t.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null},t.prototype.each=function(t){var e=this;F(this.members,(function(n,r){t(e.get(r))}))},t.prototype.setMyID=function(t){this.myID=t},t.prototype.onSubscription=function(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)},t.prototype.addMember=function(t){return null===this.get(t.user_id)&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)},t.prototype.removeMember=function(t){var e=this.get(t.user_id);return e&&(delete this.members[t.user_id],this.count--),e},t.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},t}(),zt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ht=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n((function(e){e(t.value)})).then(s,a)}c((r=r.apply(t,e||[])).next())}))},qt=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Ft=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.members=new Bt,r}return zt(e,t),e.prototype.authorize=function(e,n){var r=this;t.prototype.authorize.call(this,e,(function(t,e){return Ht(r,void 0,void 0,(function(){var r,o;return qt(this,(function(i){switch(i.label){case 0:return t?[3,3]:null==(e=e).channel_data?[3,1]:(r=JSON.parse(e.channel_data),this.members.setMyID(r.user_id),[3,3]);case 1:return[4,this.pusher.user.signinDonePromise];case 2:if(i.sent(),null==this.pusher.user.user_data)return o=p("authorizationEndpoint"),$.error("Invalid auth response for channel '"+this.name+"', expected 'channel_data' field. "+o+", or the user should be signed in."),n("Invalid auth response"),[2];this.members.setMyID(this.pusher.user.user_data.id),i.label=3;case 3:return n(t,e),[2]}}))}))}))},e.prototype.handleEvent=function(t){var e=t.event;if(0===e.indexOf("pusher_internal:"))this.handleInternalEvent(t);else{var n=t.data,r={};t.user_id&&(r.user_id=t.user_id),this.emit(e,n,r)}},e.prototype.handleInternalEvent=function(t){var e=t.event,n=t.data;switch(e){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(t);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(t);break;case"pusher_internal:member_added":var r=this.members.addMember(n);this.emit("pusher:member_added",r);break;case"pusher_internal:member_removed":var o=this.members.removeMember(n);o&&this.emit("pusher:member_removed",o)}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(t.data),this.emit("pusher:subscription_succeeded",this.members))},e.prototype.disconnect=function(){this.members.reset(),t.prototype.disconnect.call(this)},e}(Nt),Xt=n(1),Jt=n(0),Yt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kt=function(t){function e(e,n,r){var o=t.call(this,e,n)||this;return o.key=null,o.nacl=r,o}return Yt(e,t),e.prototype.authorize=function(e,n){var r=this;t.prototype.authorize.call(this,e,(function(t,e){if(t)n(t,e);else{var o=e.shared_secret;o?(r.key=Object(Jt.decode)(o),delete e.shared_secret,n(null,e)):n(new Error("No shared_secret key in auth payload for encrypted channel: "+r.name),null)}}))},e.prototype.trigger=function(t,e){throw new m("Client events are not currently supported for encrypted channels")},e.prototype.handleEvent=function(e){var n=e.event,r=e.data;0!==n.indexOf("pusher_internal:")&&0!==n.indexOf("pusher:")?this.handleEncryptedEvent(n,r):t.prototype.handleEvent.call(this,e)},e.prototype.handleEncryptedEvent=function(t,e){var n=this;if(this.key)if(e.ciphertext&&e.nonce){var r=Object(Jt.decode)(e.ciphertext);if(r.length<this.nacl.secretbox.overheadLength)$.error("Expected encrypted event ciphertext length to be "+this.nacl.secretbox.overheadLength+", got: "+r.length);else{var o=Object(Jt.decode)(e.nonce);if(o.length<this.nacl.secretbox.nonceLength)$.error("Expected encrypted event nonce length to be "+this.nacl.secretbox.nonceLength+", got: "+o.length);else{var i=this.nacl.secretbox.open(r,o,this.key);if(null===i)return $.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),void this.authorize(this.pusher.connection.socket_id,(function(e,s){e?$.error("Failed to make a request to the authEndpoint: "+s+". Unable to fetch new key, so dropping encrypted event"):null!==(i=n.nacl.secretbox.open(r,o,n.key))?n.emit(t,n.getDataToEmit(i)):$.error("Failed to decrypt event with new key. Dropping encrypted event")}));this.emit(t,this.getDataToEmit(i))}}}else $.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+e);else $.debug("Received encrypted event before key has been retrieved from the authEndpoint")},e.prototype.getDataToEmit=function(t){var e=Object(Xt.decode)(t);try{return JSON.parse(e)}catch(t){return e}},e}(Nt),Wt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gt=function(t){function e(e,n){var r=t.call(this)||this;r.state="initialized",r.connection=null,r.key=e,r.options=n,r.timeline=r.options.timeline,r.usingTLS=r.options.useTLS,r.errorCallbacks=r.buildErrorCallbacks(),r.connectionCallbacks=r.buildConnectionCallbacks(r.errorCallbacks),r.handshakeCallbacks=r.buildHandshakeCallbacks(r.errorCallbacks);var o=Ce.getNetwork();return o.bind("online",(function(){r.timeline.info({netinfo:"online"}),"connecting"!==r.state&&"unavailable"!==r.state||r.retryIn(0)})),o.bind("offline",(function(){r.timeline.info({netinfo:"offline"}),r.connection&&r.sendActivityCheck()})),r.updateStrategy(),r}return Wt(e,t),e.prototype.connect=function(){this.connection||this.runner||(this.strategy.isSupported()?(this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()):this.updateState("failed"))},e.prototype.send=function(t){return!!this.connection&&this.connection.send(t)},e.prototype.send_event=function(t,e,n){return!!this.connection&&this.connection.send_event(t,e,n)},e.prototype.disconnect=function(){this.disconnectInternally(),this.updateState("disconnected")},e.prototype.isUsingTLS=function(){return this.usingTLS},e.prototype.startConnecting=function(){var t=this,e=function(n,r){n?t.runner=t.strategy.connect(0,e):"error"===r.action?(t.emit("error",{type:"HandshakeError",error:r.error}),t.timeline.error({handshakeError:r.error})):(t.abortConnecting(),t.handshakeCallbacks[r.action](r))};this.runner=this.strategy.connect(0,e)},e.prototype.abortConnecting=function(){this.runner&&(this.runner.abort(),this.runner=null)},e.prototype.disconnectInternally=function(){(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection)&&this.abandonConnection().close()},e.prototype.updateStrategy=function(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})},e.prototype.retryIn=function(t){var e=this;this.timeline.info({action:"retry",delay:t}),t>0&&this.emit("connecting_in",Math.round(t/1e3)),this.retryTimer=new D(t||0,(function(){e.disconnectInternally(),e.connect()}))},e.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},e.prototype.setUnavailableTimer=function(){var t=this;this.unavailableTimer=new D(this.options.unavailableTimeout,(function(){t.updateState("unavailable")}))},e.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},e.prototype.sendActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new D(this.options.pongTimeout,(function(){t.timeline.error({pong_timed_out:t.options.pongTimeout}),t.retryIn(0)}))},e.prototype.resetActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new D(this.activityTimeout,(function(){t.sendActivityCheck()})))},e.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},e.prototype.buildConnectionCallbacks=function(t){var e=this;return z({},t,{message:function(t){e.resetActivityCheck(),e.emit("message",t)},ping:function(){e.send_event("pusher:pong",{})},activity:function(){e.resetActivityCheck()},error:function(t){e.emit("error",t)},closed:function(){e.abandonConnection(),e.shouldRetry()&&e.retryIn(1e3)}})},e.prototype.buildHandshakeCallbacks=function(t){var e=this;return z({},t,{connected:function(t){e.activityTimeout=Math.min(e.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),e.clearUnavailableTimer(),e.setConnection(t.connection),e.socket_id=e.connection.id,e.updateState("connected",{socket_id:e.socket_id})}})},e.prototype.buildErrorCallbacks=function(){var t=this,e=function(e){return function(n){n.error&&t.emit("error",{type:"WebSocketError",error:n.error}),e(n)}};return{tls_only:e((function(){t.usingTLS=!0,t.updateStrategy(),t.retryIn(0)})),refused:e((function(){t.disconnect()})),backoff:e((function(){t.retryIn(1e3)})),retry:e((function(){t.retryIn(0)}))}},e.prototype.setConnection=function(t){for(var e in this.connection=t,this.connectionCallbacks)this.connection.bind(e,this.connectionCallbacks[e]);this.resetActivityCheck()},e.prototype.abandonConnection=function(){if(this.connection){for(var t in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(t,this.connectionCallbacks[t]);var e=this.connection;return this.connection=null,e}},e.prototype.updateState=function(t,e){var n=this.state;if(this.state=t,n!==t){var r=t;"connected"===r&&(r+=" with new socket ID "+e.socket_id),$.debug("State changed",n+" -> "+r),this.timeline.info({state:t,params:e}),this.emit("state_change",{previous:n,current:t}),this.emit(t,e)}},e.prototype.shouldRetry=function(){return"connecting"===this.state||"connected"===this.state},e}(pt),Vt=function(){function t(){this.channels={}}return t.prototype.add=function(t,e){return this.channels[t]||(this.channels[t]=function(t,e){if(0===t.indexOf("private-encrypted-")){if(e.config.nacl)return Zt.createEncryptedChannel(t,e,e.config.nacl);var n=p("encryptedChannelSupport");throw new m("Tried to subscribe to a private-encrypted- channel but no nacl implementation available. "+n)}if(0===t.indexOf("private-"))return Zt.createPrivateChannel(t,e);if(0===t.indexOf("presence-"))return Zt.createPresenceChannel(t,e);if(0===t.indexOf("#"))throw new y('Cannot create a channel with name "'+t+'".');return Zt.createChannel(t,e)}(t,e)),this.channels[t]},t.prototype.all=function(){return function(t){var e=[];return F(t,(function(t){e.push(t)})),e}(this.channels)},t.prototype.find=function(t){return this.channels[t]},t.prototype.remove=function(t){var e=this.channels[t];return delete this.channels[t],e},t.prototype.disconnect=function(){F(this.channels,(function(t){t.disconnect()}))},t}();var Zt={createChannels:function(){return new Vt},createConnectionManager:function(t,e){return new Gt(t,e)},createChannel:function(t,e){return new It(t,e)},createPrivateChannel:function(t,e){return new Nt(t,e)},createPresenceChannel:function(t,e){return new Ft(t,e)},createEncryptedChannel:function(t,e,n){return new Kt(t,e,n)},createTimelineSender:function(t,e){return new jt(t,e)},createHandshake:function(t,e){return new Ut(t,e)},createAssistantToTheTransportManager:function(t,e,n){return new At(t,e,n)}},Qt=function(){function t(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}return t.prototype.getAssistant=function(t){return Zt.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},t.prototype.isAlive=function(){return this.livesLeft>0},t.prototype.reportDeath=function(){this.livesLeft-=1},t}(),$t=function(){function t(t,e){this.strategies=t,this.loop=Boolean(e.loop),this.failFast=Boolean(e.failFast),this.timeout=e.timeout,this.timeoutLimit=e.timeoutLimit}return t.prototype.isSupported=function(){return G(this.strategies,B.method("isSupported"))},t.prototype.connect=function(t,e){var n=this,r=this.strategies,o=0,i=this.timeout,s=null,a=function(c,u){u?e(null,u):(o+=1,n.loop&&(o%=r.length),o<r.length?(i&&(i*=2,n.timeoutLimit&&(i=Math.min(i,n.timeoutLimit))),s=n.tryStrategy(r[o],t,{timeout:i,failFast:n.failFast},a)):e(!0))};return s=this.tryStrategy(r[o],t,{timeout:i,failFast:this.failFast},a),{abort:function(){s.abort()},forceMinPriority:function(e){t=e,s&&s.forceMinPriority(e)}}},t.prototype.tryStrategy=function(t,e,n,r){var o=null,i=null;return n.timeout>0&&(o=new D(n.timeout,(function(){i.abort(),r(!0)}))),i=t.connect(e,(function(t,e){t&&o&&o.isRunning()&&!n.failFast||(o&&o.ensureAborted(),r(t,e))})),{abort:function(){o&&o.ensureAborted(),i.abort()},forceMinPriority:function(t){i.forceMinPriority(t)}}},t}(),te=function(){function t(t){this.strategies=t}return t.prototype.isSupported=function(){return G(this.strategies,B.method("isSupported"))},t.prototype.connect=function(t,e){return function(t,e,n){var r=Y(t,(function(t,r,o,i){return t.connect(e,n(r,i))}));return{abort:function(){J(r,ee)},forceMinPriority:function(t){J(r,(function(e){e.forceMinPriority(t)}))}}}(this.strategies,t,(function(t,n){return function(r,o){n[t].error=r,r?function(t){return function(t,e){for(var n=0;n<t.length;n++)if(!e(t[n],n,t))return!1;return!0}(t,(function(t){return Boolean(t.error)}))}(n)&&e(!0):(J(n,(function(t){t.forceMinPriority(o.transport.priority)})),e(null,o))}}))},t}();function ee(t){t.error||t.aborted||(t.abort(),t.aborted=!0)}var ne=function(){function t(t,e,n){this.strategy=t,this.transports=e,this.ttl=n.ttl||18e5,this.usingTLS=n.useTLS,this.timeline=n.timeline}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n=this.usingTLS,r=function(t){var e=Ce.getLocalStorage();if(e)try{var n=e[re(t)];if(n)return JSON.parse(n)}catch(e){oe(t)}return null}(n),o=[this.strategy];if(r&&r.timestamp+this.ttl>=B.now()){var i=this.transports[r.transport];i&&(this.timeline.info({cached:!0,transport:r.transport,latency:r.latency}),o.push(new $t([i],{timeout:2*r.latency+1e3,failFast:!0})))}var s=B.now(),a=o.pop().connect(t,(function r(i,c){i?(oe(n),o.length>0?(s=B.now(),a=o.pop().connect(t,r)):e(i)):(!function(t,e,n){var r=Ce.getLocalStorage();if(r)try{r[re(t)]=Q({timestamp:B.now(),transport:e,latency:n})}catch(t){}}(n,c.transport.name,B.now()-s),e(null,c))}));return{abort:function(){a.abort()},forceMinPriority:function(e){t=e,a&&a.forceMinPriority(e)}}},t}();function re(t){return"pusherTransport"+(t?"TLS":"NonTLS")}function oe(t){var e=Ce.getLocalStorage();if(e)try{delete e[re(t)]}catch(t){}}var ie=function(){function t(t,e){var n=e.delay;this.strategy=t,this.options={delay:n}}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n,r=this.strategy,o=new D(this.options.delay,(function(){n=r.connect(t,e)}));return{abort:function(){o.ensureAborted(),n&&n.abort()},forceMinPriority:function(e){t=e,n&&n.forceMinPriority(e)}}},t}(),se=function(){function t(t,e,n){this.test=t,this.trueBranch=e,this.falseBranch=n}return t.prototype.isSupported=function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()},t.prototype.connect=function(t,e){return(this.test()?this.trueBranch:this.falseBranch).connect(t,e)},t}(),ae=function(){function t(t){this.strategy=t}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n=this.strategy.connect(t,(function(t,r){r&&n.abort(),e(t,r)}));return n},t}();function ce(t){return function(){return t.isSupported()}}var ue,he=function(t,e,n){var r={};function o(e,o,i,s,a){var c=n(t,e,o,i,s,a);return r[e]=c,c}var i,s=Object.assign({},e,{hostNonTLS:t.wsHost+":"+t.wsPort,hostTLS:t.wsHost+":"+t.wssPort,httpPath:t.wsPath}),a=Object.assign({},s,{useTLS:!0}),c=Object.assign({},e,{hostNonTLS:t.httpHost+":"+t.httpPort,hostTLS:t.httpHost+":"+t.httpsPort,httpPath:t.httpPath}),u={loop:!0,timeout:15e3,timeoutLimit:6e4},h=new Qt({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),p=new Qt({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),l=o("ws","ws",3,s,h),f=o("wss","ws",3,a,h),d=o("sockjs","sockjs",1,c),y=o("xhr_streaming","xhr_streaming",1,c,p),g=o("xdr_streaming","xdr_streaming",1,c,p),v=o("xhr_polling","xhr_polling",1,c),b=o("xdr_polling","xdr_polling",1,c),m=new $t([l],u),w=new $t([f],u),_=new $t([d],u),S=new $t([new se(ce(y),y,g)],u),k=new $t([new se(ce(v),v,b)],u),C=new $t([new se(ce(S),new te([S,new ie(k,{delay:4e3})]),k)],u),T=new se(ce(C),C,_);return i=e.useTLS?new te([m,new ie(T,{delay:2e3})]):new te([m,new ie(w,{delay:2e3}),new ie(T,{delay:5e3})]),new ne(new ae(new se(ce(l),i,T)),r,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})},pe={getRequest:function(t){var e=new window.XDomainRequest;return e.ontimeout=function(){t.emit("error",new g),t.close()},e.onerror=function(e){t.emit("error",e),t.close()},e.onprogress=function(){e.responseText&&e.responseText.length>0&&t.onChunk(200,e.responseText)},e.onload=function(){e.responseText&&e.responseText.length>0&&t.onChunk(200,e.responseText),t.emit("finished",200),t.close()},e},abortRequest:function(t){t.ontimeout=t.onerror=t.onprogress=t.onload=null,t.abort()}},le=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fe=function(t){function e(e,n,r){var o=t.call(this)||this;return o.hooks=e,o.method=n,o.url=r,o}return le(e,t),e.prototype.start=function(t){var e=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){e.close()},Ce.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(t)},e.prototype.close=function(){this.unloader&&(Ce.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},e.prototype.onChunk=function(t,e){for(;;){var n=this.advanceBuffer(e);if(!n)break;this.emit("chunk",{status:t,data:n})}this.isBufferTooLong(e)&&this.emit("buffer_too_long")},e.prototype.advanceBuffer=function(t){var e=t.slice(this.position),n=e.indexOf("\n");return-1!==n?(this.position+=n+1,e.slice(0,n)):null},e.prototype.isBufferTooLong=function(t){return this.position===t.length&&t.length>262144},e}(pt);!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSED=3]="CLOSED"}(ue||(ue={}));var de=ue,ye=1;function ge(t){var e=-1===t.indexOf("?")?"?":"&";return t+e+"t="+ +new Date+"&n="+ye++}function ve(t){return Math.floor(Math.random()*t)}var be,me=function(){function t(t,e){this.hooks=t,this.session=ve(1e3)+"/"+function(t){for(var e=[],n=0;n<t;n++)e.push(ve(32).toString(32));return e.join("")}(8),this.location=function(t){var e=/([^\?]*)\/*(\??.*)/.exec(t);return{base:e[1],queryString:e[2]}}(e),this.readyState=de.CONNECTING,this.openStream()}return t.prototype.send=function(t){return this.sendRaw(JSON.stringify([t]))},t.prototype.ping=function(){this.hooks.sendHeartbeat(this)},t.prototype.close=function(t,e){this.onClose(t,e,!0)},t.prototype.sendRaw=function(t){if(this.readyState!==de.OPEN)return!1;try{return Ce.createSocketRequest("POST",ge((e=this.location,n=this.session,e.base+"/"+n+"/xhr_send"))).start(t),!0}catch(t){return!1}var e,n},t.prototype.reconnect=function(){this.closeStream(),this.openStream()},t.prototype.onClose=function(t,e,n){this.closeStream(),this.readyState=de.CLOSED,this.onclose&&this.onclose({code:t,reason:e,wasClean:n})},t.prototype.onChunk=function(t){var e;if(200===t.status)switch(this.readyState===de.OPEN&&this.onActivity(),t.data.slice(0,1)){case"o":e=JSON.parse(t.data.slice(1)||"{}"),this.onOpen(e);break;case"a":e=JSON.parse(t.data.slice(1)||"[]");for(var n=0;n<e.length;n++)this.onEvent(e[n]);break;case"m":e=JSON.parse(t.data.slice(1)||"null"),this.onEvent(e);break;case"h":this.hooks.onHeartbeat(this);break;case"c":e=JSON.parse(t.data.slice(1)||"[]"),this.onClose(e[0],e[1],!0)}},t.prototype.onOpen=function(t){var e,n,r;this.readyState===de.CONNECTING?(t&&t.hostname&&(this.location.base=(e=this.location.base,n=t.hostname,(r=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(e))[1]+n+r[3])),this.readyState=de.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)},t.prototype.onEvent=function(t){this.readyState===de.OPEN&&this.onmessage&&this.onmessage({data:t})},t.prototype.onActivity=function(){this.onactivity&&this.onactivity()},t.prototype.onError=function(t){this.onerror&&this.onerror(t)},t.prototype.openStream=function(){var t=this;this.stream=Ce.createSocketRequest("POST",ge(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",(function(e){t.onChunk(e)})),this.stream.bind("finished",(function(e){t.hooks.onFinished(t,e)})),this.stream.bind("buffer_too_long",(function(){t.reconnect()}));try{this.stream.start()}catch(e){B.defer((function(){t.onError(e),t.onClose(1006,"Could not start streaming",!1)}))}},t.prototype.closeStream=function(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)},t}(),we={getReceiveURL:function(t,e){return t.base+"/"+e+"/xhr_streaming"+t.queryString},onHeartbeat:function(t){t.sendRaw("[]")},sendHeartbeat:function(t){t.sendRaw("[]")},onFinished:function(t,e){t.onClose(1006,"Connection interrupted ("+e+")",!1)}},_e={getReceiveURL:function(t,e){return t.base+"/"+e+"/xhr"+t.queryString},onHeartbeat:function(){},sendHeartbeat:function(t){t.sendRaw("[]")},onFinished:function(t,e){200===e?t.reconnect():t.onClose(1006,"Connection interrupted ("+e+")",!1)}},Se={getRequest:function(t){var e=new(Ce.getXHRAPI());return e.onreadystatechange=e.onprogress=function(){switch(e.readyState){case 3:e.responseText&&e.responseText.length>0&&t.onChunk(e.status,e.responseText);break;case 4:e.responseText&&e.responseText.length>0&&t.onChunk(e.status,e.responseText),t.emit("finished",e.status),t.close()}},e},abortRequest:function(t){t.onreadystatechange=null,t.abort()}},ke={createStreamingSocket:function(t){return this.createSocket(we,t)},createPollingSocket:function(t){return this.createSocket(_e,t)},createSocket:function(t,e){return new me(t,e)},createXHR:function(t,e){return this.createRequest(Se,t,e)},createRequest:function(t,e,n){return new fe(t,e,n)},createXDR:function(t,e){return this.createRequest(pe,t,e)}},Ce={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:i,DependenciesReceivers:c,getDefaultStrategy:he,Transports:Tt,transportConnectionInitializer:function(){var t=this;t.timeline.info(t.buildTimelineMessage({transport:t.name+(t.options.useTLS?"s":"")})),t.hooks.isInitialized()?t.changeState("initialized"):t.hooks.file?(t.changeState("initializing"),u.load(t.hooks.file,{useTLS:t.options.useTLS},(function(e,n){t.hooks.isInitialized()?(t.changeState("initialized"),n(!0)):(e&&t.onError(e),t.onClose(),n(!1))}))):t.onClose()},HTTPFactory:ke,TimelineTransport:rt,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(t){var e=this;window.Pusher=t;var n=function(){e.onDocumentBody(t.ready)};window.JSON?n():u.load("json2",{},n)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:k,jsonp:tt}},onDocumentBody:function(t){var e=this;document.body?t():setTimeout((function(){e.onDocumentBody(t)}),0)},createJSONPRequest:function(t,e){return new nt(t,e)},createScriptRequest:function(t){return new et(t)},getLocalStorage:function(){try{return window.localStorage}catch(t){return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){return new(this.getXHRAPI())},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return Ot},createWebSocket:function(t){return new(this.getWebSocketAPI())(t)},createSocketRequest:function(t,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(t,e);if(this.isXDRSupported(0===e.indexOf("https:")))return this.HTTPFactory.createXDR(t,e);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var t=this.getXHRAPI();return Boolean(t)&&void 0!==(new t).withCredentials},isXDRSupported:function(t){var e=t?"https:":"http:",n=this.getProtocol();return Boolean(window.XDomainRequest)&&n===e},addUnloadListener:function(t){void 0!==window.addEventListener?window.addEventListener("unload",t,!1):void 0!==window.attachEvent&&window.attachEvent("onunload",t)},removeUnloadListener:function(t){void 0!==window.addEventListener?window.removeEventListener("unload",t,!1):void 0!==window.detachEvent&&window.detachEvent("onunload",t)}};!function(t){t[t.ERROR=3]="ERROR",t[t.INFO=6]="INFO",t[t.DEBUG=7]="DEBUG"}(be||(be={}));var Te=be,Pe=function(){function t(t,e,n){this.key=t,this.session=e,this.events=[],this.options=n||{},this.sent=0,this.uniqueID=0}return t.prototype.log=function(t,e){t<=this.options.level&&(this.events.push(z({},e,{timestamp:B.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},t.prototype.error=function(t){this.log(Te.ERROR,t)},t.prototype.info=function(t){this.log(Te.INFO,t)},t.prototype.debug=function(t){this.log(Te.DEBUG,t)},t.prototype.isEmpty=function(){return 0===this.events.length},t.prototype.send=function(t,e){var n=this,r=z({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],t(r,(function(t,r){t||n.sent++,e&&e(t,r)})),!0},t.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},t}(),Oe=function(){function t(t,e,n,r){this.name=t,this.priority=e,this.transport=n,this.options=r||{}}return t.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},t.prototype.connect=function(t,e){var n=this;if(!this.isSupported())return Ae(new _,e);if(this.priority<t)return Ae(new v,e);var r=!1,o=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),i=null,s=function(){o.unbind("initialized",s),o.connect()},a=function(){i=Zt.createHandshake(o,(function(t){r=!0,h(),e(null,t)}))},c=function(t){h(),e(t)},u=function(){var t;h(),t=Q(o),e(new b(t))},h=function(){o.unbind("initialized",s),o.unbind("open",a),o.unbind("error",c),o.unbind("closed",u)};return o.bind("initialized",s),o.bind("open",a),o.bind("error",c),o.bind("closed",u),o.initialize(),{abort:function(){r||(h(),i?i.close():o.close())},forceMinPriority:function(t){r||n.priority<t&&(i?i.close():o.close())}}},t}();function Ae(t,e){return B.defer((function(){e(t)})),{abort:function(){},forceMinPriority:function(){}}}var Ee=Ce.Transports,xe=function(t,e,n,r,o,i){var s,a=Ee[n];if(!a)throw new w(n);return!(t.enabledTransports&&-1===q(t.enabledTransports,e)||t.disabledTransports&&-1!==q(t.disabledTransports,e))?(o=Object.assign({ignoreNullOrigin:t.ignoreNullOrigin},o),s=new Oe(e,r,i?i.getAssistant(a):a,o)):s=Le,s},Le={isSupported:function(){return!1},connect:function(t,e){var n=B.defer((function(){e(new _)}));return{abort:function(){n.ensureAborted()},forceMinPriority:function(){}}}},Re=function(t){if(void 0===Ce.getAuthorizers()[t.transport])throw"'"+t.transport+"' is not a recognized auth transport";return function(e,n){var o=function(t,e){var n="socket_id="+encodeURIComponent(t.socketId);for(var r in e.params)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(e.params[r]);return n}(e,t);Ce.getAuthorizers()[t.transport](Ce,o,t,r.UserAuthentication,n)}},Ue=function(t){if(void 0===Ce.getAuthorizers()[t.transport])throw"'"+t.transport+"' is not a recognized auth transport";return function(e,n){var o=function(t,e){var n="socket_id="+encodeURIComponent(t.socketId);for(var r in n+="&channel_name="+encodeURIComponent(t.channelName),e.params)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(e.params[r]);return n}(e,t);Ce.getAuthorizers()[t.transport](Ce,o,t,r.ChannelAuthorization,n)}},je=function(){return(je=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Me(t){return t.httpHost?t.httpHost:t.cluster?"sockjs-"+t.cluster+".pusher.com":s.httpHost}function Ie(t){return t.wsHost?t.wsHost:t.cluster?De(t.cluster):De(s.cluster)}function De(t){return"ws-"+t+".pusher.com"}function Ne(t){return"https:"===Ce.getProtocol()||!1!==t.forceTLS}function Be(t){return"enableStats"in t?t.enableStats:"disableStats"in t&&!t.disableStats}function ze(t){var e=je({},s.userAuthentication,t.userAuthentication);return"customHandler"in e&&null!=e.customHandler?e.customHandler:Re(e)}function He(t,e){var n=function(t,e){var n;return"channelAuthorization"in t?n=je({},s.channelAuthorization,t.channelAuthorization):(n={transport:t.authTransport||s.authTransport,endpoint:t.authEndpoint||s.authEndpoint},"auth"in t&&("params"in t.auth&&(n.params=t.auth.params),"headers"in t.auth&&(n.headers=t.auth.headers)),"authorizer"in t&&(n.customHandler=function(t,e,n){var r={authTransport:e.transport,authEndpoint:e.endpoint,auth:{params:e.params,headers:e.headers}};return function(e,o){var i=t.channel(e.channelName);n(i,r).authorize(e.socketId,o)}}(e,n,t.authorizer))),n}(t,e);return"customHandler"in n&&null!=n.customHandler?n.customHandler:Ue(n)}var qe=function(){var t,e;return{promise:new Promise((function(n,r){t=n,e=r})),resolve:t,reject:e}},Fe=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xe=function(t){function e(e){var n=t.call(this,(function(t,e){$.debug("No callbacks on user for "+t)}))||this;return n.signin_requested=!1,n.user_data=null,n.serverToUserChannel=null,n.signinDonePromise=null,n._signinDoneResolve=null,n._onAuthorize=function(t,e){if(t)return $.warn("Error during signin: "+t),void n._cleanup();n.pusher.send_event("pusher:signin",{auth:e.auth,user_data:e.user_data})},n.pusher=e,n.pusher.connection.bind("state_change",(function(t){var e=t.previous,r=t.current;"connected"!==e&&"connected"===r&&n._signin(),"connected"===e&&"connected"!==r&&(n._cleanup(),n._newSigninPromiseIfNeeded())})),n.pusher.connection.bind("message",(function(t){"pusher:signin_success"===t.event&&n._onSigninSuccess(t.data),n.serverToUserChannel&&n.serverToUserChannel.name===t.channel&&n.serverToUserChannel.handleEvent(t)})),n}return Fe(e,t),e.prototype.signin=function(){this.signin_requested||(this.signin_requested=!0,this._signin())},e.prototype._signin=function(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),"connected"===this.pusher.connection.state&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))},e.prototype._onSigninSuccess=function(t){try{this.user_data=JSON.parse(t.user_data)}catch(e){return $.error("Failed parsing user data after signin: "+t.user_data),void this._cleanup()}if("string"!=typeof this.user_data.id||""===this.user_data.id)return $.error("user_data doesn't contain an id. user_data: "+this.user_data),void this._cleanup();this._signinDoneResolve(),this._subscribeChannels()},e.prototype._subscribeChannels=function(){var t,e=this;this.serverToUserChannel=new It("#server-to-user-"+this.user_data.id,this.pusher),this.serverToUserChannel.bind_global((function(t,n){0!==t.indexOf("pusher_internal:")&&0!==t.indexOf("pusher:")&&e.emit(t,n)})),(t=this.serverToUserChannel).subscriptionPending&&t.subscriptionCancelled?t.reinstateSubscription():t.subscriptionPending||"connected"!==e.pusher.connection.state||t.subscribe()},e.prototype._cleanup=function(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()},e.prototype._newSigninPromiseIfNeeded=function(){if(this.signin_requested&&(!this.signinDonePromise||this.signinDonePromise.done)){var t=qe(),e=t.promise,n=t.resolve;t.reject;e.done=!1;var r=function(){e.done=!0};e.then(r).catch(r),this.signinDonePromise=e,this._signinDoneResolve=n}},e}(pt),Je=function(){function t(e,n){var r,o,i,a=this;if(function(t){if(null==t)throw"You must pass your app key when you instantiate Pusher."}(e),!(n=n||{}).cluster&&!n.wsHost&&!n.httpHost){var c=p("javascriptQuickStart");$.warn("You should always specify a cluster when connecting. "+c)}"disableStats"in n&&$.warn("The disableStats option is deprecated in favor of enableStats"),this.key=e,this.config=(o=this,i={activityTimeout:(r=n).activityTimeout||s.activityTimeout,cluster:r.cluster||s.cluster,httpPath:r.httpPath||s.httpPath,httpPort:r.httpPort||s.httpPort,httpsPort:r.httpsPort||s.httpsPort,pongTimeout:r.pongTimeout||s.pongTimeout,statsHost:r.statsHost||s.stats_host,unavailableTimeout:r.unavailableTimeout||s.unavailableTimeout,wsPath:r.wsPath||s.wsPath,wsPort:r.wsPort||s.wsPort,wssPort:r.wssPort||s.wssPort,enableStats:Be(r),httpHost:Me(r),useTLS:Ne(r),wsHost:Ie(r),userAuthenticator:ze(r),channelAuthorizer:He(r,o)},"disabledTransports"in r&&(i.disabledTransports=r.disabledTransports),"enabledTransports"in r&&(i.enabledTransports=r.enabledTransports),"ignoreNullOrigin"in r&&(i.ignoreNullOrigin=r.ignoreNullOrigin),"timelineParams"in r&&(i.timelineParams=r.timelineParams),"nacl"in r&&(i.nacl=r.nacl),i),this.channels=Zt.createChannels(),this.global_emitter=new pt,this.sessionID=Math.floor(1e9*Math.random()),this.timeline=new Pe(this.key,this.sessionID,{cluster:this.config.cluster,features:t.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Te.INFO,version:s.VERSION}),this.config.enableStats&&(this.timelineSender=Zt.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+Ce.TimelineTransport.name}));this.connection=Zt.createConnectionManager(this.key,{getStrategy:function(t){return Ce.getDefaultStrategy(a.config,t,xe)},timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:Boolean(this.config.useTLS)}),this.connection.bind("connected",(function(){a.subscribeAll(),a.timelineSender&&a.timelineSender.send(a.connection.isUsingTLS())})),this.connection.bind("message",(function(t){var e=0===t.event.indexOf("pusher_internal:");if(t.channel){var n=a.channel(t.channel);n&&n.handleEvent(t)}e||a.global_emitter.emit(t.event,t.data)})),this.connection.bind("connecting",(function(){a.channels.disconnect()})),this.connection.bind("disconnected",(function(){a.channels.disconnect()})),this.connection.bind("error",(function(t){$.warn(t)})),t.instances.push(this),this.timeline.info({instances:t.instances.length}),this.user=new Xe(this),t.isReady&&this.connect()}return t.ready=function(){t.isReady=!0;for(var e=0,n=t.instances.length;e<n;e++)t.instances[e].connect()},t.getClientFeatures=function(){return X(W({ws:Ce.Transports.ws},(function(t){return t.isSupported({})})))},t.prototype.channel=function(t){return this.channels.find(t)},t.prototype.allChannels=function(){return this.channels.all()},t.prototype.connect=function(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var t=this.connection.isUsingTLS(),e=this.timelineSender;this.timelineSenderTimer=new N(6e4,(function(){e.send(t)}))}},t.prototype.disconnect=function(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)},t.prototype.bind=function(t,e,n){return this.global_emitter.bind(t,e,n),this},t.prototype.unbind=function(t,e,n){return this.global_emitter.unbind(t,e,n),this},t.prototype.bind_global=function(t){return this.global_emitter.bind_global(t),this},t.prototype.unbind_global=function(t){return this.global_emitter.unbind_global(t),this},t.prototype.unbind_all=function(t){return this.global_emitter.unbind_all(),this},t.prototype.subscribeAll=function(){var t;for(t in this.channels.channels)this.channels.channels.hasOwnProperty(t)&&this.subscribe(t)},t.prototype.subscribe=function(t){var e=this.channels.add(t,this);return e.subscriptionPending&&e.subscriptionCancelled?e.reinstateSubscription():e.subscriptionPending||"connected"!==this.connection.state||e.subscribe(),e},t.prototype.unsubscribe=function(t){var e=this.channels.find(t);e&&e.subscriptionPending?e.cancelSubscription():(e=this.channels.remove(t))&&e.subscribed&&e.unsubscribe()},t.prototype.send_event=function(t,e,n){return this.connection.send_event(t,e,n)},t.prototype.shouldUseTLS=function(){return this.config.useTLS},t.prototype.signin=function(){this.user.signin()},t.instances=[],t.isReady=!1,t.logToConsole=!1,t.Runtime=Ce,t.ScriptReceivers=Ce.ScriptReceivers,t.DependenciesReceivers=Ce.DependenciesReceivers,t.auth_callbacks=Ce.auth_callbacks,t}(),Ye=Je;Ce.setup(Je);var Ke=n(2),We=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ge=function(t){function e(n,r){return Ye.logToConsole=e.logToConsole,Ye.log=e.log,(r=r||{}).nacl=Ke,t.call(this,n,r)||this}return We(e,t),e}(Ye);e.default=Ge}])}));
|
|
9
9
|
//# sourceMappingURL=pusher-with-encryption.min.js.map
|