vendor: 4,254 bytes, lines 1-2
1/*! For license information please see echo_v1.0.0.js.LICENSE.txt */ 2!function(){var e={669:function(e,t,n){var i,r,o,s;function c(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var c=i&&i.prototype instanceof u?i:u,h=Object.create(c.prototype);return a(h,"_invoke",function(n,i,r){var o,c,a,u=0,h=r||[],l=!1,f={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return o=t,c=0,a=e,f.n=n,s}};function d(n,i){for(c=n,a=i,t=0;!l&&u&&!r&&t<h.length;t++){var r,o=h[t],d=f.p,p=o[2];n>3?(r=p===i)&&(a=o[(c=o[4])?5:(c=3,3)],o[4]=o[5]=e):o[0]<=d&&((r=n<2&&d<o[1])?(c=0,f.v=i,f.n=o[1]):d<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,f.n=p,c=0))}if(r||n>1)return s;throw l=!0,i}return function(r,h,p){if(u>1)throw TypeError("Generator is already running");for(l&&1===h&&d(h,p),c=h,a=p;(t=c<2?e:a)||!l;){o||(c?c<3?(c>1&&(f.n=-1),d(c,a)):f.n=a:f.v=a);try{if(u=2,o){if(c||(r="next"),t=o[r]){if(!(t=t.call(o,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,c<2&&(c=0)}else 1===c&&(t=o.return)&&t.call(o),c<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),c=1);o=e}else if((t=(l=f.n<0)?a:n.call(i,f))!==s)break}catch(t){o=e,c=1,a=t}finally{u=1}}return{value:t,done:l}}}(n,r,o),!0),h}var s={};function u(){}function h(){}function l(){}t=Object.getPrototypeOf;var f=[][i]?t(t([][i]())):(a(t={},i,function(){return this}),t),d=l.prototype=u.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,a(e,r,"GeneratorFunction")),e.prototype=Object.create(d),e}return h.prototype=l,a(d,"constructor",l),a(l,"constructor",h),h.displayName="GeneratorFunction",a(l,r,"GeneratorFunction"),a(d),a(d,r,"Generator"),a(d,i,function(){return this}),a(d,"toString",function(){return"[object Generator]"}),(c=function(){return{w:o,m:p}})()}function a(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}a=function(e,t,n,i){function o(t,n){a(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},a(e,t,n,i)}function u(e,t,n,i){var r=h(y(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=y(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},h.apply(null,arguments)}function l(e,t,n){return t=y(t),function(e,t){if(t&&("object"==w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,p()?Reflect.construct(t,n||[],y(e).constructor):t.apply(e,n))}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}function d(e){var t="function"==typeof Map?new Map:void 0;return d=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(p())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var r=new(e.bind.apply(e,i));return n&&v(r,n.prototype),r}(e,arguments,y(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,e)},d(e)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}
2function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,k(i.key),i)}}function m(e,t,n){return t&&g(e.prototype,t),n&&g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function k(e){var t=function(e){if("object"!=w(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==w(t)?t:t+""}function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}e=n.nmd(e),self,s=function(){return function(){var e={594:function(e,t){"use strict";
vendor: 4,097 bytes, line 2
2var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},n(e,t)},function(e,t){function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var r=256,o=function(){function e(e){void 0===e&&(e="="),this._paddingCharacter=e}return e.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(8*e+5)/6|0},e.prototype.encode=function(e){for(var t="",n=0;n<e.length-2;n+=3){var i=e[n]<<16|e[n+1]<<8|e[n+2];t+=this._encodeByte(i>>>18&63),t+=this._encodeByte(i>>>12&63),t+=this._encodeByte(i>>>6&63),t+=this._encodeByte(i>>>0&63)}var r=e.length-n;return r>0&&(i=e[n]<<16|(2===r?e[n+1]<<8:0),t+=this._encodeByte(i>>>18&63),t+=this._encodeByte(i>>>12&63),t+=2===r?this._encodeByte(i>>>6&63):this._paddingCharacter||"",t+=this._paddingCharacter||""),t},e.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(6*e+7)/8|0},e.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},e.prototype.decode=function(e){if(0===e.length)return new Uint8Array(0);for(var t=this._getPaddingLength(e),n=e.length-t,i=new Uint8Array(this.maxDecodedLength(n)),o=0,s=0,c=0,a=0,u=0,h=0,l=0;s<n-4;s+=4)a=this._decodeChar(e.charCodeAt(s+0)),u=this._decodeChar(e.charCodeAt(s+1)),h=this._decodeChar(e.charCodeAt(s+2)),l=this._decodeChar(e.charCodeAt(s+3)),i[o++]=a<<2|u>>>4,i[o++]=u<<4|h>>>2,i[o++]=h<<6|l,c|=a&r,c|=u&r,c|=h&r,c|=l&r;if(s<n-1&&(a=this._decodeChar(e.charCodeAt(s)),u=this._decodeChar(e.charCodeAt(s+1)),i[o++]=a<<2|u>>>4,c|=a&r,c|=u&r),s<n-2&&(h=this._decodeChar(e.charCodeAt(s+2)),i[o++]=u<<4|h>>>2,c|=h&r),s<n-3&&(l=this._decodeChar(e.charCodeAt(s+3)),i[o++]=h<<6|l,c|=l&r),0!==c)throw new Error("Base64Coder: incorrect characters for decoding");return i},e.prototype._encodeByte=function(e){var t=e;return t+=65,t+=25-e>>>8&6,t+=51-e>>>8&-75,t+=61-e>>>8&-15,t+=62-e>>>8&3,String.fromCharCode(t)},e.prototype._decodeChar=function(e){var t=r;return t+=(42-e&e-44)>>>8&-256+e-43+62,t+=(46-e&e-48)>>>8&-256+e-47+63,t+=(47-e&e-58)>>>8&-256+e-48+52,(t+=(64-e&e-91)>>>8&-256+e-65+0)+((96-e&e-123)>>>8&-256+e-97+26)},e.prototype._getPaddingLength=function(e){var t=0;if(this._paddingCharacter){for(var n=e.length-1;n>=0&&e[n]===this._paddingCharacter;n--)t++;if(e.length<4||t>2)throw new Error("Base64Coder: incorrect padding")}return t},e}();t.Coder=o;var s=new o;t.encode=function(e){return s.encode(e)},t.decode=function(e){return s.decode(e)};var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype._encodeByte=function(e){var t=e;return t+=65,t+=25-e>>>8&6,t+=51-e>>>8&-75,t+=61-e>>>8&-13,t+=62-e>>>8&49,String.fromCharCode(t)},t.prototype._decodeChar=function(e){var t=r;return t+=(44-e&e-46)>>>8&-256+e-45+62,t+=(94-e&e-96)>>>8&-256+e-95+63,t+=(47-e&e-58)>>>8&-256+e-48+52,(t+=(64-e&e-91)>>>8&-256+e-65+0)+((96-e&e-123)>>>8&-256+e-97+26)},t}(o);t.URLSafeCoder=c;var a=new c;t.encodeURLSafe=function(e){return a.encode(e)},t.decodeURLSafe=function(e){return a.decode(e)},t.encodedLength=function(e){return s.encodedLength(e)},t.maxDecodedLength=function(e){return s.maxDecodedLength(e)},t.decodedLength=function(e){return s.decodedLength(e)}},978:function(e,t){"use strict";var n="utf8: invalid source encoding";t.D4=function(e){for(var t=[],i=0;i<e.length;i++){var r=e[i];if(128&r){var o=void 0;if(r<224){if(i>=e.length)throw new Error(n);if(128!=(192&(s=e[++i])))throw new Error(n);r=(31&r)<<6|63&s,o=128}else if(r<240){if(i>=e.length-1)throw new Error(n);var s=e[++i],c=e[++i];if(128!=(192&s)||128!=(192&c))throw new Error(n);r=(15&r)<<12|(63&s)<<6|63&c,o=2048}else{if(!(r<248))throw new Error(n);if(i>=e.length-2)throw new Error(n);s=e[++i],c=e[++i];var a=e[++i];if(128!=(192&s)||128!=(192&c)||128!=(192&a))throw new Error(n);r=(15&r)<<18|(63&s)<<12|(63&c)<<6|63&a,o=65536}if(r<o||r>=55296&&r<=57343)throw new Error(n);if(r>
2=65536){if(r>1114111)throw new Error(n);r-=65536,t.push(String.fromCharCode(55296|r>>10)),r=56320|1023&r}}t.push(String.fromCharCode(r))}return t.join("")}},721:function(e,t,n){e.exports=n(207).default},207:function(e,t,n){"use strict";n.d(t,{default:function(){return on}});var i,r=function(){return m(function e(t,n){b(this,e),this.lastId=0,this.prefix=t,this.name=n},[{key:"create",value:function(e){this.lastId++;var t=this.lastId,n=this.prefix+t,i=this.name+"["+t+"]",r=!1,o=function(){r||(e.apply(null,arguments),r=!0)};return this[t]=o,{number:t,id:n,name:i,callback:o}}},{key:"remove",value:function(e){delete this[e.number]}}])}(),o=new r("_pusher_script_","Pusher.ScriptReceivers"),s="8.5.0",a=7,h=80,p=443,v="",y="sockjs.pusher.com",g=80,k=443,S="/pusher",C="stats.pusher.com",_="/pusher/auth",T="ajax",O=12e4,P=3e4,E=1e4,j={endpoint:"/pusher/user-auth",transport:"ajax"},R={endpoint:"/pusher/auth",transport:"ajax"},L="http://js.pusher.com",x="https://js.pusher.com",A="",I=function(){return m(function e(t){b(this,e),this.options=t,this.receivers=t.receivers||o,this.loading={}},[{key:"load",value:function(e,t,n){var i=this;if(i.loading[e]&&i.loading[e].length>0)i.loading[e].push(n);else{i.loading[e]=[n];var r=Ut.createScriptRequest(i.getPath(e,t)),o=i.receivers.create(function(t){if(i.receivers.remove(o),i.loading[e]){var n=i.loading[e];delete i.loading[e];for(var s=function(e){e||r.cleanup()},c=0;c<n.length;c++)n[c](t,s)}});r.send(o)}}},{key:"getRoot",value:function(e){var t=Ut.getDocument().location.protocol;return(e&&e.useTLS||"https:"===t?this.options.cdn_https:this.options.cdn_http).replace(/\/*$/,"")+"/"+this.options.version}},{key:"getPath",value:function(e,t){return this.getRoot(t)+"/"+e+this.options.suffix+".js"}}])}(),D=new r("_pusher_dependencies","Pusher.DependenciesReceivers"),N=new I({cdn_http:L,cdn_https:x,version:s,suffix:A,receivers:D}),H={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},U=function(e){var t,n=H.urls[e];return n?(n.fullUrl?t=n.fullUrl:n.path&&(t=H.baseUrl+n.path),t?"".concat("See:"," ").concat(t):""):""};!function(e){e.UserAuthentication="user-authentication",e.ChannelAuthorization="channel-authorization"}(i||(i={}));for(var q=function(e){function t(e){var n;return b(this,t),n=l(this,t,[e]),Object.setPrototypeOf(n,(this instanceof t?this.constructor:void 0).prototype),n}return f(t,e),m(t)}(d(Error)),M=function(e){function t(e){var n;return b(this,t),n=l(this,t,[e]),Object.setPrototypeOf(n,(this instanceof t?this.constructor:void 0).prototype),n}return f(t,e),m(t)}(d(Error)),z=function(e){function t(e){var n;return b(this,t),n=l(this,t,[e]),Object.setPrototypeOf(n,(this instanceof t?this.constructor:void 0).prototype),n}return f(t,e),m(t)}(d(Error)),B=function(e){function t(e){var n;return b(this,t),n=l(this,t,[e]),Object.setPrototypeOf(n,(this instanceof t?this.constructor:void 0).prototype),n}return f(t,e),m(t)}(d(Error)),F=function(e){function t(e){var n;return b(this,t),n=l(this,t,[e]),Object.setPrototypeOf(n,(this instanceof t?this.constructor:void 0).prototype),n}return f(t,e),m(t)}(d(Error)),X=function(e){function t(e){var n;return b(this,t),n=l(this,t,[e]),Object.setPrototypeOf(n,(this instanceof t?this.constructor:void 0).prototype),n}return f(t,e),m(t)}(d(Error)),J=function(e){function t(e){var n;return b(this,t),n=l(this,t,[e]),Object.setPrototypeOf(n,(this instanceof t?this.constructor:void 0).prototype),n}return f(t,e),m(t)}(d(Error)),W=function(e){function t(e){var n;return b(this,t),n=l(this,t,[e]),Object.setPrototypeOf(n,(this instanceof t?this.constructor:void 0).prototype),n}return f(t,e),m(t)}(d(Error)),G=function(e){function t(e,n){var i;return b(this,t),(i=l(this,t,[n])).status=e,Object.setPrototypeOf(i,(this instanceof t?this.constructor:void 0).prototype),i}return f(t,e),m(t)}
2(d(Error)),V=function(e,t,n,r,o){var s=Ut.createXHR();for(var c in s.open("POST",n.endpoint,!0),s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.headers)s.setRequestHeader(c,n.headers[c]);if(null!=n.headersProvider){var a=n.headersProvider();for(var c in a)s.setRequestHeader(c,a[c])}return s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status){var e,t=!1;try{e=JSON.parse(s.responseText),t=!0}catch(e){o(new G(200,"JSON returned from ".concat(r.toString()," endpoint was invalid, yet status code was 200. Data was: ").concat(s.responseText)),null)}t&&o(null,e)}else{var c="";switch(r){case i.UserAuthentication:c=U("authenticationEndpoint");break;case i.ChannelAuthorization:c="Clients must be authorized to join private or presence channels. ".concat(U("authorizationEndpoint"))}o(new G(s.status,"Unable to retrieve auth string from ".concat(r.toString()," endpoint - ")+"received status: ".concat(s.status," from ").concat(n.endpoint,". ").concat(c)),null)}},s.send(t),s},Q=String.fromCharCode,K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Y={},$=0;$<64;$++)Y[K.charAt($)]=$;var Z=function(e){var t=e.charCodeAt(0);return t<128?e:t<2048?Q(192|t>>>6)+Q(128|63&t):Q(224|t>>>12&15)+Q(128|t>>>6&63)+Q(128|63&t)},ee=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("")},te=window.btoa||function(e){return e.replace(/[\s\S]{1,3}/g,ee)},ne=function(){return m(function e(t,n,i,r){var o=this;b(this,e),this.clear=n,this.timer=t(function(){o.timer&&(o.timer=r(o.timer))},i)},[{key:"isRunning",value:function(){return null!==this.timer}},{key:"ensureAborted",value:function(){this.timer&&(this.clear(this.timer),this.timer=null)}}])}();function ie(e){window.clearTimeout(e)}function re(e){window.clearInterval(e)}var oe=function(e){function t(e,n){return b(this,t),l(this,t,[setTimeout,ie,e,function(e){return n(),null}])}return f(t,e),m(t)}(ne),se=function(e){function t(e,n){return b(this,t),l(this,t,[setInterval,re,e,function(e){return n(),e}])}return f(t,e),m(t)}(ne),ce={now:function(){return Date.now?Date.now():(new Date).valueOf()},defer:function(e){return new oe(0,e)},method:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r=Array.prototype.slice.call(arguments,1);return function(t){return t[e].apply(t,r.concat(arguments))}}},ae=ce;function ue(e){for(var t=0;t<(arguments.length<=1?0:arguments.length-1);t++){var n=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];for(var i in n)n[i]&&n[i].constructor&&n[i].constructor===Object?e[i]=ue(e[i]||{},n[i]):e[i]=n[i]}return e}function he(){for(var e=["Pusher"],t=0;t<arguments.length;t++)"string"==typeof arguments[t]?e.push(arguments[t]):e.push(ke(arguments[t]));return e.join(" : ")}function le(e,t){var n=Array.prototype.indexOf;if(null===e)return-1;if(n&&e.indexOf===n)return e.indexOf(t);for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1}function fe(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(e[n],n,e)}function de(e){var t=[];return fe(e,function(e,n){t.push(n)}),t}function pe(e,t,n){for(var i=0;i<e.length;i++)t.call(n||window,e[i],i,e)}function ve(e,t){for(var n=[],i=0;i<e.length;i++)n.push(t(e[i],i,e,n));return n}function ye(e,t){t=t||function(e){return!!e};for(var n=[],i=0;i<e.length;i++)t(e[i],i,e,n)&&n.push(e[i]);return n}function be(e,t){var n={};return fe(e,function(i,r){(t&&t(i,r,e,n)||Boolean(i))&&(n[r]=i)}),n}function ge(e,t){for(var n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1}function me(e){return t=function(e){return"object"===w(e)&&(e=ke(e)),encodeURIComponent((t=e.toString(),te(t.replace(/[^\x00-\x7F]/g,Z))));var t},n={},fe(e,function(e,i){n[i]=t(e)}),n;var t,n}function ke(e){try{return JSON.stringify(e)}catch(i){return JSON.stringify((t=[],n=[],function e(i,r){var o,s,c;switch(w(i)){case"object":if(!i)return null;for(o=0;o<t.length;o+=1)if(t[o]===i)return{$ref:n[o]};if(t.push(i),n.push(r),"[object Array]"===Object.prototype.toString.apply(i))for(c=[],o=0;o<i.length;o+=1)c[o]=e(i[o],r+"["+o+"]");else for(s in c={},i)Object.prototype.hasOwnProperty.call(i,s)&&(c[s]=e(i[s],r+"["+JSON.stringify(s)+"]"));return c;case"number":case"string":case"boolean":return i}}(e,"$")))}var t,n}var we=function(){return m(function e(){b(this,e),this.globalLog=function(e){window.console&&window.console.log&&window.console.log(e)}},[{key:"debug",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.log(this.globalLog,t)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.log(this.globalLogWarn,t)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.log(this.globalLogError,t)}},{key:"globalLogWarn",value:function(e){window.console&&window.console.warn?window.console.warn(e):this.globalLog(e)}},{key:"globalLogError",value:function(e){window.console&&window.console.error?window.console.error(e):this.globalLogWarn(e)}},{key:"log",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r=he.apply(this,arguments);on.log?on.log(r):on.logToConsole&&e.bind(this)(r)}}])}(),Se=new we,Ce=function(e,t,n,i,r){void 0===n.headers&&null==n.headersProvider||Se.warn("To send headers with the ".concat(i.toString()," request, you must use AJAX, rather than JSONP."));var o=e.nextAuthCallbackID.toString();e.nextAuthCallbackID++;var s=e.getDocument(),c=s.createElement("script");e.auth_callbacks[o]=function(e){r(null,e)};var a="Pusher.auth_callbacks['"+o+"']";c.src=n.endpoint+"?callback="+encodeURIComponent(a)+"&"+t;var u=s.getElementsByTagName("head")[0]||s.documentElement;u.insertBefore(c,u.firstChild)},_e=function(){return m(function e(t){b(this,e),this.src=t},[{key:"send",value:function(e){var t=this,n="Error loading "+t.src;t.script=document.createElement("script"),t.script.id=e.id,t.script.src=t.src,t.script.type="text/javascript",t.script.charset="UTF-8",t.script.addEventListener?(t.script.onerror=function(){e.callback(n)},t.script.onload=function(){e.callback(null)}):t.script.onreadystatechange=function(){"loaded"!==t.script.readyState&&"complete"!==t.script.readyState||e.callback(null)},void 0===t.script.async&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(t.errorScript=document.createElement("script"),t.errorScript.id=e.id+"_error",t.errorScript.text=e.name+"('"+n+"');",t.script.async=t.errorScript.async=!1):t.script.async=!0;var i=document.getElementsByTagName("head")[0];i.insertBefore(t.script,i.firstChild),t.errorScript&&i.insertBefore(t.errorScript,t.script.nextSibling)}},{key:"cleanup",value: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}}])}(),Te=function(){return m(function e(t,n){b(this,e),this.url=t,this.data=n},[{key:"send",value:function(e){if(!this.request){var t=(i=this.data,ve((r=me(be(i,function(e){return void 0!==e})),o=[],fe(r,function(e,t){o.push([t,e])}),o),ae.method("join","=")).join("&")),n=this.url+"/"+e.number+"?"+t;this.request=Ut.createScriptRequest(n),this.request.send(e)}var i,r,o}},{key:"cleanup",value:function(){this.request&&this.request.cleanup()}}])}(),Oe={name:"jsonp",getAgent:function(e,t){return function(n,i){var r="http"+(t?"s":"")+"://"+(e.host||e.options.host)+e.options.path,s=Ut.createJSONPRequest(r,
2n),c=Ut.ScriptReceivers.create(function(t,n){o.remove(c),s.cleanup(),n&&n.host&&(e.host=n.host),i&&i(t,n)});s.send(c)}}};function Pe(e,t,n){return e+(t.useTLS?"s":"")+"://"+(t.useTLS?t.hostTLS:t.hostNonTLS)+n}function Ee(e,t){return"/app/"+e+"?protocol="+a+"&client=js&version="+s+(t?"&"+t:"")}var je={getInitial:function(e,t){return Pe("ws",t,(t.httpPath||"")+Ee(e,"flash=false"))}},Re={getInitial:function(e,t){return Pe("http",t,(t.httpPath||"/pusher")+Ee(e))}},Le={getInitial:function(e,t){return Pe("http",t,t.httpPath||"/pusher")},getPath:function(e,t){return Ee(e)}},xe=function(){return m(function e(){b(this,e),this._callbacks={}},[{key:"get",value:function(e){return this._callbacks[Ae(e)]}},{key:"add",value:function(e,t,n){var i=Ae(e);this._callbacks[i]=this._callbacks[i]||[],this._callbacks[i].push({fn:t,context:n})}},{key:"remove",value:function(e,t,n){if(e||t||n){var i=e?[Ae(e)]:de(this._callbacks);t||n?this.removeCallback(i,t,n):this.removeAllCallbacks(i)}else this._callbacks={}}},{key:"removeCallback",value:function(e,t,n){pe(e,function(e){this._callbacks[e]=ye(this._callbacks[e]||[],function(e){return t&&t!==e.fn||n&&n!==e.context}),0===this._callbacks[e].length&&delete this._callbacks[e]},this)}},{key:"removeAllCallbacks",value:function(e){pe(e,function(e){delete this._callbacks[e]},this)}}])}();function Ae(e){return"_"+e}var Ie=function(){return m(function e(t){b(this,e),this.callbacks=new xe,this.global_callbacks=[],this.failThrough=t},[{key:"bind",value:function(e,t,n){return this.callbacks.add(e,t,n),this}},{key:"bind_global",value:function(e){return this.global_callbacks.push(e),this}},{key:"unbind",value:function(e,t,n){return this.callbacks.remove(e,t,n),this}},{key:"unbind_global",value:function(e){return e?(this.global_callbacks=ye(this.global_callbacks||[],function(t){return t!==e}),this):(this.global_callbacks=[],this)}},{key:"unbind_all",value:function(){return this.unbind(),this.unbind_global(),this}},{key:"emit",value:function(e,t,n){for(var i=0;i<this.global_callbacks.length;i++)this.global_callbacks[i](e,t);var r=this.callbacks.get(e),o=[];if(n?o.push(t,n):t&&o.push(t),r&&r.length>0)for(i=0;i<r.length;i++)r[i].fn.apply(r[i].context||window,o);else this.failThrough&&this.failThrough(e,t);return this}}])}(),De=function(e){function t(e,n,i,r,o){var s;return b(this,t),(s=l(this,t)).initialize=Ut.transportConnectionInitializer,s.hooks=e,s.name=n,s.priority=i,s.key=r,s.options=o,s.state="new",s.timeline=o.timeline,s.activityTimeout=o.activityTimeout,s.id=s.timeline.generateUniqueID(),s}return f(t,e),m(t,[{key:"handlesActivityChecks",value:function(){return Boolean(this.hooks.handlesActivityChecks)}},{key:"supportsPing",value:function(){return Boolean(this.hooks.supportsPing)}},{key:"connect",value:function(){var e=this;if(this.socket||"initialized"!==this.state)return!1;var t=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(t,this.options)}catch(t){return ae.defer(function(){e.onError(t),e.changeState("closed")}),!1}return this.bindListeners(),Se.debug("Connecting",{transport:this.name,url:t}),this.changeState("connecting"),!0}},{key:"close",value:function(){return!!this.socket&&(this.socket.close(),!0)}},{key:"send",value:function(e){var t=this;return"open"===this.state&&(ae.defer(function(){t.socket&&t.socket.send(e)}),!0)}},{key:"ping",value:function(){"open"===this.state&&this.supportsPing()&&this.socket.ping()}},{key:"onOpen",value: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}},{key:"onError",value:function(e){this.emit("error",{type:"WebSocketError",error:e}),this.timeline.error(this.buildTimelineMessage({error:e.toString()}))}},{key:"onClose",value:function(e){e?this.changeState("closed",{code:e.code,reason:e.reason,wasClean:e.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}},{key:"onMessage",value:function(e){this.emit("message",e)}},{key:"onActivity",value:function(){this.emit("activity")}},{key:"bindListeners",value:function(){var e=this;this.socket.onopen=function(){e.onOpen()},this.socket.onerror=function(t){e.onError(t)},this.socket.onclose=function(t){e.onClose(t)},this.socket.onmessage=function(t){e.onMessage(t)},this.supportsPing()&&(this.socket.onactivity=function(){e.onActivity()})}},{key:"unbindListeners",value: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))}},{key:"changeState",value:function(e,t){this.state=e,this.timeline.info(this.buildTimelineMessage({state:e,params:t}
2)),this.emit(e,t)}},{key:"buildTimelineMessage",value:function(e){return ue({cid:this.id},e)}}])}(Ie),Ne=function(){return m(function e(t){b(this,e),this.hooks=t},[{key:"isSupported",value:function(e){return this.hooks.isSupported(e)}},{key:"createConnection",value:function(e,t,n,i){return new De(this.hooks,e,t,n,i)}}])}(),He=new Ne({urls:je,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return Boolean(Ut.getWebSocketAPI())},isSupported:function(){return Boolean(Ut.getWebSocketAPI())},getSocket:function(e){return Ut.createWebSocket(e)}}),Ue={urls:Re,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},qe=ue({getSocket:function(e){return Ut.HTTPFactory.createStreamingSocket(e)}},Ue),Me=ue({getSocket:function(e){return Ut.HTTPFactory.createPollingSocket(e)}},Ue),ze={isSupported:function(){return Ut.isXHRSupported()}},Be={ws:He,xhr_streaming:new Ne(ue({},qe,ze)),xhr_polling:new Ne(ue({},Me,ze))},Fe=new Ne({file:"sockjs",urls:Le,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:N.getPath("sockjs",{useTLS:t.useTLS}),ignore_null_origin:t.ignoreNullOrigin})},beforeOpen:function(e,t){e.send(JSON.stringify({path:t}))}}),Xe={isSupported:function(e){return Ut.isXDRSupported(e.useTLS)}},Je=new Ne(ue({},qe,Xe)),We=new Ne(ue({},Me,Xe));Be.xdr_streaming=Je,Be.xdr_polling=We,Be.sockjs=Fe;var Ge=Be,Ve=new(function(e){function t(){var e;b(this,t);var n=e=l(this,t);return void 0!==window.addEventListener&&(window.addEventListener("online",function(){n.emit("online")},!1),window.addEventListener("offline",function(){n.emit("offline")},!1)),e}return f(t,e),m(t,[{key:"isOnline",value:function(){return void 0===window.navigator.onLine||window.navigator.onLine}}])}(Ie)),Qe=function(){return m(function e(t,n,i){b(this,e),this.manager=t,this.transport=n,this.minPingDelay=i.minPingDelay,this.maxPingDelay=i.maxPingDelay,this.pingDelay=void 0},[{key:"createConnection",value:function(e,t,n,i){var r=this;i=ue({},i,{activityTimeout:this.pingDelay});var o=this.transport.createConnection(e,t,n,i),s=null,c=function(){o.unbind("open",c),o.bind("closed",a),s=ae.now()},a=function(e){if(o.unbind("closed",a),1002===e.code||1003===e.code)r.manager.reportDeath();else if(!e.wasClean&&s){var t=ae.now()-s;t<2*r.maxPingDelay&&(r.manager.reportDeath(),r.pingDelay=Math.max(t/2,r.minPingDelay))}};return o.bind("open",c),o}},{key:"isSupported",value:function(e){return this.manager.isAlive()&&this.transport.isSupported(e)}}])}(),Ke={decodeMessage:function(e){try{var t=JSON.parse(e.data),n=t.data;if("string"==typeof n)try{n=JSON.parse(t.data)}catch(e){}var i={event:t.event,channel:t.channel,data:n};return t.user_id&&(i.user_id=t.user_id),i}catch(t){throw{type:"MessageParseError",error:t,data:e.data}}},encodeMessage:function(e){return JSON.stringify(e)},processHandshake:function(e){var t=Ke.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}},Ye=Ke,$e=function(e){function t(e,n){var i;return b(this,t),(i=l(this,t)).id=e,i.transport=n,i.activityTimeout=n.activityTimeout,i.bindListeners(),i}return f(t,e),m(t,[{key:"handlesActivityChecks",value:function(){return this.transport.handlesActivityChecks()}},{key:"send",value:function(e){return this.transport.send(e)}},{key:"send_event",value:function(e,t,n){var i={event:e,data:t};return n&&(i.channel=n),Se.debug("Event sent",i),this.send(Ye.encodeMessage(i))}},{key:"ping",value:function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}},{key:"close",value:function(){this.transport.close()}},{key:"bindListeners",value:function(){var e=this,t={message:function(t){var n;try{n=Ye.decodeMessage(t)}catch(n){e.emit("error",{type:"MessageParseError",error:n,data:t.data})}if(void 0!==n){switch(Se.debug("Event recd",n),n.event){case"pusher:error":e.emit("error",{type:"PusherError",data:n.data});break;case"pusher:ping":e.emit("ping");break;case"pusher:pong":e.emit("pong")}e.emit("message",n)}},activity:function(){e.emit("activity")},error:function(t){e.emit("error",t)},closed:function(t){n(),t&&t.code&&e.handleCloseEvent(t),e.transport=null,e.emit("closed")}},n=function(){fe(t,function(t,n){e.transport.unbind(n,t)})};fe(t,function(t,n){e.transport.bind(n,t)})}},{key:"handleCloseEvent",value:function(e){var t=Ye.getCloseAction(e),n=Ye.getCloseError(e);
2n&&this.emit("error",n),t&&this.emit(t,{action:t,error:n})}}])}(Ie),Ze=function(){return m(function e(t,n){b(this,e),this.transport=t,this.callback=n,this.bindListeners()},[{key:"close",value:function(){this.unbindListeners(),this.transport.close()}},{key:"bindListeners",value:function(){var e=this;this.onMessage=function(t){var n;e.unbindListeners();try{n=Ye.processHandshake(t)}catch(t){return e.finish("error",{error:t}),void e.transport.close()}"connected"===n.action?e.finish("connected",{connection:new $e(n.id,e.transport),activityTimeout:n.activityTimeout}):(e.finish(n.action,{error:n.error}),e.transport.close())},this.onClosed=function(t){e.unbindListeners();var n=Ye.getCloseAction(t)||"backoff",i=Ye.getCloseError(t);e.finish(n,{error:i})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}},{key:"unbindListeners",value:function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}},{key:"finish",value:function(e,t){this.callback(ue({transport:this.transport,action:e},t))}}])}(),et=function(){return m(function e(t,n){b(this,e),this.timeline=t,this.options=n||{}},[{key:"send",value:function(e,t){this.timeline.isEmpty()||this.timeline.send(Ut.TimelineTransport.getAgent(this,e),t)}}])}(),tt=function(e){function t(e,n){var i;return b(this,t),(i=l(this,t,[function(t,n){Se.debug("No callbacks on "+e+" for "+t)}])).name=e,i.pusher=n,i.subscribed=!1,i.subscriptionPending=!1,i.subscriptionCancelled=!1,i}return f(t,e),m(t,[{key:"authorize",value:function(e,t){return t(null,{auth:""})}},{key:"trigger",value:function(e,t){if(0!==e.indexOf("client-"))throw new q("Event '"+e+"' does not start with 'client-'");if(!this.subscribed){var n=U("triggeringClientEvents");Se.warn("Client event triggered before channel 'subscription_succeeded' event . ".concat(n))}return this.pusher.send_event(e,t,this.name)}},{key:"disconnect",value:function(){this.subscribed=!1,this.subscriptionPending=!1}},{key:"handleEvent",value:function(e){var t=e.event,n=e.data;"pusher_internal:subscription_succeeded"===t?this.handleSubscriptionSucceededEvent(e):"pusher_internal:subscription_count"===t?this.handleSubscriptionCountEvent(e):0!==t.indexOf("pusher_internal:")&&this.emit(t,n,{})}},{key:"handleSubscriptionSucceededEvent",value:function(e){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",e.data)}},{key:"handleSubscriptionCountEvent",value:function(e){e.data.subscription_count&&(this.subscriptionCount=e.data.subscription_count),this.emit("pusher:subscription_count",e.data)}},{key:"subscribe",value:function(){var e=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,function(t,n){t?(e.subscriptionPending=!1,Se.error(t.toString()),e.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:t.message},t instanceof G?{status:t.status}:{}))):e.pusher.send_event("pusher:subscribe",{auth:n.auth,channel_data:n.channel_data,channel:e.name})}))}},{key:"unsubscribe",value:function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}},{key:"cancelSubscription",value:function(){this.subscriptionCancelled=!0}},{key:"reinstateSubscription",value:function(){this.subscriptionCancelled=!1}}])}(Ie),nt=function(e){function t(){return b(this,t),l(this,t,arguments)}return f(t,e),m(t,[{key:"authorize",value:function(e,t){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:e},t)}}])}(tt),it=function(){return m(function e(){b(this,e),this.reset()},[{key:"get",value:function(e){return Object.prototype.hasOwnProperty.call(this.members,e)?{id:e,info:this.members[e]}:null}},{key:"each",value:function(e){var t=this;fe(this.members,function(n,i){e(t.get(i))})}},{key:"setMyID",value:function(e){this.myID=e}},{key:"onSubscription",value:function(e){this.members=e.presence.hash,this.count=e.presence.count,this.me=this.get(this.myID)}},{key:"addMember",value:function(e){return null===this.get(e.user_id)&&this.count++,this.members[e.user_id]=e.user_info,this.get(e.user_id)}},{key:"removeMember",value:function(e){var t=this.get(e.user_id);return t&&(delete this.members[e.user_id],this.count--),t}},{key:"reset",value:function(){this.members={},this.count=0,this.myID=null,this.me=null}}])}(),rt=function(e){function t(e,n){var i;return b(this,t),(i=l(this,t,[e,n])).members=new it,i}return f(t,e),m(t,[{key:"authorize",value:function(e,n){var i=this;u(t,"authorize",this,3)([e,function(e,t){return r=i,o=void 0,s=void 0,a=c().m(function i(){var r,o;return c().w(function(i){for(;;)switch(i.n){case 0:if(e){i.n=4;break}if(null==t.channel_data){i.n=1;break}r=JSON.parse(t.channel_data),this.members.setMyID(r.user_id),i.n=4;break;case 1:return i.n=2,this.pusher.user.signinDonePromise;case 2:if(null==this.pusher.user.user_data){i.n=3;break}this.members.setMyID(this.pusher.user.user_data.id),i.n=4;break;case 3:return o=U("authorizationEndpoint"),Se.error("Invalid auth response for channel '".concat(this.name,"', ")+"expected 'channel_data' field. ".concat(o,", ")+"or the user should be signed in."),n("Invalid auth response"),i.a(2);case 4:n(e,t);case 5:return i.a(2)}},i,this)}
2),new(s||(s=Promise))(function(e,t){function n(e){try{c(a.next(e))}catch(e){t(e)}}function i(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof s?r:new s(function(e){e(r)})).then(n,i)}c((a=a.apply(r,o||[])).next())});var r,o,s,a}])}},{key:"handleEvent",value:function(e){var t=e.event;if(0===t.indexOf("pusher_internal:"))this.handleInternalEvent(e);else{var n=e.data,i={};e.user_id&&(i.user_id=e.user_id),this.emit(t,n,i)}}},{key:"handleInternalEvent",value:function(e){var t=e.event,n=e.data;switch(t){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(n);this.emit("pusher:member_added",i);break;case"pusher_internal:member_removed":var r=this.members.removeMember(n);r&&this.emit("pusher:member_removed",r)}}},{key:"handleSubscriptionSucceededEvent",value: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))}},{key:"disconnect",value:function(){this.members.reset(),u(t,"disconnect",this,3)([])}}])}(nt),ot=n(978),st=n(594),ct=function(e){function t(e,n,i){var r;return b(this,t),(r=l(this,t,[e,n])).key=null,r.nacl=i,r}return f(t,e),m(t,[{key:"authorize",value:function(e,n){var i=this;u(t,"authorize",this,3)([e,function(e,t){if(e)n(e,t);else{var r=t.shared_secret;r?(i.key=(0,st.decode)(r),delete t.shared_secret,n(null,t)):n(new Error("No shared_secret key in auth payload for encrypted channel: ".concat(i.name)),null)}}])}},{key:"trigger",value:function(e,t){throw new X("Client events are not currently supported for encrypted channels")}},{key:"handleEvent",value:function(e){var n=e.event,i=e.data;0!==n.indexOf("pusher_internal:")&&0!==n.indexOf("pusher:")?this.handleEncryptedEvent(n,i):u(t,"handleEvent",this,3)([e])}},{key:"handleEncryptedEvent",value:function(e,t){var n=this;if(this.key)if(t.ciphertext&&t.nonce){var i=(0,st.decode)(t.ciphertext);if(i.length<this.nacl.secretbox.overheadLength)Se.error("Expected encrypted event ciphertext length to be ".concat(this.nacl.secretbox.overheadLength,", got: ").concat(i.length));else{var r=(0,st.decode)(t.nonce);if(r.length<this.nacl.secretbox.nonceLength)Se.error("Expected encrypted event nonce length to be ".concat(this.nacl.secretbox.nonceLength,", got: ").concat(r.length));else{var o=this.nacl.secretbox.open(i,r,this.key);if(null===o)return Se.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(t,s){t?Se.error("Failed to make a request to the authEndpoint: ".concat(s,". Unable to fetch new key, so dropping encrypted event")):null!==(o=n.nacl.secretbox.open(i,r,n.key))?n.emit(e,n.getDataToEmit(o)):Se.error("Failed to decrypt event with new key. Dropping encrypted event")});this.emit(e,this.getDataToEmit(o))}}}else Se.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+t);else Se.debug("Received encrypted event before key has been retrieved from the authEndpoint")}},{key:"getDataToEmit",value:function(e){var t=(0,ot.D4)(e);try{return JSON.parse(t)}catch(e){return t}}}])}(nt),at=function(e){function t(e,n){var i;b(this,t),(i=l(this,t)).state="initialized",i.connection=null,i.key=e,i.options=n,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 r=Ut.getNetwork();return r.bind("online",function(){i.timeline.info({netinfo:"online"}),"connecting"!==i.state&&"unavailable"!==i.state||i.retryIn(0)}),r.bind("offline",function(){i.timeline.info({netinfo:"offline"}),i.connection&&i.sendActivityCheck()}),i.updateStrategy(),i}return f(t,e),m(t,[{key:"switchCluster",value:function(e){this.key=e,this.updateStrategy(),this.retryIn(0)}},{key:"connect",value:function(){this.connection||this.runner||(this.strategy.isSupported()?(this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()):this.updateState("failed"))}},{key:"send",value:function(e){return!!this.connection&&this.connection.send(e)}},{key:"send_event",value:function(e,t,n){return!!this.connection&&this.connection.send_event(e,t,n)}},{key:"disconnect",value:function(){this.disconnectInternally(),this.updateState("disconnected")}},{key:"isUsingTLS",value:function(){return this.usingTLS}},{key:"startConnecting",value:function(){var e=this,t=function(n,i){n?e.runner=e.strategy.connect(0,t):"error"===i.action?(e.emit("error",{type:"HandshakeError",error:i.error}
2),e.timeline.error({handshakeError:i.error})):(e.abortConnecting(),e.handshakeCallbacks[i.action](i))};this.runner=this.strategy.connect(0,t)}},{key:"abortConnecting",value:function(){this.runner&&(this.runner.abort(),this.runner=null)}},{key:"disconnectInternally",value:function(){this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection&&this.abandonConnection().close()}},{key:"updateStrategy",value:function(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}},{key:"retryIn",value:function(e){var t=this;this.timeline.info({action:"retry",delay:e}),e>0&&this.emit("connecting_in",Math.round(e/1e3)),this.retryTimer=new oe(e||0,function(){t.disconnectInternally(),t.connect()})}},{key:"clearRetryTimer",value:function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}},{key:"setUnavailableTimer",value:function(){var e=this;this.unavailableTimer=new oe(this.options.unavailableTimeout,function(){e.updateState("unavailable")})}},{key:"clearUnavailableTimer",value:function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}},{key:"sendActivityCheck",value:function(){var e=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new oe(this.options.pongTimeout,function(){e.timeline.error({pong_timed_out:e.options.pongTimeout}),e.retryIn(0)})}},{key:"resetActivityCheck",value:function(){var e=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new oe(this.activityTimeout,function(){e.sendActivityCheck()}))}},{key:"stopActivityCheck",value:function(){this.activityTimer&&this.activityTimer.ensureAborted()}},{key:"buildConnectionCallbacks",value:function(e){var t=this;return ue({},e,{message:function(e){t.resetActivityCheck(),t.emit("message",e)},ping:function(){t.send_event("pusher:pong",{})},activity:function(){t.resetActivityCheck()},error:function(e){t.emit("error",e)},closed:function(){t.abandonConnection(),t.shouldRetry()&&t.retryIn(1e3)}})}},{key:"buildHandshakeCallbacks",value:function(e){var t=this;return ue({},e,{connected:function(e){t.activityTimeout=Math.min(t.options.activityTimeout,e.activityTimeout,e.connection.activityTimeout||1/0),t.clearUnavailableTimer(),t.setConnection(e.connection),t.socket_id=t.connection.id,t.updateState("connected",{socket_id:t.socket_id})}})}},{key:"buildErrorCallbacks",value:function(){var e=this,t=function(t){return function(n){n.error&&e.emit("error",{type:"WebSocketError",error:n.error}),t(n)}};return{tls_only:t(function(){e.usingTLS=!0,e.updateStrategy(),e.retryIn(0)}),refused:t(function(){e.disconnect()}),backoff:t(function(){e.retryIn(1e3)}),retry:t(function(){e.retryIn(0)})}}},{key:"setConnection",value:function(e){for(var t in this.connection=e,this.connectionCallbacks)this.connection.bind(t,this.connectionCallbacks[t]);this.resetActivityCheck()}},{key:"abandonConnection",value:function(){if(this.connection){for(var e in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(e,this.connectionCallbacks[e]);var t=this.connection;return this.connection=null,t}}},{key:"updateState",value:function(e,t){var n=this.state;if(this.state=e,n!==e){var i=e;"connected"===i&&(i+=" with new socket ID "+t.socket_id),Se.debug("State changed",n+" -> "+i),this.timeline.info({state:e,params:t}),this.emit("state_change",{previous:n,current:e}),this.emit(e,t)}}},{key:"shouldRetry",value:function(){return"connecting"===this.state||"connected"===this.state}}])}(Ie),ut=function(){return m(function e(){b(this,e),this.channels={}},[{key:"add",value:function(e,t){return this.channels[e]||(this.channels[e]=function(e,t){if(0===e.indexOf("private-encrypted-")){if(t.config.nacl)return lt.createEncryptedChannel(e,t,t.config.nacl);var n=U("encryptedChannelSupport");throw new X("".concat("Tried to subscribe to a private-encrypted- channel but no nacl implementation available",". ").concat(n))}if(0===e.indexOf("private-"))return lt.createPrivateChannel(e,t);if(0===e.indexOf("presence-"))return lt.createPresenceChannel(e,t);if(0===e.indexOf("#"))throw new M('Cannot create a channel with name "'+e+'".');return lt.createChannel(e,t)}(e,t)),this.channels[e]}},{key:"all",value:function(){return e=this.channels,t=[],fe(e,function(e){t.push(e)}),t;var e,t}},{key:"find",value:function(e){return this.channels[e]}},{key:"remove",value:function(e){var t=this.channels[e];return delete this.channels[e],t}},{key:"disconnect",value:function(){fe(this.channels,function(e){e.disconnect()})}}])}(),ht={createChannels:function(){return new ut},createConnectionManager:function(e,t){return new at(e,t)},createChannel:function(e,t){return new tt(e,t)},createPrivateChannel:function(e,t){return new nt(e,t)},createPresenceChannel:function(e,t){return new rt(e,t)},createEncryptedChannel:function(e,t,n){return new ct(e,t,n)},createTimelineSender:function(e,t){return new et(e,t)},createHandshake:function(e,t){return new Ze(e,t)},createAssistantToTheTransportManager:function(e,t,n){return new Qe(e,t,n)}},lt=ht,ft=function(){return m(function e(t){b(this,e),this.options=t||{},this.livesLeft=this.options.lives||1/0},[{key:"getAssistant",value:function(e){return lt.createAssistantToTheTransportManager(this,e,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}},{key:"isAlive",value:function(){return this.livesLeft>0}},{key:"reportDeath",value:function(){this.livesLeft-=1}}])}(),dt=function(){return m(function e(t,n){b(this,e),this.strategies=t,this.loop=Boolean(n.loop),this.failFast=Boolean(n.failFast),this.timeout=n.timeout,this.timeoutLimit=n.timeoutLimit},[{key:"isSupported",value:function(){return ge(this.strategies,ae.method("isSupported"))}},{key:"connect",value:function(e,t){var n=this,i=this.strategies,r=0,o=this.timeout,s=null,c=function(a,u){u?t(null,u):(r+=1,n.loop&&(r%=i.length),r<i.length?(o&&(o*=2,n.timeoutLimit&&(o=Math.min(o,n.timeoutLimit))),s=n.tryStrategy(i[r],e,{timeout:o,failFast:n.failFast},c)):t(!0))};return s=this.tryStrategy(i[r],e,{timeout:o,failFast:this.failFast},c),{abort:function(){s.abort()},forceMinPriority:function(t){e=t,s&&s.forceMinPriority(t)}}}},{key:"tryStrategy",value:function(e,t,n,i){var r=null,o=null;return n.timeout>0&&(r=new oe(n.timeout,function(){o.abort(),i(!0)})),o=e.connect(t,function(e,t){e&&r&&r.isRunning()&&!n.failFast||(r&&r.ensureAborted(),i(e,t))}),{abort:function(){r&&r.ensureAborted(),o.abort()},forceMinPriority:function(e){o.forceMinPriority(e)}}}}])}(),pt=function(){return m(function e(t){b(this,e),this.strategies=t},[{key:"isSupported",value:function(){return ge(this.strategies,ae.method("isSupported"))}},{key:"connect",value:function(e,t){return function(e,n){var i=ve(e,function(e,i,r,o){return e.connect(n,function(e,n){return function(i,r){n[e].error=i,i?function(e){return function(e,t){for(var n=0;n<e.length;
2n++)if(!t(e[n],n,e))return!1;return!0}(e,function(e){return Boolean(e.error)})}(n)&&t(!0):(pe(n,function(e){e.forceMinPriority(r.transport.priority)}),t(null,r))}}(i,o))});return{abort:function(){pe(i,vt)},forceMinPriority:function(e){pe(i,function(t){t.forceMinPriority(e)})}}}(this.strategies,e)}}])}();function vt(e){e.error||e.aborted||(e.abort(),e.aborted=!0)}var yt=function(){return m(function e(t,n,i){b(this,e),this.strategy=t,this.transports=n,this.ttl=i.ttl||18e5,this.usingTLS=i.useTLS,this.timeline=i.timeline},[{key:"isSupported",value:function(){return this.strategy.isSupported()}},{key:"connect",value:function(e,t){var n=this.usingTLS,i=function(e){var t=Ut.getLocalStorage();if(t)try{var n=t[bt(e)];if(n)return JSON.parse(n)}catch(t){gt(e)}return null}(n),r=i&&i.cacheSkipCount?i.cacheSkipCount:0,o=[this.strategy];if(i&&i.timestamp+this.ttl>=ae.now()){var s=this.transports[i.transport];s&&(["ws","wss"].includes(i.transport)||r>3?(this.timeline.info({cached:!0,transport:i.transport,latency:i.latency}),o.push(new dt([s],{timeout:2*i.latency+1e3,failFast:!0}))):r++)}var c=ae.now(),a=o.pop().connect(e,function i(s,u){s?(gt(n),o.length>0?(c=ae.now(),a=o.pop().connect(e,i)):t(s)):(function(e,t,n,i){var r=Ut.getLocalStorage();if(r)try{r[bt(e)]=ke({timestamp:ae.now(),transport:t,latency:n,cacheSkipCount:i})}catch(e){}}(n,u.transport.name,ae.now()-c,r),t(null,u))});return{abort:function(){a.abort()},forceMinPriority:function(t){e=t,a&&a.forceMinPriority(t)}}}}])}();function bt(e){return"pusherTransport"+(e?"TLS":"NonTLS")}function gt(e){var t=Ut.getLocalStorage();if(t)try{delete t[bt(e)]}catch(e){}}var mt=function(){return m(function e(t,n){var i=n.delay;b(this,e),this.strategy=t,this.options={delay:i}},[{key:"isSupported",value:function(){return this.strategy.isSupported()}},{key:"connect",value:function(e,t){var n,i=this.strategy,r=new oe(this.options.delay,function(){n=i.connect(e,t)});return{abort:function(){r.ensureAborted(),n&&n.abort()},forceMinPriority:function(t){e=t,n&&n.forceMinPriority(t)}}}}])}(),kt=function(){return m(function e(t,n,i){b(this,e),this.test=t,this.trueBranch=n,this.falseBranch=i},[{key:"isSupported",value:function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()}},{key:"connect",value:function(e,t){return(this.test()?this.trueBranch:this.falseBranch).connect(e,t)}}])}(),wt=function(){return m(function e(t){b(this,e),this.strategy=t},[{key:"isSupported",value:function(){return this.strategy.isSupported()}},{key:"connect",value:function(e,t){var n=this.strategy.connect(e,function(e,i){i&&n.abort(),t(e,i)});return n}}])}();function St(e){return function(){return e.isSupported()}}var Ct,_t={getRequest:function(e){var t=new window.XDomainRequest;return t.ontimeout=function(){e.emit("error",new z),e.close()},t.onerror=function(t){e.emit("error",t),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()}},Tt=function(e){function t(e,n,i){var r;return b(this,t),(r=l(this,t)).hooks=e,r.method=n,r.url=i,r}return f(t,e),m(t,[{key:"start",value:function(e){var t=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){t.close()},Ut.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)}},{key:"close",value:function(){this.unloader&&(Ut.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}},{key:"onChunk",value:function(e,t){for(;;){var n=this.advanceBuffer(t);if(!n)break;this.emit("chunk",{status:e,data:n})}this.isBufferTooLong(t)&&this.emit("buffer_too_long")}},{key:"advanceBuffer",value:function(e){var t=e.slice(this.position),n=t.indexOf("\n");return-1!==n?(this.position+=n+1,t.slice(0,n)):null}},{key:"isBufferTooLong",value:function(e){return this.position===e.length&&e.length>262144}}])}(Ie);!function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSED=3]="CLOSED"}(Ct||(Ct={}));var Ot=Ct,Pt=1,Et=function(){return m(function e(t,n){b(this,e),this.hooks=t,this.session=Rt(1e3)+"/"+function(){for(var e=[],t=0;t<8;t++)e.push(Rt(32).toString(32));return e.join("")}(),this.location=function(e){var t=/([^\?]*)\/*(\??.*)/.exec(e);return{base:t[1],queryString:t[2]}}(n),this.readyState=Ot.CONNECTING,this.openStream()},[{key:"send",value:function(e){return this.sendRaw(JSON.stringify([e]))}},{key:"ping",value:function(){this.hooks.sendHeartbeat(this)}},{key:"close",value:function(e,t){this.onClose(e,t,!0)}},{key:"sendRaw",value:function(e){if(this.readyState!==Ot.OPEN)return!1;
2try{return Ut.createSocketRequest("POST",jt((t=this.location,n=this.session,t.base+"/"+n+"/xhr_send"))).start(e),!0}catch(e){return!1}var t,n}},{key:"reconnect",value:function(){this.closeStream(),this.openStream()}},{key:"onClose",value:function(e,t,n){this.closeStream(),this.readyState=Ot.CLOSED,this.onclose&&this.onclose({code:e,reason:t,wasClean:n})}},{key:"onChunk",value:function(e){var t;if(200===e.status)switch(this.readyState===Ot.OPEN&&this.onActivity(),e.data.slice(0,1)){case"o":t=JSON.parse(e.data.slice(1)||"{}"),this.onOpen(t);break;case"a":t=JSON.parse(e.data.slice(1)||"[]");for(var n=0;n<t.length;n++)this.onEvent(t[n]);break;case"m":t=JSON.parse(e.data.slice(1)||"null"),this.onEvent(t);break;case"h":this.hooks.onHeartbeat(this);break;case"c":t=JSON.parse(e.data.slice(1)||"[]"),this.onClose(t[0],t[1],!0)}}},{key:"onOpen",value:function(e){var t,n,i;this.readyState===Ot.CONNECTING?(e&&e.hostname&&(this.location.base=(t=this.location.base,n=e.hostname,(i=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(t))[1]+n+i[3])),this.readyState=Ot.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}},{key:"onEvent",value:function(e){this.readyState===Ot.OPEN&&this.onmessage&&this.onmessage({data:e})}},{key:"onActivity",value:function(){this.onactivity&&this.onactivity()}},{key:"onError",value:function(e){this.onerror&&this.onerror(e)}},{key:"openStream",value:function(){var e=this;this.stream=Ut.createSocketRequest("POST",jt(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",function(t){e.onChunk(t)}),this.stream.bind("finished",function(t){e.hooks.onFinished(e,t)}),this.stream.bind("buffer_too_long",function(){e.reconnect()});try{this.stream.start()}catch(t){ae.defer(function(){e.onError(t),e.onClose(1006,"Could not start streaming",!1)})}}},{key:"closeStream",value:function(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}])}();function jt(e){var t=-1===e.indexOf("?")?"?":"&";return e+t+"t="+ +new Date+"&n="+Pt++}function Rt(e){return Ut.randomInt(e)}var Lt,xt=Et,At={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)}},It={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)}},Dt={getRequest:function(e){var t=new(Ut.getXHRAPI());return t.onreadystatechange=t.onprogress=function(){switch(t.readyState){case 3:t.responseText&&t.responseText.length>0&&e.onChunk(t.status,t.responseText);break;case 4:t.responseText&&t.responseText.length>0&&e.onChunk(t.status,t.responseText),e.emit("finished",t.status),e.close()}},t},abortRequest:function(e){e.onreadystatechange=null,e.abort()}},Nt={createStreamingSocket:function(e){return this.createSocket(At,e)},createPollingSocket:function(e){return this.createSocket(It,e)},createSocket:function(e,t){return new xt(e,t)},createXHR:function(e,t){return this.createRequest(Dt,e,t)},createRequest:function(e,t,n){return new Tt(e,t,n)},createXDR:function(e,t){return this.createRequest(_t,e,t)}},Ht={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:o,DependenciesReceivers:D,getDefaultStrategy:function(e,t,n){var i={};function r(t,r,o,s,c){var a=n(e,t,r,o,s,c);return i[t]=a,a}var o,s=Object.assign({},t,{hostNonTLS:e.wsHost+":"+e.wsPort,hostTLS:e.wsHost+":"+e.wssPort,httpPath:e.wsPath}),c=Object.assign({},s,{useTLS:!0}),a=Object.assign({},t,{hostNonTLS:e.httpHost+":"+e.httpPort,hostTLS:e.httpHost+":"+e.httpsPort,httpPath:e.httpPath}),u={loop:!0,timeout:15e3,timeoutLimit:6e4},h=new ft({minPingDelay:1e4,maxPingDelay:e.activityTimeout}),l=new ft({lives:2,minPingDelay:1e4,maxPingDelay:e.activityTimeout}),f=r("ws","ws",3,s,h),d=r("wss","ws",3,c,h),p=r("sockjs","sockjs",1,a),v=r("xhr_streaming","xhr_streaming",1,a,l),y=r("xdr_streaming","xdr_streaming",1,a,l),b=r("xhr_polling","xhr_polling",1,a),g=r("xdr_polling","xdr_polling",1,a),m=new dt([f],u),k=new dt([d],u),w=new dt([p],u),S=new dt([new kt(St(v),v,y)],u),C=new dt([new kt(St(b),b,g)],u),_=new dt([new kt(St(S),new pt([S,new mt(C,{delay:4e3})]),C)],u),T=new kt(St(_),_,w);return o=t.useTLS?new pt([m,new mt(T,{delay:2e3})]):new pt([m,new mt(k,{delay:2e3}),new mt(T,{delay:5e3})]),new yt(new wt(new kt(St(f),o,T)),i,{ttl:18e5,timeline:t.timeline,useTLS:t.useTLS})},Transports:Ge,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"),N.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:Nt,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():N.load("json2",{},n)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:V,jsonp:Ce}},onDocumentBody:function(e){var t=this;document.body?e():setTimeout(function(){t.onDocumentBody(e)},0)},createJSONPRequest:function(e,t){return new Te(e,t)},createScriptRequest:function(e){return new _e(e)},getLocalStorage:function(){try{return window.localStorage}catch(e){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 Ve},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 Boolean(e)&&void 0!==(new e).withCredentials},isXDRSupported:function(e){var t=e?"https:":"http:",n=this.getProtocol();return Boolean(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)}},Ut=Ht;
2!function(e){e[e.ERROR=3]="ERROR",e[e.INFO=6]="INFO",e[e.DEBUG=7]="DEBUG"}(Lt||(Lt={}));var qt=Lt,Mt=function(){return m(function e(t,n,i){b(this,e),this.key=t,this.session=n,this.events=[],this.options=i||{},this.sent=0,this.uniqueID=0},[{key:"log",value:function(e,t){e<=this.options.level&&(this.events.push(ue({},t,{timestamp:ae.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}},{key:"error",value:function(e){this.log(qt.ERROR,e)}},{key:"info",value:function(e){this.log(qt.INFO,e)}},{key:"debug",value:function(e){this.log(qt.DEBUG,e)}},{key:"isEmpty",value:function(){return 0===this.events.length}},{key:"send",value:function(e,t){var n=this,i=ue({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=[],e(i,function(e,i){e||n.sent++,t&&t(e,i)}),!0}},{key:"generateUniqueID",value:function(){return this.uniqueID++,this.uniqueID}}])}(),zt=function(){return m(function e(t,n,i,r){b(this,e),this.name=t,this.priority=n,this.transport=i,this.options=r||{}},[{key:"isSupported",value:function(){return this.transport.isSupported({useTLS:this.options.useTLS})}},{key:"connect",value:function(e,t){var n=this;if(!this.isSupported())return Bt(new W,t);if(this.priority<e)return Bt(new B,t);var i=!1,r=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),o=null,s=function(){r.unbind("initialized",s),r.connect()},c=function(){o=lt.createHandshake(r,function(e){i=!0,h(),t(null,e)})},a=function(e){h(),t(e)},u=function(){var e;h(),e=ke(r),t(new F(e))},h=function(){r.unbind("initialized",s),r.unbind("open",c),r.unbind("error",a),r.unbind("closed",u)};return r.bind("initialized",s),r.bind("open",c),r.bind("error",a),r.bind("closed",u),r.initialize(),{abort:function(){i||(h(),o?o.close():r.close())},forceMinPriority:function(e){i||n.priority<e&&(o?o.close():r.close())}}}}])}();function Bt(e,t){return ae.defer(function(){t(e)}),{abort:function(){},forceMinPriority:function(){}}}var Ft=Ut.Transports,Xt=function(e,t,n,i,r,o){var s,c=Ft[n];if(!c)throw new J(n);return e.enabledTransports&&-1===le(e.enabledTransports,t)||e.disabledTransports&&-1!==le(e.disabledTransports,t)?s=Jt:(r=Object.assign({ignoreNullOrigin:e.ignoreNullOrigin},r),s=new zt(t,i,o?o.getAssistant(c):c,r)),s},Jt={isSupported:function(){return!1},connect:function(e,t){var n=ae.defer(function(){t(new W)});return{abort:function(){n.ensureAborted()},forceMinPriority:function(){}}}},Wt=function(e,t,n){var i={authTransport:t.transport,authEndpoint:t.endpoint,auth:{params:t.params,headers:t.headers}};return function(t,r){var o=e.channel(t.channelName);n(o,i).authorize(t.socketId,r)}};function Gt(e,t){var n={activityTimeout:e.activityTimeout||O,cluster:e.cluster,httpPath:e.httpPath||S,httpPort:e.httpPort||g,httpsPort:e.httpsPort||k,pongTimeout:e.pongTimeout||P,statsHost:e.statsHost||C,unavailableTimeout:e.unavailableTimeout||E,wsPath:e.wsPath||v,wsPort:e.wsPort||h,wssPort:e.wssPort||p,enableStats:Yt(e),httpHost:Vt(e),useTLS:Kt(e),wsHost:Qt(e),userAuthenticator:Zt(e),channelAuthorizer:en(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}function Vt(e){return e.httpHost?e.httpHost:e.cluster?"sockjs-".concat(e.cluster,".pusher.com"):y}function Qt(e){return e.wsHost?e.wsHost:(t=e.cluster,"ws-".concat(t,".pusher.com"));var t}function Kt(e){return"https:"===Ut.getProtocol()||!1!==e.forceTLS}function Yt(e){return"enableStats"in e?e.enableStats:"disableStats"in e&&!e.disableStats}var $t=function(e){return"customHandler"in e&&null!=e.customHandler};function Zt(e){var t=Object.assign(Object.assign({},j),e.userAuthentication);return $t(t)?t.customHandler:function(e){if(void 0===Ut.getAuthorizers()[e.transport])throw"'".concat(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 i in t.params)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(t.params[i]);if(null!=t.paramsProvider){var r=t.paramsProvider();for(var i in r)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(r[i])}return n}(t,e);Ut.getAuthorizers()[e.transport](Ut,r,e,i.UserAuthentication,n)}}(t)}function en(e,t){var n=function(e,t){var n;if("channelAuthorization"in e)n=Object.assign(Object.assign({},R),e.channelAuthorization);else if(n={transport:e.authTransport||T,endpoint:e.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)return{customHandler:Wt(t,n,e.authorizer)};return n}(e,t);return $t(n)?n.customHandler:function(e){if(void 0===Ut.getAuthorizers()[e.transport])throw"'".concat(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 i in n+="&channel_name="+encodeURIComponent(e.channelName),t.params)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(t.params[i]);if(null!=t.paramsProvider){var r=t.paramsProvider();for(var i in r)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(r[i])}return n}(t,e);Ut.getAuthorizers()[e.transport](Ut,r,e,i.ChannelAuthorization,n)}}(n)}var tn=function(e){function t(e){var n;return b(this,t),(n=l(this,t,[function(e,t){Se.debug("No callbacks on watchlist events for ".concat(e))}])).pusher=e,n.bindWatchlistInternalEvent(),n}return f(t,e),m(t,[{key:"handleEvent",value:function(e){var t=this;
2e.data.events.forEach(function(e){t.emit(e.name,e)})}},{key:"bindWatchlistInternalEvent",value:function(){var e=this;this.pusher.connection.bind("message",function(t){"pusher_internal:watchlist_events"===t.event&&e.handleEvent(t)})}}])}(Ie),nn=function(e){function t(e){var n;return b(this,t),(n=l(this,t,[function(e,t){Se.debug("No callbacks on user for "+e)}])).signin_requested=!1,n.user_data=null,n.serverToUserChannel=null,n.signinDonePromise=null,n._signinDoneResolve=null,n._onAuthorize=function(e,t){if(e)return Se.warn("Error during signin: ".concat(e)),void n._cleanup();n.pusher.send_event("pusher:signin",{auth:t.auth,user_data:t.user_data})},n.pusher=e,n.pusher.connection.bind("state_change",function(e){var t=e.previous,i=e.current;"connected"!==t&&"connected"===i&&n._signin(),"connected"===t&&"connected"!==i&&(n._cleanup(),n._newSigninPromiseIfNeeded())}),n.watchlist=new tn(e),n.pusher.connection.bind("message",function(e){"pusher:signin_success"===e.event&&n._onSigninSuccess(e.data),n.serverToUserChannel&&n.serverToUserChannel.name===e.channel&&n.serverToUserChannel.handleEvent(e)}),n}return f(t,e),m(t,[{key:"signin",value:function(){this.signin_requested||(this.signin_requested=!0,this._signin())}},{key:"_signin",value:function(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),"connected"===this.pusher.connection.state&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}},{key:"_onSigninSuccess",value:function(e){try{this.user_data=JSON.parse(e.user_data)}catch(t){return Se.error("Failed parsing user data after signin: ".concat(e.user_data)),void this._cleanup()}if("string"!=typeof this.user_data.id||""===this.user_data.id)return Se.error("user_data doesn't contain an id. user_data: ".concat(this.user_data)),void this._cleanup();this._signinDoneResolve(),this._subscribeChannels()}},{key:"_subscribeChannels",value:function(){var e,t=this;this.serverToUserChannel=new tt("#server-to-user-".concat(this.user_data.id),this.pusher),this.serverToUserChannel.bind_global(function(e,n){0!==e.indexOf("pusher_internal:")&&0!==e.indexOf("pusher:")&&t.emit(e,n)}),(e=this.serverToUserChannel).subscriptionPending&&e.subscriptionCancelled?e.reinstateSubscription():e.subscriptionPending||"connected"!==t.pusher.connection.state||e.subscribe()}},{key:"_cleanup",value:function(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}},{key:"_newSigninPromiseIfNeeded",value:function(){if(this.signin_requested&&(!this.signinDonePromise||this.signinDonePromise.done)){var e=function(){var e,t;return{promise:new Promise(function(n,i){e=n,t=i}),resolve:e,reject:t}}(),t=e.promise,n=e.resolve;e.reject,t.done=!1;var i=function(){t.done=!0};t.then(i).catch(i),this.signinDonePromise=t,this._signinDoneResolve=n}}}])}(Ie),rn=function(){function e(t,n){var i=this;b(this,e),function(e){if(null==e)throw"You must pass your app key when you instantiate Pusher."}(t),function(e){if(null==e)throw"You must pass an options object";if(null==e.cluster)throw"Options object must provide a cluster";"disableStats"in e&&Se.warn("The disableStats option is deprecated in favor of enableStats")}(n),this.key=t,this.options=n,this.config=Gt(this.options,this),this.channels=lt.createChannels(),this.global_emitter=new Ie,this.sessionID=Ut.randomInt(1e9),this.timeline=new Mt(this.key,this.sessionID,{cluster:this.config.cluster,features:e.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:qt.INFO,version:s}),this.config.enableStats&&(this.timelineSender=lt.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+Ut.TimelineTransport.name})),this.connection=lt.createConnectionManager(this.key,{getStrategy:function(e){return Ut.getDefaultStrategy(i.config,e,Xt)},timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:Boolean(this.config.useTLS)}),this.connection.bind("connected",function(){i.subscribeAll(),i.timelineSender&&i.timelineSender.send(i.connection.isUsingTLS())}),this.connection.bind("message",function(e){var t=0===e.event.indexOf("pusher_internal:");if(e.channel){var n=i.channel(e.channel);n&&n.handleEvent(e)}t||i.global_emitter.emit(e.event,e.data)}),this.connection.bind("connecting",function(){i.channels.disconnect()}),this.connection.bind("disconnected",function(){i.channels.disconnect()}
2),this.connection.bind("error",function(e){Se.warn(e)}),e.instances.push(this),this.timeline.info({instances:e.instances.length}),this.user=new nn(this),e.isReady&&this.connect()}return m(e,[{key:"switchCluster",value:function(e){var t=e.appKey,n=e.cluster;this.key=t,this.options=Object.assign(Object.assign({},this.options),{cluster:n}),this.config=Gt(this.options,this),this.connection.switchCluster(this.key)}},{key:"channel",value:function(e){return this.channels.find(e)}},{key:"allChannels",value:function(){return this.channels.all()}},{key:"connect",value:function(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var e=this.connection.isUsingTLS(),t=this.timelineSender;this.timelineSenderTimer=new se(6e4,function(){t.send(e)})}}},{key:"disconnect",value:function(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}},{key:"bind",value:function(e,t,n){return this.global_emitter.bind(e,t,n),this}},{key:"unbind",value:function(e,t,n){return this.global_emitter.unbind(e,t,n),this}},{key:"bind_global",value:function(e){return this.global_emitter.bind_global(e),this}},{key:"unbind_global",value:function(e){return this.global_emitter.unbind_global(e),this}},{key:"unbind_all",value:function(e){return this.global_emitter.unbind_all(),this}},{key:"subscribeAll",value:function(){var e;for(e in this.channels.channels)this.channels.channels.hasOwnProperty(e)&&this.subscribe(e)}},{key:"subscribe",value:function(e){var t=this.channels.add(e,this);return t.subscriptionPending&&t.subscriptionCancelled?t.reinstateSubscription():t.subscriptionPending||"connected"!==this.connection.state||t.subscribe(),t}},{key:"unsubscribe",value:function(e){var t=this.channels.find(e);t&&t.subscriptionPending?t.cancelSubscription():(t=this.channels.remove(e))&&t.subscribed&&t.unsubscribe()}},{key:"send_event",value:function(e,t,n){return this.connection.send_event(e,t,n)}},{key:"shouldUseTLS",value:function(){return this.config.useTLS}},{key:"signin",value:function(){this.user.signin()}}],[{key:"ready",value:function(){e.isReady=!0;for(var t=0,n=e.instances.length;t<n;t++)e.instances[t].connect()}},{key:"getClientFeatures",value:function(){return de(be({ws:Ut.Transports.ws},function(e){return e.isSupported({})}))}}])}();
2rn.instances=[],rn.isReady=!1,rn.logToConsole=!1,rn.Runtime=Ut,rn.ScriptReceivers=Ut.ScriptReceivers,rn.DependenciesReceivers=Ut.DependenciesReceivers,rn.auth_callbacks=Ut.auth_callbacks;var on=rn;Ut.setup(rn)}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}return n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n(721)}()},"object"===w(t)&&"object"===w(e)?e.exports=s():(r=[],void 0===(o="function"==typeof(i=s)?i.apply(t,r):i)||(e.exports=o))}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={id:i,loaded:!1,exports:{}};return e[i](o,o.exports,n),o.loaded=!0,o.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach(function(e){i(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function i(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t,n){return t=s(t),function(e,t){if(t&&("object"==u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,o()?Reflect.construct(t,n||[],s(e).constructor):t.apply(e,n))}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(o=function(){return!!e})()}
2function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,d(i.key),i)}}function f(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){var t=function(e){if("object"!=u(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==u(t)?t:t+""}var p=function(){return f(function e(){h(this,e),this.notificationCreatedEvent=".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated"},[{key:"listenForWhisper",value:function(e,t){return this.listen(".client-"+e,t)}},{key:"notification",value:function(e){return this.listen(this.notificationCreatedEvent,e)}},{key:"stopListeningForNotification",value:function(e){return this.stopListening(this.notificationCreatedEvent,e)}},{key:"stopListeningForWhisper",value:function(e,t){return this.stopListening(".client-"+e,t)}}])}(),v=function(){return f(function e(t){h(this,e),this.namespace=t},[{key:"format",value:function(e){return[".","\\"].includes(e.charAt(0))?e.substring(1):(this.namespace&&(e=this.namespace+"."+e),e.replace(/\./g,"\\"))}},{key:"setNamespace",value:function(e){this.namespace=e}}])}(),y=function(e){function t(e,n,i){var o;return h(this,t),(o=r(this,t)).name=n,o.pusher=e,o.options=i,o.eventFormatter=new v(o.options.namespace),o.subscribe(),o}return c(t,e),f(t,[{key:"subscribe",value:function(){this.subscription=this.pusher.subscribe(this.name)}},{key:"unsubscribe",value:function(){this.pusher.unsubscribe(this.name)}},{key:"listen",value:function(e,t){return this.on(this.eventFormatter.format(e),t),this}},{key:"listenToAll",value:function(e){var t=this;return this.subscription.bind_global(function(n,i){var r;if(!n.startsWith("pusher:")){var o=String(null!==(r=t.options.namespace)&&void 0!==r?r:"").replace(/\./g,"\\"),s=n.startsWith(o)?n.substring(o.length+1):"."+n;e(s,i)}}),this}},{key:"stopListening",value:function(e,t){return t?this.subscription.unbind(this.eventFormatter.format(e),t):this.subscription.unbind(this.eventFormatter.format(e)),this}},{key:"stopListeningToAll",value:function(e){return e?this.subscription.unbind_global(e):this.subscription.unbind_global(),this}},{key:"subscribed",value:function(e){return this.on("pusher:subscription_succeeded",function(){e()}),this}},{key:"error",value:function(e){return this.on("pusher:subscription_error",function(t){e(t)}),this}},{key:"on",value:function(e,t){return this.subscription.bind(e,t),this}}])}(p),b=function(e){function t(){return h(this,t),r(this,t,arguments)}return c(t,e),f(t,[{key:"whisper",value:function(e,t){return this.pusher.channels.channels[this.name].trigger("client-".concat(e),t),this}}])}(y),g=function(e){function t(){return h(this,t),r(this,t,arguments)}return c(t,e),f(t,[{key:"whisper",value:function(e,t){return this.pusher.channels.channels[this.name].trigger("client-".concat(e),t),this}}])}(y),m=function(e){function t(){return h(this,t),r(this,t,arguments)}return c(t,e),f(t,[{key:"here",value:function(e){return this.on("pusher:subscription_succeeded",function(t){e(Object.keys(t.members).map(function(e){return t.members[e]}))}),this}},{key:"joining",value:function(e){return this.on("pusher:member_added",function(t){e(t.info)}),this}},{key:"whisper",value:function(e,t){return this.pusher.channels.channels[this.name].trigger("client-".concat(e),t),this}},{key:"leaving",value:function(e){return this.on("pusher:member_removed",function(t){e(t.info)}),this}}])}(b),k=function(e){function t(e,n,i){var o;return h(this,t),(o=r(this,t)).events={},o.listeners={},o.name=n,o.socket=e,o.options=i,o.eventFormatter=new v(o.options.namespace),o.subscribe(),o}return c(t,e),f(t,[{key:"subscribe",value:function(){this.socket.emit("subscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"unsubscribe",value:function(){this.unbind(),this.socket.emit("unsubscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"listen",value:function(e,t){return this.on(this.eventFormatter.format(e),t),this}},{key:"stopListening",value:function(e,t){return this.unbindEvent(this.eventFormatter.format(e),t),this}},{key:"subscribed",value:function(e){return this.on("connect",function(t){e(t)}),this}},{key:"error",value:function(e){return this}},{key:"on",value:function(e,t){var n=this;return this.listeners[e]=this.listeners[e]||[],this.events[e]||(this.events[e]=function(t,i){n.name===t&&n.listeners[e]&&n.listeners[e].forEach(function(e){return e(i)})},this.socket.on(e,this.events[e])),this.listeners[e].push(t),this}},{key:"unbind",value:function(){var e=this;
2Object.keys(this.events).forEach(function(t){e.unbindEvent(t)})}},{key:"unbindEvent",value:function(e,t){this.listeners[e]=this.listeners[e]||[],t&&(this.listeners[e]=this.listeners[e].filter(function(e){return e!==t})),(!t||0===this.listeners[e].length)&&(this.events[e]&&(this.socket.removeListener(e,this.events[e]),delete this.events[e]),delete this.listeners[e])}}])}(p),w=function(e){function t(){return h(this,t),r(this,t,arguments)}return c(t,e),f(t,[{key:"whisper",value:function(e,t){return this.socket.emit("client event",{channel:this.name,event:"client-".concat(e),data:t}),this}}])}(k),S=function(e){function t(){return h(this,t),r(this,t,arguments)}return c(t,e),f(t,[{key:"here",value:function(e){return this.on("presence:subscribed",function(t){e(t.map(function(e){return e.user_info}))}),this}},{key:"joining",value:function(e){return this.on("presence:joining",function(t){return e(t.user_info)}),this}},{key:"whisper",value:function(e,t){return this.socket.emit("client event",{channel:this.name,event:"client-".concat(e),data:t}),this}},{key:"leaving",value:function(e){return this.on("presence:leaving",function(t){return e(t.user_info)}),this}}])}(w),C=function(e){function t(){return h(this,t),r(this,t,arguments)}return c(t,e),f(t,[{key:"subscribe",value:function(){}},{key:"unsubscribe",value:function(){}},{key:"listen",value:function(e,t){return this}},{key:"listenToAll",value:function(e){return this}},{key:"stopListening",value:function(e,t){return this}},{key:"subscribed",value:function(e){return this}},{key:"error",value:function(e){return this}},{key:"on",value:function(e,t){return this}}])}(p),_=function(e){function t(){return h(this,t),r(this,t,arguments)}return c(t,e),f(t,[{key:"whisper",value:function(e,t){return this}}])}(C),T=function(e){function t(){return h(this,t),r(this,t,arguments)}return c(t,e),f(t,[{key:"whisper",value:function(e,t){return this}}])}(C),O=function(e){function t(){return h(this,t),r(this,t,arguments)}return c(t,e),f(t,[{key:"here",value:function(e){return this}},{key:"joining",value:function(e){return this}},{key:"whisper",value:function(e,t){return this}},{key:"leaving",value:function(e){return this}}])}(_),P=function(){function e(t){h(this,e),this.setOptions(t),this.connect()}return f(e,[{key:"setOptions",value:function(n){this.options=t(t(t({},e._defaultOptions),n),{},{broadcaster:n.broadcaster});var i=this.csrfToken();i&&(this.options.auth.headers["X-CSRF-TOKEN"]=i,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=i),(i=this.options.bearerToken)&&(this.options.auth.headers.Authorization="Bearer "+i,this.options.userAuthentication.headers.Authorization="Bearer "+i)}},{key:"csrfToken",value:function(){var e,t,n;return("undefined"==typeof window?"undefined":u(window))<"u"&&null!=(t=window.Laravel)&&t.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:("undefined"==typeof document?"undefined":u(document))<"u"&&"function"==typeof document.querySelector&&null!==(e=null==(n=document.querySelector('meta[name="csrf-token"]'))?void 0:n.getAttribute("content"))&&void 0!==e?e:null}}])}();P._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"};var E,j,R=P,L=function(e){function t(){var e;return h(this,t),(e=r(this,t,arguments)).channels={},e}return c(t,e),f(t,[{key:"connect",value:function(){if(u(this.options.client)<"u")this.pusher=this.options.client;else if(this.options.Pusher)this.pusher=new this.options.Pusher(this.options.key,this.options);else{if(!(("undefined"==typeof window?"undefined":u(window))<"u"&&u(window.Pusher)<"u"))throw new Error("Pusher client not found. Should be globally available or passed via options.client");this.pusher=new window.Pusher(this.options.key,this.options)}}},{key:"signin",value:function(){this.pusher.signin()}},{key:"listen",value:function(e,t,n){return this.channel(e).listen(t,n)}},{key:"channel",value:function(e){return this.channels[e]||(this.channels[e]=new y(this.pusher,e,this.options)),this.channels[e]}},{key:"privateChannel",value:function(e){return this.channels["private-"+e]||(this.channels["private-"+e]=new b(this.pusher,"private-"+e,this.options)),this.channels["private-"+e]}},{key:"encryptedPrivateChannel",value:function(e){return this.channels["private-encrypted-"+e]||(this.channels["private-encrypted-"+e]=new g(this.pusher,"private-encrypted-"+e,this.options)),this.channels["private-encrypted-"+e]}},{key:"presenceChannel",value:function(e){return this.channels["presence-"+e]||(this.channels["presence-"+e]=new m(this.pusher,"presence-"+e,this.options)),this.channels["presence-"+e]}},{key:"leave",value:function(e){var t=this;[e,"private-"+e,"private-encrypted-"+e,"presence-"+e].forEach(function(e){t.leaveChannel(e)})}},{key:"leaveChannel",value:function(e){this.channels[e]&&(this.channels[e].unsubscribe(),delete this.channels[e])}},{key:"socketId",value:function(){return this.pusher.connection.socket_id}},{key:"connectionStatus",value:function(){var e=this.pusher.connection.state;switch(e){case"connected":case"connecting":return e;case"failed":case"unavailable":return"failed";default:return"disconnected"}}},{key:"onConnectionChange",value:function(e){var t=this,n=function(){e(t.connectionStatus())},i=["state_change","connected","disconnected"];
2return i.forEach(function(e){t.pusher.connection.bind(e,n)}),function(){i.forEach(function(e){t.pusher.connection.unbind(e,n)})}}},{key:"disconnect",value:function(){this.pusher.disconnect()}}])}(R),x=function(e){function t(){var e;return h(this,t),(e=r(this,t,arguments)).channels={},e}return c(t,e),f(t,[{key:"connect",value:function(){var e,t=this,n=this.getSocketIO();this.socket=n(null!==(e=this.options.host)&&void 0!==e?e:void 0,this.options),this.socket.io.on("reconnect",function(){Object.values(t.channels).forEach(function(e){e.subscribe()})})}},{key:"getSocketIO",value:function(){if(u(this.options.client)<"u")return this.options.client;if(("undefined"==typeof window?"undefined":u(window))<"u"&&u(window.io)<"u")return window.io;throw new Error("Socket.io client not found. Should be globally available or passed via options.client")}},{key:"listen",value:function(e,t,n){return this.channel(e).listen(t,n)}},{key:"channel",value:function(e){return this.channels[e]||(this.channels[e]=new k(this.socket,e,this.options)),this.channels[e]}},{key:"privateChannel",value:function(e){return this.channels["private-"+e]||(this.channels["private-"+e]=new w(this.socket,"private-"+e,this.options)),this.channels["private-"+e]}},{key:"presenceChannel",value:function(e){return this.channels["presence-"+e]||(this.channels["presence-"+e]=new S(this.socket,"presence-"+e,this.options)),this.channels["presence-"+e]}},{key:"leave",value:function(e){var t=this;[e,"private-"+e,"presence-"+e].forEach(function(e){t.leaveChannel(e)})}},{key:"leaveChannel",value:function(e){this.channels[e]&&(this.channels[e].unsubscribe(),delete this.channels[e])}},{key:"socketId",value:function(){return this.socket.id}},{key:"connectionStatus",value:function(){return this.socket.connected?"connected":this.socket.io._reconnecting?"reconnecting":void 0!==this.socket.id?"disconnected":"connecting"}},{key:"onConnectionChange",value:function(e){var t=this,n=function(){e(t.connectionStatus())},i=["connect","disconnect","connect_error","reconnect_attempt","reconnect","reconnect_error","reconnect_failed"];return i.forEach(function(e){t.socket.on(e,n)}),function(){i.forEach(function(e){t.socket.off(e,n)})}}},{key:"disconnect",value:function(){this.socket.disconnect()}}])}(R),A=function(e){function t(){var e;return h(this,t),(e=r(this,t,arguments)).channels={},e}return c(t,e),f(t,[{key:"connect",value:function(){}},{key:"listen",value:function(e,t,n){return new C}},{key:"channel",value:function(e){return new C}},{key:"privateChannel",value:function(e){return new _}},{key:"encryptedPrivateChannel",value:function(e){return new T}},{key:"presenceChannel",value:function(e){return new O}},{key:"leave",value:function(e){}},{key:"leaveChannel",value:function(e){}},{key:"socketId",value:function(){return"fake-socket-id"}},{key:"connectionStatus",value:function(){return"connected"}},{key:"onConnectionChange",value:function(e){return function(){}}},{key:"disconnect",value:function(){}}])}(R),I=function(){return f(function e(t){h(this,e),this.options=t,this.connect(),this.options.withoutInterceptors||this.registerInterceptors()},[{key:"channel",value:function(e){return this.connector.channel(e)}},{key:"connect",value:function(){if("reverb"===this.options.broadcaster)this.connector=new L(t(t({},this.options),{},{cluster:""}));else if("pusher"===this.options.broadcaster)this.connector=new L(this.options);else if("ably"===this.options.broadcaster)this.connector=new L(t(t({},this.options),{},{cluster:"",broadcaster:"pusher"}));else if("socket.io"===this.options.broadcaster)this.connector=new x(this.options);else if("null"===this.options.broadcaster)this.connector=new A(this.options);else{if("function"!=typeof this.options.broadcaster||!function(e){try{return Reflect.construct(String,[],e),!0}catch(e){return!1}}(this.options.broadcaster))throw new Error("Broadcaster ".concat(u(this.options.broadcaster)," ").concat(String(this.options.broadcaster)," is not supported."));this.connector=new this.options.broadcaster(this.options)}}},{key:"disconnect",value:function(){this.connector.disconnect()}},{key:"join",value:function(e){return this.connector.presenceChannel(e)}},{key:"leave",value:function(e){this.connector.leave(e)}},{key:"leaveChannel",value:function(e){this.connector.leaveChannel(e)}},{key:"leaveAllChannels",value:function(){for(var e in this.connector.channels)this.leaveChannel(e)}},{key:"listen",value:function(e,t,n){return this.connector.listen(e,t,n
2)}},{key:"private",value:function(e){return this.connector.privateChannel(e)}},{key:"encryptedPrivate",value:function(e){if(this.connectorSupportsEncryptedPrivateChannels(this.connector))return this.connector.encryptedPrivateChannel(e);throw new Error("Broadcaster ".concat(u(this.options.broadcaster)," ").concat(String(this.options.broadcaster)," does not support encrypted private channels."))}},{key:"connectorSupportsEncryptedPrivateChannels",value:function(e){return e instanceof L||e instanceof A}},{key:"socketId",value:function(){return this.connector.socketId()}},{key:"connectionStatus",value:function(){return this.connector.connectionStatus()}},{key:"registerInterceptors",value:function(){("undefined"==typeof Vue?"undefined":u(Vue))<"u"&&null!=Vue&&Vue.http&&this.registerVueRequestInterceptor(),"function"==typeof axios&&this.registerAxiosRequestInterceptor(),"function"==typeof jQuery&&this.registerjQueryAjaxSetup(),"object"==("undefined"==typeof Turbo?"undefined":u(Turbo))&&this.registerTurboRequestInterceptor()}},{key:"registerVueRequestInterceptor",value:function(){var e=this;Vue.http.interceptors.push(function(t,n){e.socketId()&&t.headers.set("X-Socket-ID",e.socketId()),n()})}},{key:"registerAxiosRequestInterceptor",value:function(){var e=this;axios.interceptors.request.use(function(t){return e.socketId()&&(t.headers["X-Socket-Id"]=e.socketId()),t})}},{key:"registerjQueryAjaxSetup",value:function(){var e=this;u(jQuery.ajax)<"u"&&jQuery.ajaxPrefilter(function(t,n,i){e.socketId()&&i.setRequestHeader("X-Socket-Id",e.socketId())})}},{key:"registerTurboRequestInterceptor",value:function(){var e=this;document.addEventListener("turbo:before-fetch-request",function(t){t.detail.fetchOptions.headers["X-Socket-Id"]=e.socketId()})}}])}(),D=n(669),N=n.n(D);function H(e){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(e)}function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?U(Object(n),!0).forEach(function(t){M(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function M(e,t,n){return(t=function(e){var t=function(e){if("object"!=H(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=H(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==H(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}if(window.Pusher=N(),window.ctReverbConfig=window.ctReverbConfig||{},null!==(E=null===(j=window.corepublish)||void 0===j?void 0:j.websocketActive)&&void 0!==E&&E){if(!window.ctReverbConfig.host||!window.ctReverbConfig.scheme){var z,B=function(){var e=window.CPLIBHTMLROOT;if(!window.CPLIBHTMLROOT)return console.warn("Invalid CPLIBHTMLROOT URL:",e),null;try{var t=new URL(e),n=t.protocol.replace(":","");return{scheme:n,host:t.hostname,port:t.port?parseInt(t.port,10):"https"===n?443:80}}catch(t){return console.warn("Invalid CPLIBHTMLROOT URL:",e,t),null}}();B&&(window.ctReverbConfig.host=B.host,window.ctReverbConfig.scheme=B.scheme,window.ctReverbConfig.port=null!==(z=window.ctReverbConfig.port)&&void 0!==z?z:B.port)}var F,X;window.ctReverbConfig.key||(window.ctReverbConfig.key="corepublish-ws"),window.ctReverbConfig?(window.Echo=new I({broadcaster:"reverb",key:window.ctReverbConfig.key,wsHost:window.ctReverbConfig.host,wsPort:null!==(F=window.ctReverbConfig.port)&&void 0!==F?F:80,wssPort:null!==(X=window.ctReverbConfig.port)&&void 0!==X?X:443,forceTLS:"https"===window.ctReverbConfig.scheme,enabledTransports:["ws","wss"],authorizer:function(e){return{authorize:function(t,n){var i=document.head.querySelector('meta[name="csrf-token"]'),r=i?i.content:null,o=window.ctReverbConfig.authEndpoint||"/api/broadcasting/auth";fetch(o,{method:"POST",credentials:"same-origin",headers:q({"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},r?{"X-CSRF-TOKEN":r}:{}),body:JSON.stringify({socket_id:t,channel_name:e.name})}).then(function(e){if(!e.ok){var t=new Error("Failed to authorize private channel.");throw t.status=e.status,t}return e.json()}).then(function(e){n(!1,e)}
2).catch(function(e){n(!0,e)})}}}}),console.log("Laravel Echo initialized with Reverb")):console.warn("ctReverbConfig not found. Laravel Echo not initialized.")}else console.info("Websocket support is not activated")}()}();
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.