HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/www/8909.37ab296944cba138.js
(self.webpackChunkapp=self.webpackChunkapp||[]).push([[8909],{78275:_t=>{window,_t.exports=function(D){var w={};function C(g){if(w[g])return w[g].exports;var f=w[g]={i:g,l:!1,exports:{}};return D[g].call(f.exports,f,f.exports,C),f.l=!0,f.exports}return C.m=D,C.c=w,C.d=function(g,f,A){C.o(g,f)||Object.defineProperty(g,f,{enumerable:!0,get:A})},C.r=function(g){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(g,"__esModule",{value:!0})},C.t=function(g,f){if(1&f&&(g=C(g)),8&f||4&f&&"object"==typeof g&&g&&g.__esModule)return g;var A=Object.create(null);if(C.r(A),Object.defineProperty(A,"default",{enumerable:!0,value:g}),2&f&&"string"!=typeof g)for(var m in g)C.d(A,m,function(q){return g[q]}.bind(null,m));return A},C.n=function(g){var f=g&&g.__esModule?function(){return g.default}:function(){return g};return C.d(f,"a",f),f},C.o=function(g,f){return Object.prototype.hasOwnProperty.call(g,f)},C.p="",C(C.s=2)}([function(D,w,C){"use strict";var p,g=this&&this.__extends||(p=function(c,u){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,P){v.__proto__=P}||function(v,P){for(var L in P)P.hasOwnProperty(L)&&(v[L]=P[L])})(c,u)},function(c,u){function v(){this.constructor=c}p(c,u),c.prototype=null===u?Object.create(u):(v.prototype=u.prototype,new v)});Object.defineProperty(w,"__esModule",{value:!0});var f=256,A=function(){function p(c){void 0===c&&(c="="),this._paddingCharacter=c}return p.prototype.encodedLength=function(c){return this._paddingCharacter?(c+2)/3*4|0:(8*c+5)/6|0},p.prototype.encode=function(c){for(var u="",v=0;v<c.length-2;v+=3)u+=this._encodeByte((P=c[v]<<16|c[v+1]<<8|c[v+2])>>>18&63),u+=this._encodeByte(P>>>12&63),u+=this._encodeByte(P>>>6&63),u+=this._encodeByte(P>>>0&63);var P,L=c.length-v;return L>0&&(u+=this._encodeByte((P=c[v]<<16|(2===L?c[v+1]<<8:0))>>>18&63),u+=this._encodeByte(P>>>12&63),u+=2===L?this._encodeByte(P>>>6&63):this._paddingCharacter||"",u+=this._paddingCharacter||""),u},p.prototype.maxDecodedLength=function(c){return this._paddingCharacter?c/4*3|0:(6*c+7)/8|0},p.prototype.decodedLength=function(c){return this.maxDecodedLength(c.length-this._getPaddingLength(c))},p.prototype.decode=function(c){if(0===c.length)return new Uint8Array(0);for(var u=this._getPaddingLength(c),v=c.length-u,P=new Uint8Array(this.maxDecodedLength(v)),L=0,R=0,I=0,z=0,U=0,N=0,H=0;R<v-4;R+=4)z=this._decodeChar(c.charCodeAt(R+0)),U=this._decodeChar(c.charCodeAt(R+1)),N=this._decodeChar(c.charCodeAt(R+2)),H=this._decodeChar(c.charCodeAt(R+3)),P[L++]=z<<2|U>>>4,P[L++]=U<<4|N>>>2,P[L++]=N<<6|H,I|=z&f,I|=U&f,I|=N&f,I|=H&f;if(R<v-1&&(z=this._decodeChar(c.charCodeAt(R)),U=this._decodeChar(c.charCodeAt(R+1)),P[L++]=z<<2|U>>>4,I|=z&f,I|=U&f),R<v-2&&(N=this._decodeChar(c.charCodeAt(R+2)),P[L++]=U<<4|N>>>2,I|=N&f),R<v-3&&(H=this._decodeChar(c.charCodeAt(R+3)),P[L++]=N<<6|H,I|=H&f),0!==I)throw new Error("Base64Coder: incorrect characters for decoding");return P},p.prototype._encodeByte=function(c){var u=c;return u+=65,u+=25-c>>>8&6,u+=51-c>>>8&-75,u+=61-c>>>8&-15,u+=62-c>>>8&3,String.fromCharCode(u)},p.prototype._decodeChar=function(c){var u=f;return u+=(42-c&c-44)>>>8&-f+c-43+62,u+=(46-c&c-48)>>>8&-f+c-47+63,u+=(47-c&c-58)>>>8&-f+c-48+52,(u+=(64-c&c-91)>>>8&-f+c-65+0)+((96-c&c-123)>>>8&-f+c-97+26)},p.prototype._getPaddingLength=function(c){var u=0;if(this._paddingCharacter){for(var v=c.length-1;v>=0&&c[v]===this._paddingCharacter;v--)u++;if(c.length<4||u>2)throw new Error("Base64Coder: incorrect padding")}return u},p}();w.Coder=A;var m=new A;w.encode=function q(p){return m.encode(p)},w.decode=function S(p){return m.decode(p)};var T=function(p){function c(){return null!==p&&p.apply(this,arguments)||this}return g(c,p),c.prototype._encodeByte=function(u){var v=u;return v+=65,v+=25-u>>>8&6,v+=51-u>>>8&-75,v+=61-u>>>8&-13,v+=62-u>>>8&49,String.fromCharCode(v)},c.prototype._decodeChar=function(u){var v=f;return v+=(44-u&u-46)>>>8&-f+u-45+62,v+=(94-u&u-96)>>>8&-f+u-95+63,v+=(47-u&u-58)>>>8&-f+u-48+52,(v+=(64-u&u-91)>>>8&-f+u-65+0)+((96-u&u-123)>>>8&-f+u-97+26)},c}(A);w.URLSafeCoder=T;var _=new T;w.encodeURLSafe=function y(p){return _.encode(p)},w.decodeURLSafe=function k(p){return _.decode(p)},w.encodedLength=function(p){return m.encodedLength(p)},w.maxDecodedLength=function(p){return m.maxDecodedLength(p)},w.decodedLength=function(p){return m.decodedLength(p)}},function(D,w,C){"use strict";Object.defineProperty(w,"__esModule",{value:!0});var g="utf8: invalid string",f="utf8: invalid source encoding";function m(S){for(var T=0,_=0;_<S.length;_++){var y=S.charCodeAt(_);if(y<128)T+=1;else if(y<2048)T+=2;else if(y<55296)T+=3;else{if(!(y<=57343))throw new Error(g);if(_>=S.length-1)throw new Error(g);_++,T+=4}}return T}w.encode=function A(S){for(var T=new Uint8Array(m(S)),_=0,y=0;y<S.length;y++){var k=S.charCodeAt(y);k<128?T[_++]=k:k<2048?(T[_++]=192|k>>6,T[_++]=128|63&k):k<55296?(T[_++]=224|k>>12,T[_++]=128|k>>6&63,T[_++]=128|63&k):(y++,k=(1023&k)<<10,k|=1023&S.charCodeAt(y),T[_++]=240|(k+=65536)>>18,T[_++]=128|k>>12&63,T[_++]=128|k>>6&63,T[_++]=128|63&k)}return T},w.encodedLength=m,w.decode=function q(S){for(var T=[],_=0;_<S.length;_++){var y=S[_];if(128&y){var k=void 0;if(y<224){if(_>=S.length)throw new Error(f);if(128!=(192&(p=S[++_])))throw new Error(f);y=(31&y)<<6|63&p,k=128}else if(y<240){if(_>=S.length-1)throw new Error(f);var p=S[++_],c=S[++_];if(128!=(192&p)||128!=(192&c))throw new Error(f);y=(15&y)<<12|(63&p)<<6|63&c,k=2048}else{if(!(y<248))throw new Error(f);if(_>=S.length-2)throw new Error(f);p=S[++_],c=S[++_];var u=S[++_];if(128!=(192&p)||128!=(192&c)||128!=(192&u))throw new Error(f);y=(15&y)<<18|(63&p)<<12|(63&c)<<6|63&u,k=65536}if(y<k||y>=55296&&y<=57343)throw new Error(f);if(y>=65536){if(y>1114111)throw new Error(f);y-=65536,T.push(String.fromCharCode(55296|y>>10)),y=56320|1023&y}}T.push(String.fromCharCode(y))}return T.join("")}},function(D,w,C){D.exports=C(3).default},function(D,w,C){"use strict";C.r(w);var e,g=function(){function e(t,n){this.lastId=0,this.prefix=t,this.name=n}return e.prototype.create=function(t){this.lastId++;var n=this.lastId,r=this.prefix+n,i=this.name+"["+n+"]",o=!1,s=function(){o||(t.apply(null,arguments),o=!0)};return this[n]=s,{number:n,id:r,name:i,callback:s}},e.prototype.remove=function(t){delete this[t.number]},e}(),f=new g("_pusher_script_","Pusher.ScriptReceivers"),m={VERSION:"7.6.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:""},q=function(){function e(t){this.options=t,this.receivers=t.receivers||f,this.loading={}}return e.prototype.load=function(t,n,r){var i=this;if(i.loading[t]&&i.loading[t].length>0)i.loading[t].push(r);else{i.loading[t]=[r];var o=d.createScriptRequest(i.getPath(t,n)),s=i.receivers.create(function(a){if(i.receivers.remove(s),i.loading[t]){var l=i.loading[t];delete i.loading[t];for(var h=function(O){O||o.cleanup()},b=0;b<l.length;b++)l[b](a,h)}});o.send(s)}},e.prototype.getRoot=function(t){var r=d.getDocument().location.protocol;return(t&&t.useTLS||"https:"===r?this.options.cdn_https:this.options.cdn_http).replace(/\/*$/,"")+"/"+this.options.version},e.prototype.getPath=function(t,n){return this.getRoot(n)+"/"+t+this.options.suffix+".js"},e}(),S=q,T=new g("_pusher_dependencies","Pusher.DependenciesReceivers"),_=new S({cdn_http:m.cdn_http,cdn_https:m.cdn_https,version:m.VERSION,suffix:m.dependency_suffix,receivers:T}),y={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_buildLogSuffix=function(e){var r,n=y.urls[e];return n?(n.fullUrl?r=n.fullUrl:n.path&&(r=y.baseUrl+n.path),r?"See: "+r:""):""},c=function(e){return e.UserAuthentication="user-authentication",e.ChannelAuthorization="channel-authorization",e}(c||{}),u=(e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])})(t,n)},function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),v=function(e){function t(n){var r=this.constructor,i=e.call(this,n)||this;return Object.setPrototypeOf(i,r.prototype),i}return u(t,e),t}(Error),P=function(e){function t(n){var r=this.constructor,i=e.call(this,n)||this;return Object.setPrototypeOf(i,r.prototype),i}return u(t,e),t}(Error),L=function(e){function t(n){var r=this.constructor,i=e.call(this,n)||this;return Object.setPrototypeOf(i,r.prototype),i}return u(t,e),t}(Error),R=function(e){function t(n){var r=this.constructor,i=e.call(this,n)||this;return Object.setPrototypeOf(i,r.prototype),i}return u(t,e),t}(Error),I=function(e){function t(n){var r=this.constructor,i=e.call(this,n)||this;return Object.setPrototypeOf(i,r.prototype),i}return u(t,e),t}(Error),z=function(e){function t(n){var r=this.constructor,i=e.call(this,n)||this;return Object.setPrototypeOf(i,r.prototype),i}return u(t,e),t}(Error),U=function(e){function t(n){var r=this.constructor,i=e.call(this,n)||this;return Object.setPrototypeOf(i,r.prototype),i}return u(t,e),t}(Error),N=function(e){function t(n){var r=this.constructor,i=e.call(this,n)||this;return Object.setPrototypeOf(i,r.prototype),i}return u(t,e),t}(Error),H=function(e){function t(n,r){var i=this.constructor,o=e.call(this,r)||this;return o.status=n,Object.setPrototypeOf(o,i.prototype),o}return u(t,e),t}(Error),$t=function(e,t,n,r,i){var o=d.createXHR();for(var s in o.open("POST",n.endpoint,!0),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.headers)o.setRequestHeader(s,n.headers[s]);if(null!=n.headersProvider){var a=n.headersProvider();for(var s in a)o.setRequestHeader(s,a[s])}return o.onreadystatechange=function(){if(4===o.readyState)if(200===o.status){var l=void 0,h=!1;try{l=JSON.parse(o.responseText),h=!0}catch{i(new H(200,"JSON returned from "+r.toString()+" endpoint was invalid, yet status code was 200. Data was: "+o.responseText),null)}h&&i(null,l)}else{var b="";switch(r){case c.UserAuthentication:b=p_buildLogSuffix("authenticationEndpoint");break;case c.ChannelAuthorization:b="Clients must be authorized to join private or presence channels. "+p_buildLogSuffix("authorizationEndpoint")}i(new H(o.status,"Unable to retrieve auth string from "+r.toString()+" endpoint - received status: "+o.status+" from "+n.endpoint+". "+b),null)}},o.send(t),o};for(var $=String.fromCharCode,K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",te={},nt=0;nt<64;nt++)te[K.charAt(nt)]=nt;var ne=function(e){var t=e.charCodeAt(0);return t<128?e:t<2048?$(192|t>>>6)+$(128|63&t):$(224|t>>>12&15)+$(128|t>>>6&63)+$(128|63&t)},re=function(e){return e.replace(/[^\x00-\x7F]/g,ne)},ie=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[K.charAt(n>>>18),K.charAt(n>>>12&63),t>=2?"=":K.charAt(n>>>6&63),t>=1?"=":K.charAt(63&n)].join("")},oe=window.btoa||function(e){return e.replace(/[\s\S]{1,3}/g,ie)},se=function(){function e(t,n,r,i){var o=this;this.clear=n,this.timer=t(function(){o.timer&&(o.timer=i(o.timer))},r)}return e.prototype.isRunning=function(){return null!==this.timer},e.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},e}(),mt=se,bt=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function ae(e){window.clearTimeout(e)}function ce(e){window.clearInterval(e)}var J=function(e){function t(n,r){return e.call(this,setTimeout,ae,n,function(i){return r(),null})||this}return bt(t,e),t}(mt),ue=function(e){function t(n,r){return e.call(this,setInterval,ce,n,function(i){return r(),i})||this}return bt(t,e),t}(mt),he={now:function(){return Date.now?Date.now():(new Date).valueOf()},defer:function(e){return new J(0,e)},method:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.prototype.slice.call(arguments,1);return function(i){return i[e].apply(i,r.concat(arguments))}}},E=he;function j(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++){var i=t[r];for(var o in i)e[o]=i[o]&&i[o].constructor&&i[o].constructor===Object?j(e[o]||{},i[o]):i[o]}return e}function fe(){for(var e=["Pusher"],t=0;t<arguments.length;t++)e.push("string"==typeof arguments[t]?arguments[t]:rt(arguments[t]));return e.join(" : ")}function wt(e,t){var n=Array.prototype.indexOf;if(null===e)return-1;if(n&&e.indexOf===n)return e.indexOf(t);for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}function B(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(e[n],n,e)}function St(e){var t=[];return B(e,function(n,r){t.push(r)}),t}function Z(e,t,n){for(var r=0;r<e.length;r++)t.call(n||window,e[r],r,e)}function Ct(e,t){for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r,e,n));return n}function Tt(e,t){t=t||function(i){return!!i};for(var n=[],r=0;r<e.length;r++)t(e[r],r,e,n)&&n.push(e[r]);return n}function kt(e,t){var n={};return B(e,function(r,i){(t&&t(r,i,e,n)||r)&&(n[i]=r)}),n}function Pt(e,t){for(var n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1}function ge(e){return function pe(e,t){var n={};return B(e,function(r,i){n[i]=t(r)}),n}(e,function(t){return"object"==typeof t&&(t=rt(t)),encodeURIComponent(function Zt(e){return oe(re(e))}(t.toString()))})}function ye(e){return Ct(function de(e){var t=[];return B(e,function(n,r){t.push([r,n])}),t}(ge(kt(e,function(r){return void 0!==r}))),E.method("join","=")).join("&")}function rt(e){try{return JSON.stringify(e)}catch{return JSON.stringify(function _e(e){var t=[],n=[];return function r(i,o){var s,a,l;switch(typeof i){case"object":if(!i)return null;for(s=0;s<t.length;s+=1)if(t[s]===i)return{$ref:n[s]};if(t.push(i),n.push(o),"[object Array]"===Object.prototype.toString.apply(i))for(l=[],s=0;s<i.length;s+=1)l[s]=r(i[s],o+"["+s+"]");else for(a in l={},i)Object.prototype.hasOwnProperty.call(i,a)&&(l[a]=r(i[a],o+"["+JSON.stringify(a)+"]"));return l;case"number":case"string":case"boolean":return i}}(e,"$")}(e))}}var me=function(){function e(){this.globalLog=function(t){window.console&&window.console.log&&window.console.log(t)}}return e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.log(this.globalLog,t)},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.log(this.globalLogWarn,t)},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.log(this.globalLogError,t)},e.prototype.globalLogWarn=function(t){window.console&&window.console.warn?window.console.warn(t):this.globalLog(t)},e.prototype.globalLogError=function(t){window.console&&window.console.error?window.console.error(t):this.globalLogWarn(t)},e.prototype.log=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=fe.apply(this,arguments);vt.log?vt.log(i):vt.logToConsole&&t.bind(this)(i)},e}(),x=new me,we=function(e,t,n,r,i){(void 0!==n.headers||null!=n.headersProvider)&&x.warn("To send headers with the "+r.toString()+" request, you must use AJAX, rather than JSONP.");var o=e.nextAuthCallbackID.toString();e.nextAuthCallbackID++;var s=e.getDocument(),a=s.createElement("script");e.auth_callbacks[o]=function(b){i(null,b)},a.src=n.endpoint+"?callback="+encodeURIComponent("Pusher.auth_callbacks['"+o+"']")+"&"+t;var h=s.getElementsByTagName("head")[0]||s.documentElement;h.insertBefore(a,h.firstChild)},Se=function(){function e(t){this.src=t}return e.prototype.send=function(t){var n=this,r="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(r)},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+"('"+r+"');",n.script.async=n.errorScript.async=!1):n.script.async=!0;var i=document.getElementsByTagName("head")[0];i.insertBefore(n.script,i.firstChild),n.errorScript&&i.insertBefore(n.errorScript,n.script.nextSibling)},e.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},e}(),Ce=Se,Te=function(){function e(t,n){this.url=t,this.data=n}return e.prototype.send=function(t){if(!this.request){var n=ye(this.data);this.request=d.createScriptRequest(this.url+"/"+t.number+"?"+n),this.request.send(t)}},e.prototype.cleanup=function(){this.request&&this.request.cleanup()},e}(),ke=Te,Oe={name:"jsonp",getAgent:function(e,t){return function(n,r){var s=d.createJSONPRequest("http"+(t?"s":"")+"://"+(e.host||e.options.host)+e.options.path,n),a=d.ScriptReceivers.create(function(l,h){f.remove(a),s.cleanup(),h&&h.host&&(e.host=h.host),r&&r(l,h)});s.send(a)}}};function at(e,t,n){return e+(t.useTLS?"s":"")+"://"+(t.useTLS?t.hostTLS:t.hostNonTLS)+n}function ct(e,t){return"/app/"+e+"?protocol="+m.PROTOCOL+"&client=js&version="+m.VERSION+(t?"&"+t:"")}var Ae={getInitial:function(e,t){return at("ws",t,(t.httpPath||"")+ct(e,"flash=false"))}},Le={getInitial:function(e,t){return at("http",t,(t.httpPath||"/pusher")+ct(e))}},Ee={getInitial:function(e,t){return at("http",t,t.httpPath||"/pusher")},getPath:function(e,t){return ct(e)}},Re=function(){function e(){this._callbacks={}}return e.prototype.get=function(t){return this._callbacks[ut(t)]},e.prototype.add=function(t,n,r){var i=ut(t);this._callbacks[i]=this._callbacks[i]||[],this._callbacks[i].push({fn:n,context:r})},e.prototype.remove=function(t,n,r){if(t||n||r){var i=t?[ut(t)]:St(this._callbacks);n||r?this.removeCallback(i,n,r):this.removeAllCallbacks(i)}else this._callbacks={}},e.prototype.removeCallback=function(t,n,r){Z(t,function(i){this._callbacks[i]=Tt(this._callbacks[i]||[],function(o){return n&&n!==o.fn||r&&r!==o.context}),0===this._callbacks[i].length&&delete this._callbacks[i]},this)},e.prototype.removeAllCallbacks=function(t){Z(t,function(n){delete this._callbacks[n]},this)},e}(),je=Re;function ut(e){return"_"+e}var Ie=function(){function e(t){this.callbacks=new je,this.global_callbacks=[],this.failThrough=t}return e.prototype.bind=function(t,n,r){return this.callbacks.add(t,n,r),this},e.prototype.bind_global=function(t){return this.global_callbacks.push(t),this},e.prototype.unbind=function(t,n,r){return this.callbacks.remove(t,n,r),this},e.prototype.unbind_global=function(t){return t?(this.global_callbacks=Tt(this.global_callbacks||[],function(n){return n!==t}),this):(this.global_callbacks=[],this)},e.prototype.unbind_all=function(){return this.unbind(),this.unbind_global(),this},e.prototype.emit=function(t,n,r){for(var i=0;i<this.global_callbacks.length;i++)this.global_callbacks[i](t,n);var o=this.callbacks.get(t),s=[];if(r?s.push(n,r):n&&s.push(n),o&&o.length>0)for(i=0;i<o.length;i++)o[i].fn.apply(o[i].context||window,s);else this.failThrough&&this.failThrough(t,n);return this},e}(),F=Ie,Ne=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),De=function(e){function t(n,r,i,o,s){var a=e.call(this)||this;return a.initialize=d.transportConnectionInitializer,a.hooks=n,a.name=r,a.priority=i,a.key=o,a.options=s,a.state="new",a.timeline=s.timeline,a.activityTimeout=s.activityTimeout,a.id=a.timeline.generateUniqueID(),a}return Ne(t,e),t.prototype.handlesActivityChecks=function(){return!!this.hooks.handlesActivityChecks},t.prototype.supportsPing=function(){return!!this.hooks.supportsPing},t.prototype.connect=function(){var n=this;if(this.socket||"initialized"!==this.state)return!1;var r=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(r,this.options)}catch(i){return E.defer(function(){n.onError(i),n.changeState("closed")}),!1}return this.bindListeners(),x.debug("Connecting",{transport:this.name,url:r}),this.changeState("connecting"),!0},t.prototype.close=function(){return!!this.socket&&(this.socket.close(),!0)},t.prototype.send=function(n){var r=this;return"open"===this.state&&(E.defer(function(){r.socket&&r.socket.send(n)}),!0)},t.prototype.ping=function(){"open"===this.state&&this.supportsPing()&&this.socket.ping()},t.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},t.prototype.onError=function(n){this.emit("error",{type:"WebSocketError",error:n}),this.timeline.error(this.buildTimelineMessage({error:n.toString()}))},t.prototype.onClose=function(n){n?this.changeState("closed",{code:n.code,reason:n.reason,wasClean:n.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0},t.prototype.onMessage=function(n){this.emit("message",n)},t.prototype.onActivity=function(){this.emit("activity")},t.prototype.bindListeners=function(){var n=this;this.socket.onopen=function(){n.onOpen()},this.socket.onerror=function(r){n.onError(r)},this.socket.onclose=function(r){n.onClose(r)},this.socket.onmessage=function(r){n.onMessage(r)},this.supportsPing()&&(this.socket.onactivity=function(){n.onActivity()})},t.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))},t.prototype.changeState=function(n,r){this.state=n,this.timeline.info(this.buildTimelineMessage({state:n,params:r})),this.emit(n,r)},t.prototype.buildTimelineMessage=function(n){return j({cid:this.id},n)},t}(F),Ue=De,He=function(){function e(t){this.hooks=t}return e.prototype.isSupported=function(t){return this.hooks.isSupported(t)},e.prototype.createConnection=function(t,n,r,i){return new Ue(this.hooks,t,n,r,i)},e}(),Q=He,Me=new Q({urls:Ae,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!d.getWebSocketAPI()},isSupported:function(){return!!d.getWebSocketAPI()},getSocket:function(e){return d.createWebSocket(e)}}),xt={urls:Le,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},Ot=j({getSocket:function(e){return d.HTTPFactory.createStreamingSocket(e)}},xt),At=j({getSocket:function(e){return d.HTTPFactory.createPollingSocket(e)}},xt),Lt={isSupported:function(){return d.isXHRSupported()}},it={ws:Me,xhr_streaming:new Q(j({},Ot,Lt)),xhr_polling:new Q(j({},At,Lt))},Fe=new Q({file:"sockjs",urls:Ee,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return void 0!==window.SockJS},getSocket:function(e,t){return new window.SockJS(e,null,{js_path:_.getPath("sockjs",{useTLS:t.useTLS}),ignore_null_origin:t.ignoreNullOrigin})},beforeOpen:function(e,t){e.send(JSON.stringify({path:t}))}}),Et={isSupported:function(e){return d.isXDRSupported(e.useTLS)}},Xe=new Q(j({},Ot,Et)),Je=new Q(j({},At,Et));it.xdr_streaming=Xe,it.xdr_polling=Je,it.sockjs=Fe;var We=it,Ge=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ve=function(e){function t(){var n=e.call(this)||this,r=n;return void 0!==window.addEventListener&&(window.addEventListener("online",function(){r.emit("online")},!1),window.addEventListener("offline",function(){r.emit("offline")},!1)),n}return Ge(t,e),t.prototype.isOnline=function(){return void 0===window.navigator.onLine||window.navigator.onLine},t}(F),Ke=new Ve,Qe=function(){function e(t,n,r){this.manager=t,this.transport=n,this.minPingDelay=r.minPingDelay,this.maxPingDelay=r.maxPingDelay,this.pingDelay=void 0}return e.prototype.createConnection=function(t,n,r,i){var o=this;i=j({},i,{activityTimeout:this.pingDelay});var s=this.transport.createConnection(t,n,r,i),a=null,l=function(){s.unbind("open",l),s.bind("closed",h),a=E.now()},h=function(b){if(s.unbind("closed",h),1002===b.code||1003===b.code)o.manager.reportDeath();else if(!b.wasClean&&a){var O=E.now()-a;O<2*o.maxPingDelay&&(o.manager.reportDeath(),o.pingDelay=Math.max(O/2,o.minPingDelay))}};return s.bind("open",l),s},e.prototype.isSupported=function(t){return this.manager.isAlive()&&this.transport.isSupported(t)},e}(),Ye=Qe,Rt={decodeMessage:function(e){try{var t=JSON.parse(e.data),n=t.data;if("string"==typeof n)try{n=JSON.parse(t.data)}catch{}var r={event:t.event,channel:t.channel,data:n};return t.user_id&&(r.user_id=t.user_id),r}catch(i){throw{type:"MessageParseError",error:i,data:e.data}}},encodeMessage:function(e){return JSON.stringify(e)},processHandshake:function(e){var t=Rt.decodeMessage(e);if("pusher:connection_established"===t.event){if(!t.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:t.data.socket_id,activityTimeout:1e3*t.data.activity_timeout}}if("pusher:error"===t.event)return{action:this.getCloseAction(t.data),error:this.getCloseError(t.data)};throw"Invalid handshake"},getCloseAction:function(e){return e.code<4e3?e.code>=1002&&e.code<=1004?"backoff":null:4e3===e.code?"tls_only":e.code<4100?"refused":e.code<4200?"backoff":e.code<4300?"retry":"refused"},getCloseError:function(e){return 1e3!==e.code&&1001!==e.code?{type:"PusherError",data:{code:e.code,message:e.reason||e.message}}:null}},W=Rt,$e=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ze=function(e){function t(n,r){var i=e.call(this)||this;return i.id=n,i.transport=r,i.activityTimeout=r.activityTimeout,i.bindListeners(),i}return $e(t,e),t.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},t.prototype.send=function(n){return this.transport.send(n)},t.prototype.send_event=function(n,r,i){var o={event:n,data:r};return i&&(o.channel=i),x.debug("Event sent",o),this.send(W.encodeMessage(o))},t.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},t.prototype.close=function(){this.transport.close()},t.prototype.bindListeners=function(){var n=this,r={message:function(o){var s;try{s=W.decodeMessage(o)}catch(a){n.emit("error",{type:"MessageParseError",error:a,data:o.data})}if(void 0!==s){switch(x.debug("Event recd",s),s.event){case"pusher:error":n.emit("error",{type:"PusherError",data:s.data});break;case"pusher:ping":n.emit("ping");break;case"pusher:pong":n.emit("pong")}n.emit("message",s)}},activity:function(){n.emit("activity")},error:function(o){n.emit("error",o)},closed:function(o){i(),o&&o.code&&n.handleCloseEvent(o),n.transport=null,n.emit("closed")}},i=function(){B(r,function(o,s){n.transport.unbind(s,o)})};B(r,function(o,s){n.transport.bind(s,o)})},t.prototype.handleCloseEvent=function(n){var r=W.getCloseAction(n),i=W.getCloseError(n);i&&this.emit("error",i),r&&this.emit(r,{action:r,error:i})},t}(F),tn=Ze,en=function(){function e(t,n){this.transport=t,this.callback=n,this.bindListeners()}return e.prototype.close=function(){this.unbindListeners(),this.transport.close()},e.prototype.bindListeners=function(){var t=this;this.onMessage=function(n){var r;t.unbindListeners();try{r=W.processHandshake(n)}catch(i){return t.finish("error",{error:i}),void t.transport.close()}"connected"===r.action?t.finish("connected",{connection:new tn(r.id,t.transport),activityTimeout:r.activityTimeout}):(t.finish(r.action,{error:r.error}),t.transport.close())},this.onClosed=function(n){t.unbindListeners();var r=W.getCloseAction(n)||"backoff",i=W.getCloseError(n);t.finish(r,{error:i})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},e.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},e.prototype.finish=function(t,n){this.callback(j({transport:this.transport,action:t},n))},e}(),nn=en,rn=function(){function e(t,n){this.timeline=t,this.options=n||{}}return e.prototype.send=function(t,n){this.timeline.isEmpty()||this.timeline.send(d.TimelineTransport.getAgent(this,t),n)},e}(),on=rn,sn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),an=function(e){function t(n,r){var i=e.call(this,function(o,s){x.debug("No callbacks on "+n+" for "+o)})||this;return i.name=n,i.pusher=r,i.subscribed=!1,i.subscriptionPending=!1,i.subscriptionCancelled=!1,i}return sn(t,e),t.prototype.authorize=function(n,r){return r(null,{auth:""})},t.prototype.trigger=function(n,r){if(0!==n.indexOf("client-"))throw new v("Event '"+n+"' does not start with 'client-'");if(!this.subscribed){var i=p_buildLogSuffix("triggeringClientEvents");x.warn("Client event triggered before channel 'subscription_succeeded' event . "+i)}return this.pusher.send_event(n,r,this.name)},t.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},t.prototype.handleEvent=function(n){var r=n.event,i=n.data;"pusher_internal:subscription_succeeded"===r?this.handleSubscriptionSucceededEvent(n):"pusher_internal:subscription_count"===r?this.handleSubscriptionCountEvent(n):0!==r.indexOf("pusher_internal:")&&this.emit(r,i,{})},t.prototype.handleSubscriptionSucceededEvent=function(n){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",n.data)},t.prototype.handleSubscriptionCountEvent=function(n){n.data.subscription_count&&(this.subscriptionCount=n.data.subscription_count),this.emit("pusher:subscription_count",n.data)},t.prototype.subscribe=function(){var n=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,function(r,i){r?(n.subscriptionPending=!1,x.error(r.toString()),n.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:r.message},r instanceof H?{status:r.status}:{}))):n.pusher.send_event("pusher:subscribe",{auth:i.auth,channel_data:i.channel_data,channel:n.name})}))},t.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},t.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},t.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},t}(F),ht=an,cn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),un=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return cn(t,e),t.prototype.authorize=function(n,r){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:n},r)},t}(ht),ft=un,hn=function(){function e(){this.reset()}return e.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null},e.prototype.each=function(t){var n=this;B(this.members,function(r,i){t(n.get(i))})},e.prototype.setMyID=function(t){this.myID=t},e.prototype.onSubscription=function(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)},e.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)},e.prototype.removeMember=function(t){var n=this.get(t.user_id);return n&&(delete this.members[t.user_id],this.count--),n},e.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},e}(),fn=hn,ln=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pn=function(e,t,n,r){return new(n||(n=Promise))(function(o,s){function a(b){try{h(r.next(b))}catch(O){s(O)}}function l(b){try{h(r.throw(b))}catch(O){s(O)}}function h(b){b.done?o(b.value):function i(o){return o instanceof n?o:new n(function(s){s(o)})}(b.value).then(a,l)}h((r=r.apply(e,t||[])).next())})},dn=function(e,t){var r,i,o,s,n={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(h){return function(b){return function l(h){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=2&h[0]?i.return:h[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,h[1])).done)return o;switch(i=0,o&&(h=[2&h[0],o.value]),h[0]){case 0:case 1:o=h;break;case 4:return n.label++,{value:h[1],done:!1};case 5:n.label++,i=h[1],h=[0];continue;case 7:h=n.ops.pop(),n.trys.pop();continue;default:if(!(o=(o=n.trys).length>0&&o[o.length-1])&&(6===h[0]||2===h[0])){n=0;continue}if(3===h[0]&&(!o||h[1]>o[0]&&h[1]<o[3])){n.label=h[1];break}if(6===h[0]&&n.label<o[1]){n.label=o[1],o=h;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(h);break}o[2]&&n.ops.pop(),n.trys.pop();continue}h=t.call(e,n)}catch(b){h=[6,b],i=0}finally{r=o=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([h,b])}}},vn=function(e){function t(n,r){var i=e.call(this,n,r)||this;return i.members=new fn,i}return ln(t,e),t.prototype.authorize=function(n,r){var i=this;e.prototype.authorize.call(this,n,function(o,s){return pn(i,void 0,void 0,function(){var a,l;return dn(this,function(h){switch(h.label){case 0:return o?[3,3]:null==s.channel_data?[3,1]:(a=JSON.parse(s.channel_data),this.members.setMyID(a.user_id),[3,3]);case 1:return[4,this.pusher.user.signinDonePromise];case 2:if(h.sent(),null==this.pusher.user.user_data)return l=p_buildLogSuffix("authorizationEndpoint"),x.error("Invalid auth response for channel '"+this.name+"', expected 'channel_data' field. "+l+", or the user should be signed in."),r("Invalid auth response"),[2];this.members.setMyID(this.pusher.user.user_data.id),h.label=3;case 3:return r(o,s),[2]}})})})},t.prototype.handleEvent=function(n){var r=n.event;if(0===r.indexOf("pusher_internal:"))this.handleInternalEvent(n);else{var i=n.data,o={};n.user_id&&(o.user_id=n.user_id),this.emit(r,i,o)}},t.prototype.handleInternalEvent=function(n){var i=n.data;switch(n.event){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(n);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(n);break;case"pusher_internal:member_added":var o=this.members.addMember(i);this.emit("pusher:member_added",o);break;case"pusher_internal:member_removed":var s=this.members.removeMember(i);s&&this.emit("pusher:member_removed",s)}},t.prototype.handleSubscriptionSucceededEvent=function(n){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(n.data),this.emit("pusher:subscription_succeeded",this.members))},t.prototype.disconnect=function(){this.members.reset(),e.prototype.disconnect.call(this)},t}(ft),gn=vn,yn=C(1),lt=C(0),_n=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mn=function(e){function t(n,r,i){var o=e.call(this,n,r)||this;return o.key=null,o.nacl=i,o}return _n(t,e),t.prototype.authorize=function(n,r){var i=this;e.prototype.authorize.call(this,n,function(o,s){if(o)r(o,s);else{var a=s.shared_secret;a?(i.key=Object(lt.decode)(a),delete s.shared_secret,r(null,s)):r(new Error("No shared_secret key in auth payload for encrypted channel: "+i.name),null)}})},t.prototype.trigger=function(n,r){throw new z("Client events are not currently supported for encrypted channels")},t.prototype.handleEvent=function(n){var r=n.event,i=n.data;0!==r.indexOf("pusher_internal:")&&0!==r.indexOf("pusher:")?this.handleEncryptedEvent(r,i):e.prototype.handleEvent.call(this,n)},t.prototype.handleEncryptedEvent=function(n,r){var i=this;if(this.key)if(r.ciphertext&&r.nonce){var o=Object(lt.decode)(r.ciphertext);if(o.length<this.nacl.secretbox.overheadLength)x.error("Expected encrypted event ciphertext length to be "+this.nacl.secretbox.overheadLength+", got: "+o.length);else{var s=Object(lt.decode)(r.nonce);if(s.length<this.nacl.secretbox.nonceLength)x.error("Expected encrypted event nonce length to be "+this.nacl.secretbox.nonceLength+", got: "+s.length);else{var a=this.nacl.secretbox.open(o,s,this.key);if(null===a)return x.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(l,h){l?x.error("Failed to make a request to the authEndpoint: "+h+". Unable to fetch new key, so dropping encrypted event"):null!==(a=i.nacl.secretbox.open(o,s,i.key))?i.emit(n,i.getDataToEmit(a)):x.error("Failed to decrypt event with new key. Dropping encrypted event")});this.emit(n,this.getDataToEmit(a))}}}else x.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+r);else x.debug("Received encrypted event before key has been retrieved from the authEndpoint")},t.prototype.getDataToEmit=function(n){var r=Object(yn.decode)(n);try{return JSON.parse(r)}catch{return r}},t}(ft),bn=mn,wn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sn=function(e){function t(n,r){var i=e.call(this)||this;i.state="initialized",i.connection=null,i.key=n,i.options=r,i.timeline=i.options.timeline,i.usingTLS=i.options.useTLS,i.errorCallbacks=i.buildErrorCallbacks(),i.connectionCallbacks=i.buildConnectionCallbacks(i.errorCallbacks),i.handshakeCallbacks=i.buildHandshakeCallbacks(i.errorCallbacks);var o=d.getNetwork();return o.bind("online",function(){i.timeline.info({netinfo:"online"}),("connecting"===i.state||"unavailable"===i.state)&&i.retryIn(0)}),o.bind("offline",function(){i.timeline.info({netinfo:"offline"}),i.connection&&i.sendActivityCheck()}),i.updateStrategy(),i}return wn(t,e),t.prototype.connect=function(){if(!this.connection&&!this.runner){if(!this.strategy.isSupported())return void this.updateState("failed");this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}},t.prototype.send=function(n){return!!this.connection&&this.connection.send(n)},t.prototype.send_event=function(n,r,i){return!!this.connection&&this.connection.send_event(n,r,i)},t.prototype.disconnect=function(){this.disconnectInternally(),this.updateState("disconnected")},t.prototype.isUsingTLS=function(){return this.usingTLS},t.prototype.startConnecting=function(){var n=this,r=function(i,o){i?n.runner=n.strategy.connect(0,r):"error"===o.action?(n.emit("error",{type:"HandshakeError",error:o.error}),n.timeline.error({handshakeError:o.error})):(n.abortConnecting(),n.handshakeCallbacks[o.action](o))};this.runner=this.strategy.connect(0,r)},t.prototype.abortConnecting=function(){this.runner&&(this.runner.abort(),this.runner=null)},t.prototype.disconnectInternally=function(){this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection&&this.abandonConnection().close()},t.prototype.updateStrategy=function(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})},t.prototype.retryIn=function(n){var r=this;this.timeline.info({action:"retry",delay:n}),n>0&&this.emit("connecting_in",Math.round(n/1e3)),this.retryTimer=new J(n||0,function(){r.disconnectInternally(),r.connect()})},t.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},t.prototype.setUnavailableTimer=function(){var n=this;this.unavailableTimer=new J(this.options.unavailableTimeout,function(){n.updateState("unavailable")})},t.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},t.prototype.sendActivityCheck=function(){var n=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new J(this.options.pongTimeout,function(){n.timeline.error({pong_timed_out:n.options.pongTimeout}),n.retryIn(0)})},t.prototype.resetActivityCheck=function(){var n=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new J(this.activityTimeout,function(){n.sendActivityCheck()}))},t.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},t.prototype.buildConnectionCallbacks=function(n){var r=this;return j({},n,{message:function(i){r.resetActivityCheck(),r.emit("message",i)},ping:function(){r.send_event("pusher:pong",{})},activity:function(){r.resetActivityCheck()},error:function(i){r.emit("error",i)},closed:function(){r.abandonConnection(),r.shouldRetry()&&r.retryIn(1e3)}})},t.prototype.buildHandshakeCallbacks=function(n){var r=this;return j({},n,{connected:function(i){r.activityTimeout=Math.min(r.options.activityTimeout,i.activityTimeout,i.connection.activityTimeout||1/0),r.clearUnavailableTimer(),r.setConnection(i.connection),r.socket_id=r.connection.id,r.updateState("connected",{socket_id:r.socket_id})}})},t.prototype.buildErrorCallbacks=function(){var n=this,r=function(i){return function(o){o.error&&n.emit("error",{type:"WebSocketError",error:o.error}),i(o)}};return{tls_only:r(function(){n.usingTLS=!0,n.updateStrategy(),n.retryIn(0)}),refused:r(function(){n.disconnect()}),backoff:r(function(){n.retryIn(1e3)}),retry:r(function(){n.retryIn(0)})}},t.prototype.setConnection=function(n){for(var r in this.connection=n,this.connectionCallbacks)this.connection.bind(r,this.connectionCallbacks[r]);this.resetActivityCheck()},t.prototype.abandonConnection=function(){if(this.connection){for(var n in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(n,this.connectionCallbacks[n]);var r=this.connection;return this.connection=null,r}},t.prototype.updateState=function(n,r){var i=this.state;if(this.state=n,i!==n){var o=n;"connected"===o&&(o+=" with new socket ID "+r.socket_id),x.debug("State changed",i+" -> "+o),this.timeline.info({state:n,params:r}),this.emit("state_change",{previous:i,current:n}),this.emit(n,r)}},t.prototype.shouldRetry=function(){return"connecting"===this.state||"connected"===this.state},t}(F),Cn=Sn,Tn=function(){function e(){this.channels={}}return e.prototype.add=function(t,n){return this.channels[t]||(this.channels[t]=function Pn(e,t){if(0===e.indexOf("private-encrypted-")){if(t.config.nacl)return X.createEncryptedChannel(e,t,t.config.nacl);var n="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",r=p_buildLogSuffix("encryptedChannelSupport");throw new z(n+". "+r)}if(0===e.indexOf("private-"))return X.createPrivateChannel(e,t);if(0===e.indexOf("presence-"))return X.createPresenceChannel(e,t);if(0===e.indexOf("#"))throw new P('Cannot create a channel with name "'+e+'".');return X.createChannel(e,t)}(t,n)),this.channels[t]},e.prototype.all=function(){return function le(e){var t=[];return B(e,function(n){t.push(n)}),t}(this.channels)},e.prototype.find=function(t){return this.channels[t]},e.prototype.remove=function(t){var n=this.channels[t];return delete this.channels[t],n},e.prototype.disconnect=function(){B(this.channels,function(t){t.disconnect()})},e}(),kn=Tn;var xn={createChannels:function(){return new kn},createConnectionManager:function(e,t){return new Cn(e,t)},createChannel:function(e,t){return new ht(e,t)},createPrivateChannel:function(e,t){return new ft(e,t)},createPresenceChannel:function(e,t){return new gn(e,t)},createEncryptedChannel:function(e,t,n){return new bn(e,t,n)},createTimelineSender:function(e,t){return new on(e,t)},createHandshake:function(e,t){return new nn(e,t)},createAssistantToTheTransportManager:function(e,t,n){return new Ye(e,t,n)}},X=xn,On=function(){function e(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}return e.prototype.getAssistant=function(t){return X.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},e.prototype.isAlive=function(){return this.livesLeft>0},e.prototype.reportDeath=function(){this.livesLeft-=1},e}(),jt=On,An=function(){function e(t,n){this.strategies=t,this.loop=!!n.loop,this.failFast=!!n.failFast,this.timeout=n.timeout,this.timeoutLimit=n.timeoutLimit}return e.prototype.isSupported=function(){return Pt(this.strategies,E.method("isSupported"))},e.prototype.connect=function(t,n){var r=this,i=this.strategies,o=0,s=this.timeout,a=null,l=function(h,b){b?n(null,b):(o+=1,r.loop&&(o%=i.length),o<i.length?(s&&(s*=2,r.timeoutLimit&&(s=Math.min(s,r.timeoutLimit))),a=r.tryStrategy(i[o],t,{timeout:s,failFast:r.failFast},l)):n(!0))};return a=this.tryStrategy(i[o],t,{timeout:s,failFast:this.failFast},l),{abort:function(){a.abort()},forceMinPriority:function(h){t=h,a&&a.forceMinPriority(h)}}},e.prototype.tryStrategy=function(t,n,r,i){var o=null,s=null;return r.timeout>0&&(o=new J(r.timeout,function(){s.abort(),i(!0)})),s=t.connect(n,function(a,l){a&&o&&o.isRunning()&&!r.failFast||(o&&o.ensureAborted(),i(a,l))}),{abort:function(){o&&o.ensureAborted(),s.abort()},forceMinPriority:function(a){s.forceMinPriority(a)}}},e}(),G=An,Ln=function(){function e(t){this.strategies=t}return e.prototype.isSupported=function(){return Pt(this.strategies,E.method("isSupported"))},e.prototype.connect=function(t,n){return function En(e,t,n){var r=Ct(e,function(i,o,s,a){return i.connect(t,n(o,a))});return{abort:function(){Z(r,jn)},forceMinPriority:function(i){Z(r,function(o){o.forceMinPriority(i)})}}}(this.strategies,t,function(r,i){return function(o,s){i[r].error=o,o?function Rn(e){return function ve(e,t){for(var n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0}(e,function(t){return!!t.error})}(i)&&n(!0):(Z(i,function(a){a.forceMinPriority(s.transport.priority)}),n(null,s))}})},e}(),pt=Ln;function jn(e){!e.error&&!e.aborted&&(e.abort(),e.aborted=!0)}var In=function(){function e(t,n,r){this.strategy=t,this.transports=n,this.ttl=r.ttl||18e5,this.usingTLS=r.useTLS,this.timeline=r.timeline}return e.prototype.isSupported=function(){return this.strategy.isSupported()},e.prototype.connect=function(t,n){var r=this.usingTLS,i=function Dn(e){var t=d.getLocalStorage();if(t)try{var n=t[dt(e)];if(n)return JSON.parse(n)}catch{It(e)}return null}(r),o=[this.strategy];if(i&&i.timestamp+this.ttl>=E.now()){var s=this.transports[i.transport];s&&(this.timeline.info({cached:!0,transport:i.transport,latency:i.latency}),o.push(new G([s],{timeout:2*i.latency+1e3,failFast:!0})))}var a=E.now(),l=o.pop().connect(t,function h(b,O){b?(It(r),o.length>0?(a=E.now(),l=o.pop().connect(t,h)):n(b)):(function Un(e,t,n){var r=d.getLocalStorage();if(r)try{r[dt(e)]=rt({timestamp:E.now(),transport:t,latency:n})}catch{}}(r,O.transport.name,E.now()-a),n(null,O))});return{abort:function(){l.abort()},forceMinPriority:function(h){t=h,l&&l.forceMinPriority(h)}}},e}(),Nn=In;function dt(e){return"pusherTransport"+(e?"TLS":"NonTLS")}function It(e){var t=d.getLocalStorage();if(t)try{delete t[dt(e)]}catch{}}var Hn=function(){function e(t,n){var r=n.delay;this.strategy=t,this.options={delay:r}}return e.prototype.isSupported=function(){return this.strategy.isSupported()},e.prototype.connect=function(t,n){var i,r=this.strategy,o=new J(this.options.delay,function(){i=r.connect(t,n)});return{abort:function(){o.ensureAborted(),i&&i.abort()},forceMinPriority:function(s){t=s,i&&i.forceMinPriority(s)}}},e}(),ot=Hn,Mn=function(){function e(t,n,r){this.test=t,this.trueBranch=n,this.falseBranch=r}return e.prototype.isSupported=function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()},e.prototype.connect=function(t,n){return(this.test()?this.trueBranch:this.falseBranch).connect(t,n)},e}(),tt=Mn,qn=function(){function e(t){this.strategy=t}return e.prototype.isSupported=function(){return this.strategy.isSupported()},e.prototype.connect=function(t,n){var r=this.strategy.connect(t,function(i,o){o&&r.abort(),n(i,o)});return r},e}(),zn=qn;function et(e){return function(){return e.isSupported()}}var Fn=function(e,t,n){var r={};function i(Kt,Kr,Qr,Yr,$r){var Qt=n(e,Kt,Kr,Qr,Yr,$r);return r[Kt]=Qt,Qt}var yt,o=Object.assign({},t,{hostNonTLS:e.wsHost+":"+e.wsPort,hostTLS:e.wsHost+":"+e.wssPort,httpPath:e.wsPath}),s=Object.assign({},o,{useTLS:!0}),a=Object.assign({},t,{hostNonTLS:e.httpHost+":"+e.httpPort,hostTLS:e.httpHost+":"+e.httpsPort,httpPath:e.httpPath}),l={loop:!0,timeout:15e3,timeoutLimit:6e4},h=new jt({lives:2,minPingDelay:1e4,maxPingDelay:e.activityTimeout}),b=new jt({lives:2,minPingDelay:1e4,maxPingDelay:e.activityTimeout}),O=i("ws","ws",3,o,h),M=i("wss","ws",3,s,h),Xr=i("sockjs","sockjs",1,a),Ft=i("xhr_streaming","xhr_streaming",1,a,b),Jr=i("xdr_streaming","xdr_streaming",1,a,b),Xt=i("xhr_polling","xhr_polling",1,a),Wr=i("xdr_polling","xdr_polling",1,a),Jt=new G([O],l),Gr=new G([M],l),Vr=new G([Xr],l),Wt=new G([new tt(et(Ft),Ft,Jr)],l),Gt=new G([new tt(et(Xt),Xt,Wr)],l),Vt=new G([new tt(et(Wt),new pt([Wt,new ot(Gt,{delay:4e3})]),Gt)],l),gt=new tt(et(Vt),Vt,Vr);return yt=new pt(t.useTLS?[Jt,new ot(gt,{delay:2e3})]:[Jt,new ot(Gr,{delay:2e3}),new ot(gt,{delay:5e3})]),new Nn(new zn(new tt(et(O),yt,gt)),r,{ttl:18e5,timeline:t.timeline,useTLS:t.useTLS})},Jn={getRequest:function(e){var t=new window.XDomainRequest;return t.ontimeout=function(){e.emit("error",new L),e.close()},t.onerror=function(n){e.emit("error",n),e.close()},t.onprogress=function(){t.responseText&&t.responseText.length>0&&e.onChunk(200,t.responseText)},t.onload=function(){t.responseText&&t.responseText.length>0&&e.onChunk(200,t.responseText),e.emit("finished",200),e.close()},t},abortRequest:function(e){e.ontimeout=e.onerror=e.onprogress=e.onload=null,e.abort()}},Wn=Jn,Gn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kn=function(e){function t(n,r,i){var o=e.call(this)||this;return o.hooks=n,o.method=r,o.url=i,o}return Gn(t,e),t.prototype.start=function(n){var r=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){r.close()},d.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(n)},t.prototype.close=function(){this.unloader&&(d.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},t.prototype.onChunk=function(n,r){for(;;){var i=this.advanceBuffer(r);if(!i)break;this.emit("chunk",{status:n,data:i})}this.isBufferTooLong(r)&&this.emit("buffer_too_long")},t.prototype.advanceBuffer=function(n){var r=n.slice(this.position),i=r.indexOf("\n");return-1!==i?(this.position+=i+1,r.slice(0,i)):null},t.prototype.isBufferTooLong=function(n){return this.position===n.length&&n.length>262144},t}(F),Qn=Kn,Nt=function(e){return e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSED=3]="CLOSED",e}(Nt||{}),V=Nt,Yn=1,$n=function(){function e(t,n){this.hooks=t,this.session=Ut(1e3)+"/"+function nr(e){for(var t=[],n=0;n<e;n++)t.push(Ut(32).toString(32));return t.join("")}(8),this.location=function Zn(e){var t=/([^\?]*)\/*(\??.*)/.exec(e);return{base:t[1],queryString:t[2]}}(n),this.readyState=V.CONNECTING,this.openStream()}return e.prototype.send=function(t){return this.sendRaw(JSON.stringify([t]))},e.prototype.ping=function(){this.hooks.sendHeartbeat(this)},e.prototype.close=function(t,n){this.onClose(t,n,!0)},e.prototype.sendRaw=function(t){if(this.readyState!==V.OPEN)return!1;try{return d.createSocketRequest("POST",Dt(function tr(e,t){return e.base+"/"+t+"/xhr_send"}(this.location,this.session))).start(t),!0}catch{return!1}},e.prototype.reconnect=function(){this.closeStream(),this.openStream()},e.prototype.onClose=function(t,n,r){this.closeStream(),this.readyState=V.CLOSED,this.onclose&&this.onclose({code:t,reason:n,wasClean:r})},e.prototype.onChunk=function(t){var n;if(200===t.status)switch(this.readyState===V.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 i=0;i<n.length;i++)this.onEvent(n[i]);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)}},e.prototype.onOpen=function(t){this.readyState===V.CONNECTING?(t&&t.hostname&&(this.location.base=function er(e,t){var n=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(e);return n[1]+t+n[3]}(this.location.base,t.hostname)),this.readyState=V.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)},e.prototype.onEvent=function(t){this.readyState===V.OPEN&&this.onmessage&&this.onmessage({data:t})},e.prototype.onActivity=function(){this.onactivity&&this.onactivity()},e.prototype.onError=function(t){this.onerror&&this.onerror(t)},e.prototype.openStream=function(){var t=this;this.stream=d.createSocketRequest("POST",Dt(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){E.defer(function(){t.onError(n),t.onClose(1006,"Could not start streaming",!1)})}},e.prototype.closeStream=function(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)},e}();function Dt(e){var t=-1===e.indexOf("?")?"?":"&";return e+t+"t="+ +new Date+"&n="+Yn++}function Ut(e){return d.randomInt(e)}var rr=$n,or={getReceiveURL:function(e,t){return e.base+"/"+t+"/xhr_streaming"+e.queryString},onHeartbeat:function(e){e.sendRaw("[]")},sendHeartbeat:function(e){e.sendRaw("[]")},onFinished:function(e,t){e.onClose(1006,"Connection interrupted ("+t+")",!1)}},ar={getReceiveURL:function(e,t){return e.base+"/"+t+"/xhr"+e.queryString},onHeartbeat:function(){},sendHeartbeat:function(e){e.sendRaw("[]")},onFinished:function(e,t){200===t?e.reconnect():e.onClose(1006,"Connection interrupted ("+t+")",!1)}},cr={getRequest:function(e){var n=new(d.getXHRAPI());return n.onreadystatechange=n.onprogress=function(){switch(n.readyState){case 3:n.responseText&&n.responseText.length>0&&e.onChunk(n.status,n.responseText);break;case 4:n.responseText&&n.responseText.length>0&&e.onChunk(n.status,n.responseText),e.emit("finished",n.status),e.close()}},n},abortRequest:function(e){e.onreadystatechange=null,e.abort()}},ur=cr,hr={createStreamingSocket:function(e){return this.createSocket(or,e)},createPollingSocket:function(e){return this.createSocket(ar,e)},createSocket:function(e,t){return new rr(e,t)},createXHR:function(e,t){return this.createRequest(ur,e,t)},createRequest:function(e,t,n){return new Qn(e,t,n)}},Ht=hr;Ht.createXDR=function(e,t){return this.createRequest(Wn,e,t)};var lr={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:f,DependenciesReceivers:T,getDefaultStrategy:Fn,Transports:We,transportConnectionInitializer:function(){var e=this;e.timeline.info(e.buildTimelineMessage({transport:e.name+(e.options.useTLS?"s":"")})),e.hooks.isInitialized()?e.changeState("initialized"):e.hooks.file?(e.changeState("initializing"),_.load(e.hooks.file,{useTLS:e.options.useTLS},function(t,n){e.hooks.isInitialized()?(e.changeState("initialized"),n(!0)):(t&&e.onError(t),e.onClose(),n(!1))})):e.onClose()},HTTPFactory:Ht,TimelineTransport:Oe,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(e){var t=this;window.Pusher=e;var n=function(){t.onDocumentBody(e.ready)};window.JSON?n():_.load("json2",{},n)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:$t,jsonp:we}},onDocumentBody:function(e){var t=this;document.body?e():setTimeout(function(){t.onDocumentBody(e)},0)},createJSONPRequest:function(e,t){return new ke(e,t)},createScriptRequest:function(e){return new Ce(e)},getLocalStorage:function(){try{return window.localStorage}catch{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 Ke},createWebSocket:function(e){return new(this.getWebSocketAPI())(e)},createSocketRequest:function(e,t){if(this.isXHRSupported())return this.HTTPFactory.createXHR(e,t);if(this.isXDRSupported(0===t.indexOf("https:")))return this.HTTPFactory.createXDR(e,t);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var e=this.getXHRAPI();return!!e&&void 0!==(new e).withCredentials},isXDRSupported:function(e){var t=e?"https:":"http:",n=this.getProtocol();return!!window.XDomainRequest&&n===t},addUnloadListener:function(e){void 0!==window.addEventListener?window.addEventListener("unload",e,!1):void 0!==window.attachEvent&&window.attachEvent("onunload",e)},removeUnloadListener:function(e){void 0!==window.addEventListener?window.removeEventListener("unload",e,!1):void 0!==window.detachEvent&&window.detachEvent("onunload",e)},randomInt:function(e){return Math.floor((window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)*e)}},d=lr,Mt=function(e){return e[e.ERROR=3]="ERROR",e[e.INFO=6]="INFO",e[e.DEBUG=7]="DEBUG",e}(Mt||{}),st=Mt,pr=function(){function e(t,n,r){this.key=t,this.session=n,this.events=[],this.options=r||{},this.sent=0,this.uniqueID=0}return e.prototype.log=function(t,n){t<=this.options.level&&(this.events.push(j({},n,{timestamp:E.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},e.prototype.error=function(t){this.log(st.ERROR,t)},e.prototype.info=function(t){this.log(st.INFO,t)},e.prototype.debug=function(t){this.log(st.DEBUG,t)},e.prototype.isEmpty=function(){return 0===this.events.length},e.prototype.send=function(t,n){var r=this,i=j({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(i,function(o,s){o||r.sent++,n&&n(o,s)}),!0},e.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},e}(),dr=pr,vr=function(){function e(t,n,r,i){this.name=t,this.priority=n,this.transport=r,this.options=i||{}}return e.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},e.prototype.connect=function(t,n){var r=this;if(!this.isSupported())return qt(new N,n);if(this.priority<t)return qt(new R,n);var i=!1,o=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),s=null,a=function(){o.unbind("initialized",a),o.connect()},l=function(){s=X.createHandshake(o,function(M){i=!0,O(),n(null,M)})},h=function(M){O(),n(M)},b=function(){var M;O(),M=rt(o),n(new I(M))},O=function(){o.unbind("initialized",a),o.unbind("open",l),o.unbind("error",h),o.unbind("closed",b)};return o.bind("initialized",a),o.bind("open",l),o.bind("error",h),o.bind("closed",b),o.initialize(),{abort:function(){i||(O(),s?s.close():o.close())},forceMinPriority:function(M){i||r.priority<M&&(s?s.close():o.close())}}},e}(),gr=vr;function qt(e,t){return E.defer(function(){t(e)}),{abort:function(){},forceMinPriority:function(){}}}var yr=d.Transports,_r=function(e,t,n,r,i,o){var l,s=yr[n];if(!s)throw new U(n);return e.enabledTransports&&-1===wt(e.enabledTransports,t)||e.disabledTransports&&-1!==wt(e.disabledTransports,t)?l=mr:(i=Object.assign({ignoreNullOrigin:e.ignoreNullOrigin},i),l=new gr(t,r,o?o.getAssistant(s):s,i)),l},mr={isSupported:function(){return!1},connect:function(e,t){var n=E.defer(function(){t(new N)});return{abort:function(){n.ensureAborted()},forceMinPriority:function(){}}}},Sr=function(e){if(typeof d.getAuthorizers()[e.transport]>"u")throw"'"+e.transport+"' is not a recognized auth transport";return function(t,n){var r=function(e,t){var n="socket_id="+encodeURIComponent(e.socketId);for(var r in t.params)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t.params[r]);if(null!=t.paramsProvider){var i=t.paramsProvider();for(var r in i)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(i[r])}return n}(t,e);d.getAuthorizers()[e.transport](d,r,e,c.UserAuthentication,n)}},kr=function(e){if(typeof d.getAuthorizers()[e.transport]>"u")throw"'"+e.transport+"' is not a recognized auth transport";return function(t,n){var r=function(e,t){var n="socket_id="+encodeURIComponent(e.socketId);for(var r in n+="&channel_name="+encodeURIComponent(e.channelName),t.params)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t.params[r]);if(null!=t.paramsProvider){var i=t.paramsProvider();for(var r in i)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(i[r])}return n}(t,e);d.getAuthorizers()[e.transport](d,r,e,c.ChannelAuthorization,n)}},Pr=function(e,t,n){var r={authTransport:t.transport,authEndpoint:t.endpoint,auth:{params:t.params,headers:t.headers}};return function(i,o){var s=e.channel(i.channelName);n(s,r).authorize(i.socketId,o)}},Y=function(){return Y=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Y.apply(this,arguments)};function Or(e){return e.httpHost?e.httpHost:e.cluster?"sockjs-"+e.cluster+".pusher.com":m.httpHost}function Ar(e){return e.wsHost?e.wsHost:function zt(e){return"ws-"+e+".pusher.com"}(e.cluster?e.cluster:m.cluster)}function Lr(e){return"https:"===d.getProtocol()||!1!==e.forceTLS}function Er(e){return"enableStats"in e?e.enableStats:"disableStats"in e&&!e.disableStats}function Rr(e){var t=Y(Y({},m.userAuthentication),e.userAuthentication);return"customHandler"in t&&null!=t.customHandler?t.customHandler:Sr(t)}function Ir(e,t){var n=function jr(e,t){var n;return"channelAuthorization"in e?n=Y(Y({},m.channelAuthorization),e.channelAuthorization):(n={transport:e.authTransport||m.authTransport,endpoint:e.authEndpoint||m.authEndpoint},"auth"in e&&("params"in e.auth&&(n.params=e.auth.params),"headers"in e.auth&&(n.headers=e.auth.headers)),"authorizer"in e&&(n.customHandler=Pr(t,n,e.authorizer))),n}(e,t);return"customHandler"in n&&null!=n.customHandler?n.customHandler:kr(n)}var Nr=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Dr=function(e){function t(n){var r=e.call(this,function(i,o){x.debug("No callbacks on watchlist events for "+i)})||this;return r.pusher=n,r.bindWatchlistInternalEvent(),r}return Nr(t,e),t.prototype.handleEvent=function(n){var r=this;n.data.events.forEach(function(i){r.emit(i.name,i)})},t.prototype.bindWatchlistInternalEvent=function(){var n=this;this.pusher.connection.bind("message",function(r){"pusher_internal:watchlist_events"===r.event&&n.handleEvent(r)})},t}(F),Ur=Dr;var Mr=function Hr(){var e,t;return{promise:new Promise(function(r,i){e=r,t=i}),resolve:e,reject:t}},qr=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zr=function(e){function t(n){var r=e.call(this,function(i,o){x.debug("No callbacks on user for "+i)})||this;return r.signin_requested=!1,r.user_data=null,r.serverToUserChannel=null,r.signinDonePromise=null,r._signinDoneResolve=null,r._onAuthorize=function(i,o){if(i)return x.warn("Error during signin: "+i),void r._cleanup();r.pusher.send_event("pusher:signin",{auth:o.auth,user_data:o.user_data})},r.pusher=n,r.pusher.connection.bind("state_change",function(i){var o=i.previous,s=i.current;"connected"!==o&&"connected"===s&&r._signin(),"connected"===o&&"connected"!==s&&(r._cleanup(),r._newSigninPromiseIfNeeded())}),r.watchlist=new Ur(n),r.pusher.connection.bind("message",function(i){"pusher:signin_success"===i.event&&r._onSigninSuccess(i.data),r.serverToUserChannel&&r.serverToUserChannel.name===i.channel&&r.serverToUserChannel.handleEvent(i)}),r}return qr(t,e),t.prototype.signin=function(){this.signin_requested||(this.signin_requested=!0,this._signin())},t.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))},t.prototype._onSigninSuccess=function(n){try{this.user_data=JSON.parse(n.user_data)}catch{return x.error("Failed parsing user data after signin: "+n.user_data),void this._cleanup()}if("string"!=typeof this.user_data.id||""===this.user_data.id)return x.error("user_data doesn't contain an id. user_data: "+this.user_data),void this._cleanup();this._signinDoneResolve(),this._subscribeChannels()},t.prototype._subscribeChannels=function(){var i,n=this;this.serverToUserChannel=new ht("#server-to-user-"+this.user_data.id,this.pusher),this.serverToUserChannel.bind_global(function(i,o){0===i.indexOf("pusher_internal:")||0===i.indexOf("pusher:")||n.emit(i,o)}),(i=this.serverToUserChannel).subscriptionPending&&i.subscriptionCancelled?i.reinstateSubscription():!i.subscriptionPending&&"connected"===n.pusher.connection.state&&i.subscribe()},t.prototype._cleanup=function(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()},t.prototype._newSigninPromiseIfNeeded=function(){if(this.signin_requested&&(!this.signinDonePromise||this.signinDonePromise.done)){var n=Mr(),r=n.promise,i=n.resolve;r.done=!1;var s=function(){r.done=!0};r.then(s).catch(s),this.signinDonePromise=r,this._signinDoneResolve=i}},t}(F),Br=zr,Bt=function(){function e(t,n){var r=this;if(function Fr(e){if(null==e)throw"You must pass your app key when you instantiate Pusher."}(t),!(n=n||{}).cluster&&!n.wsHost&&!n.httpHost){var i=p_buildLogSuffix("javascriptQuickStart");x.warn("You should always specify a cluster when connecting. "+i)}"disableStats"in n&&x.warn("The disableStats option is deprecated in favor of enableStats"),this.key=t,this.config=function xr(e,t){var n={activityTimeout:e.activityTimeout||m.activityTimeout,cluster:e.cluster||m.cluster,httpPath:e.httpPath||m.httpPath,httpPort:e.httpPort||m.httpPort,httpsPort:e.httpsPort||m.httpsPort,pongTimeout:e.pongTimeout||m.pongTimeout,statsHost:e.statsHost||m.stats_host,unavailableTimeout:e.unavailableTimeout||m.unavailableTimeout,wsPath:e.wsPath||m.wsPath,wsPort:e.wsPort||m.wsPort,wssPort:e.wssPort||m.wssPort,enableStats:Er(e),httpHost:Or(e),useTLS:Lr(e),wsHost:Ar(e),userAuthenticator:Rr(e),channelAuthorizer:Ir(e,t)};return"disabledTransports"in e&&(n.disabledTransports=e.disabledTransports),"enabledTransports"in e&&(n.enabledTransports=e.enabledTransports),"ignoreNullOrigin"in e&&(n.ignoreNullOrigin=e.ignoreNullOrigin),"timelineParams"in e&&(n.timelineParams=e.timelineParams),"nacl"in e&&(n.nacl=e.nacl),n}(n,this),this.channels=X.createChannels(),this.global_emitter=new F,this.sessionID=d.randomInt(1e9),this.timeline=new dr(this.key,this.sessionID,{cluster:this.config.cluster,features:e.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:st.INFO,version:m.VERSION}),this.config.enableStats&&(this.timelineSender=X.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+d.TimelineTransport.name})),this.connection=X.createConnectionManager(this.key,{getStrategy:function(s){return d.getDefaultStrategy(r.config,s,_r)},timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",function(){r.subscribeAll(),r.timelineSender&&r.timelineSender.send(r.connection.isUsingTLS())}),this.connection.bind("message",function(s){var l=0===s.event.indexOf("pusher_internal:");if(s.channel){var h=r.channel(s.channel);h&&h.handleEvent(s)}l||r.global_emitter.emit(s.event,s.data)}),this.connection.bind("connecting",function(){r.channels.disconnect()}),this.connection.bind("disconnected",function(){r.channels.disconnect()}),this.connection.bind("error",function(s){x.warn(s)}),e.instances.push(this),this.timeline.info({instances:e.instances.length}),this.user=new Br(this),e.isReady&&this.connect()}return e.ready=function(){e.isReady=!0;for(var t=0,n=e.instances.length;t<n;t++)e.instances[t].connect()},e.getClientFeatures=function(){return St(kt({ws:d.Transports.ws},function(t){return t.isSupported({})}))},e.prototype.channel=function(t){return this.channels.find(t)},e.prototype.allChannels=function(){return this.channels.all()},e.prototype.connect=function(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var t=this.connection.isUsingTLS(),n=this.timelineSender;this.timelineSenderTimer=new ue(6e4,function(){n.send(t)})}},e.prototype.disconnect=function(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)},e.prototype.bind=function(t,n,r){return this.global_emitter.bind(t,n,r),this},e.prototype.unbind=function(t,n,r){return this.global_emitter.unbind(t,n,r),this},e.prototype.bind_global=function(t){return this.global_emitter.bind_global(t),this},e.prototype.unbind_global=function(t){return this.global_emitter.unbind_global(t),this},e.prototype.unbind_all=function(t){return this.global_emitter.unbind_all(),this},e.prototype.subscribeAll=function(){var t;for(t in this.channels.channels)this.channels.channels.hasOwnProperty(t)&&this.subscribe(t)},e.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},e.prototype.unsubscribe=function(t){var n=this.channels.find(t);n&&n.subscriptionPending?n.cancelSubscription():(n=this.channels.remove(t))&&n.subscribed&&n.unsubscribe()},e.prototype.send_event=function(t,n,r){return this.connection.send_event(t,n,r)},e.prototype.shouldUseTLS=function(){return this.config.useTLS},e.prototype.signin=function(){this.user.signin()},e.instances=[],e.isReady=!1,e.logToConsole=!1,e.Runtime=d,e.ScriptReceivers=d.ScriptReceivers,e.DependenciesReceivers=d.DependenciesReceivers,e.auth_callbacks=d.auth_callbacks,e}(),vt=w.default=Bt;d.setup(Bt)}])},88909:(_t,D,w)=>{"use strict";w.d(D,{r:()=>q});var C=w(78275),g=w.n(C),f=w(2978),A=w(26409),m=w(3366);let q=(()=>{class S{constructor(_,y){this.http=_,this.api=y,this.pusher=new(g())("12a176ecc75eb053049a",{cluster:"us2",authEndpoint:this.api.getUrl()+"/api/pusher/auth"})}disconnectChat(){this.pusher.unsubscribe("chat-channel")}connectChat(){this.chatChannel=this.pusher.subscribe("chat-channel")}getChatChannel(){return this.chatChannel}connectOrderState(){this.OrderChannel=this.pusher.subscribe("order-channel-state")}disconnectOrderState(){this.pusher.unsubscribe("order-channel-state")}getOrderChannel(){return this.OrderChannel}static#t=this.\u0275fac=function(y){return new(y||S)(f.KVO(A.Qq),f.KVO(m.G))};static#e=this.\u0275prov=f.jDH({token:S,factory:S.\u0275fac,providedIn:"root"})}return S})()}}]);