PageSourceSearch

https://app.myinvoice.gr/scripts-X4X52YAF.js

js myinvoice.gr collected 2026-10-02 01:54:42 UTC 73,988 bytes, 8 lines download raw bytes

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

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.