text: (window.webpackJsonp=window.webpackJsonp||[]).push([[230],{255:function(t,e,n){"use strict";n.r(e),function(t,r,o){n.d(e,"DeckgoRemote",function(){return Hn});var i,s,c,a,u,h=n(332),p=n(7);(u=i||(i={}))[u.PENCIL=0]="PENCIL",u[u.CIRCLE=1]="CIRCLE",function(t){t.YOUTUBE_PLAY="youtube_play",t.YOUTUBE_PAUSE="youtube_pause"}(s||(s={})),function(t){t.SLIDES_REQUEST="slides_request",t.SLIDES_ANSWER="slides_answer",t.NEXT_SLIDE="next_slide",t.PREV_SLIDE="prev_slide",t.SLIDE_TO="slide_to",t.CLEAR_SLIDE="clear_slide",t.START_DRAWING="start_drawing",t.DRAW="draw",t.END_DRAWING="end_drawing",t.SLIDE_ACTION="slide_action"}(c||(c={})),function(t){t.DECK="deck",t.APP="app"}(a||(a={}));var l="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};function f(t,e){return t(e={exports:{}},e.exports),e.exports}var d=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,y=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],v=function(t){var e=t,n=t.indexOf("["),r=t.indexOf("]");-1!=n&&-1!=r&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));for(var o=d.exec(t||""),i={},s=14;s--;)i[y[s]]=o[s]||"";return-1!=n&&-1!=r&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i},b=1e3,m=60*b,g=60*m,w=24*g,C=365.25*w,_=function(t,e){e=e||{};var n=typeof t;if("string"===n&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*C;case"days":case"day":case"d":return n*w;case"hours":case"hour":case"hrs":case"hr":case"h":return n*g;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*b;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(t);if("number"===n&&!1===isNaN(t))return e.long?function(t){return x(t,w,"day")||x(t,g,"hour")||x(t,m,"minute")||x(t,b,"second")||t+" ms"}(t):function(t){return t>=w?Math.round(t/w)+"d":t>=g?Math.round(t/g)+"h":t>=m?Math.round(t/m)+"m":t>=b?Math.round(t/b)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function x(t,e,n){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var E=f(function(t,e){function n(t){var n;function o(){if(o.enabled){var t=o,r=+new Date;t.diff=r-(n||r),t.prev=n,t.curr=r,n=r;for(var i=new Array(arguments.length),s=0;s<i.length;s++)i[s]=arguments[s];i[0]=e.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var c=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;c++;var o=e.formatters[r];return"function"==typeof o&&(n=o.call(t,i[c]),i.splice(c,1),c--),n}),e.formatArgs.call(t,i),(o.log||e.log||console.log.bind(console)).apply(t,i)}}return o.namespace=t,o.enabled=e.enabled(t),o.useColors=e.useColors(),o.color=function(t){var n,r=0;for(n in t)r=(r<<5)-r+t.charCodeAt(n),r|=0;return e.colors[Math.abs(r)%e.colors.length]}(t),o.destroy=r,"function"==typeof e.init&&e.init(o),e.instances.push(o),o}function r(){var t=e.instances.indexOf(this);return-1!==t&&(e.instances.splice(t,1),!0)}(e=t.exports=n.debug=n.default=n).coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){e.enable("")},e.enable=function(t){var n;e.save(t),e.names=[],e.skips=[];var r=("string"==typeof t?t:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")));for(n=0;n<e.instances.length;n++){var i=e.instances[n];i.enabled=e.enabled(i.namespace)}},e.enabled=function(t){if("*"===t[t.length-1])return!0;var n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=_,e.instances=[],e.names=[],e.skips=[],e.formatters={}}),k=(E.coerce,E.disable,E.enable,E.enabled,E.humanize,E.instances,E.names,E.skips,E.formatters,f(function(t,e){function n(){var t;try{t=e.storage.debug}catch(t){}return!t&&void 0!==r&&"env"in r&&(t=Object({SIGNALING_SERVER:"https://api.deckdeckgo.com",ROOM_NAME:"Web Apps with Rust & Firebase"}).DEBUG),t}(e=t.exports=E).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(t){var n=this.useColors;if(t[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+t[0]+(n?"%c ":" ")+"+"+e.humanize(this.diff),n){var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&(o++,"%c"===t&&(i=o))}),t.splice(i,0,r)}},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}},e.load=n,e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(n())})),S=(k.log,k.formatArgs,k.save,k.load,k.useColors,k.storage,k.colors,k("socket.io-client:url")),N=function(t,e){var n=t;e=e||"undefined"!=typeof location&&location,null==t&&(t=e.protocol+"//"+e.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?e.protocol+t:e.host+t),/^(https?|wss?):\/\//.test(t)||(S("protocol-less url %s",t),t=void 0!==e?e.protocol+"//"+t:"https://"+t),S("parse %s",t),n=v(t)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";var r=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+r+":"+n.port,n.href=n.protocol+"://"+r+(e&&e.port===n.port?"":":"+n.port),n};var A=f(function(t){function e(t){if(t)return function(t){for(var n in e.prototype)t[n]=e.prototype[n];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<r.length;o++)if((n=r[o])===e||n.fn===e){r.splice(o,1);break}return this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),n=this._callbacks["$"+t];if(n)for(var r=0,o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,e);return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}}),T={}.toString,O=Array.isArray||function(t){return"[object Array]"==T.call(t)},P=function(t){return B&&o.isBuffer(t)||R&&(t instanceof ArrayBuffer||D(t))},B="function"==typeof o&&"function"==typeof o.isBuffer,R="function"==typeof ArrayBuffer,D=function(t){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer};var I=Object.prototype.toString,j="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===I.call(Blob),F="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===I.call(File);var q=function(t){var e=[],n=t;return n.data=function t(e,n){if(!e)return e;if(P(e)){var r={_placeholder:!0,num:n.length};return n.push(e),r}if(O(e)){for(var o=new Array(e.length),i=0;i<e.length;i++)o[i]=t(e[i],n);return o}if("object"==typeof e&&!(e instanceof Date)){for(var s in o={},e)o[s]=t(e[s],n);return o}return e}(t.data,e),n.attachments=e.length,{packet:n,buffers:e}},L=function(t,e){return t.data=function t(e,n){if(!e)return e;if(e&&e._placeholder)return n[e.num];if(O(e))for(var r=0;r<e.length;r++)e[r]=t(e[r],n);else if("object"==typeof e)for(var o in e)e[o]=t(e[o],n);return e}(t.data,e),t.attachments=void 0,t},U=function(t,e){var n=0,r=t;!function t(o,i,s){if(!o)return o;if(j&&o instanceof Blob||F&&o instanceof File){n++;var c=new FileReader;c.onload=function(){s?s[i]=this.result:r=this.result,--n||e(r)},c.readAsArrayBuffer(o)}else if(O(o))for(var a=0;a<o.length;a++)t(o[a],a,o);else if("object"==typeof o&&!P(o))for(var u in o)t(o[u],u,o)}(r),n||e(r)},M=f(function(t,e){var n=k("socket.io-parser");function r(){}e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=r,e.Decoder=s;var o=e.ERROR+'"encode error"';function i(t){var r=""+t.type;if(e.BINARY_EVENT!==t.type&&e.BINARY_ACK!==t.type||(r+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(r+=t.nsp+","),null!=t.id&&(r+=t.id),null!=t.data){var i=function(t){try{return JSON.stringify(t)}catch(t){return!1}}(t.data);if(!1===i)return o;r+=i}return n("encoded %j as %s",t,r),r}function s(){this.reconstructor=null}function c(t){this.reconPack=t,this.buffers=[]}function a(t){return{type:e.ERROR,data:"parser error: "+t}}r.prototype.encode=function(t,r){n("encoding packet %j",t),e.BINARY_EVENT===t.type||e.BINARY_ACK===t.type?function(t,e){U(t,function(t){var n=q(t),r=i(n.packet),o=n.buffers;o.unshift(r),e(o)})}(t,r):r([i(t)])},A(s.prototype),s.prototype.add=function(t){var r;if("string"==typeof t)r=function(t){var r=0,o={type:Number(t.charAt(0))};if(null==e.types[o.type])return a("unknown packet type "+o.type);if(e.BINARY_EVENT===o.type||e.BINARY_ACK===o.type){for(var i="";"-"!==t.charAt(++r)&&(i+=t.charAt(r),r!=t.length););if(i!=Number(i)||"-"!==t.charAt(r))throw new Error("Illegal attachments");o.attachments=Number(i)}if("/"===t.charAt(r+1))for(o.nsp="";++r&&","!==(c=t.charAt(r))&&(o.nsp+=c,r!==t.length););else o.nsp="/";var s=t.charAt(r+1);if(""!==s&&Number(s)==s){for(o.id="";++r;){var c;if(null==(c=t.charAt(r))||Number(c)!=c){--r;break}if(o.id+=t.charAt(r),r===t.length)break}o.id=Number(o.id)}if(t.charAt(++r)){var u=function(t){try{return JSON.parse(t)}catch(t){return!1}}(t.substr(r));if(!1===u||o.type!==e.ERROR&&!O(u))return a("invalid payload");o.data=u}return n("decoded %s as %j",t,o),o}(t),e.BINARY_EVENT===r.type||e.BINARY_ACK===r.type?(this.reconstructor=new c(r),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",r)):this.emit("decoded",r);else{if(!P(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(r=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,this.emit("decoded",r))}},s.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},c.prototype.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var e=L(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null},c.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}}),H=(M.protocol,M.types,M.CONNECT,M.DISCONNECT,M.EVENT,M.ACK,M.ERROR,M.BINARY_EVENT,M.BINARY_ACK,M.Encoder,M.Decoder,f(function(t){try{t.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){t.exports=!1}})),Y=function(t){var e=t.xdomain,n=t.xscheme,r=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!e||H))return new XMLHttpRequest}catch(t){}try{if("undefined"!=typeof XDomainRequest&&!n&&r)return new XDomainRequest}catch(t){}if(!e)try{return new(self[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}},V=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e},W=Object.prototype.toString,z="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===W.call(Blob),X="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===W.call(File),J=function t(e){if(!e||"object"!=typeof e)return!1;if(O(e)){for(var n=0,r=e.length;n<r;n++)if(t(e[n]))return!0;return!1}if("function"==typeof o&&o.isBuffer&&o.isBuffer(e)||"function"==typeof ArrayBuffer&&e instanceof ArrayBuffer||z&&e instanceof Blob||X&&e instanceof File)return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return t(e.toJSON(),!0);for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t(e[i]))return!0;return!1};var G=function(t,e,n){var r=t.byteLength;if(e=e||0,n=n||r,t.slice)return t.slice(e,n);if(e<0&&(e+=r),n<0&&(n+=r),n>r&&(n=r),e>=r||e>=n||0===r)return new ArrayBuffer(0);for(var o=new Uint8Array(t),i=new Uint8Array(n-e),s=e,c=0;s<n;s++,c++)i[c]=o[s];return i.buffer},K=function(t,e,n){var r=!1;return n=n||$,o.count=t,0===t?e():o;function o(t,i){if(o.count<=0)throw new Error("after called too many times");--o.count,t?(r=!0,e(t),e=n):0!==o.count||r||e(null,i)}};function $(){}var Q,Z,tt,et=String.fromCharCode;function nt(t){for(var e,n,r=[],o=0,i=t.length;o<i;)(e=t.charCodeAt(o++))>=55296&&e<=56319&&o<i?56320==(64512&(n=t.charCodeAt(o++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),o--):r.push(e);return r}function rt(t,e){if(t>=55296&&t<=57343){if(e)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function ot(t,e){return et(t>>e&63|128)}function it(t,e){if(0==(4294967168&t))return et(t);var n="";return 0==(4294965248&t)?n=et(t>>6&31|192):0==(4294901760&t)?(rt(t,e)||(t=65533),n=et(t>>12&15|224),n+=ot(t,6)):0==(4292870144&t)&&(n=et(t>>18&7|240),n+=ot(t,12),n+=ot(t,6)),n+et(63&t|128)}function st(){if(tt>=Z)throw Error("Invalid byte index");var t=255&Q[tt];if(tt++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function ct(t){var e,n;if(tt>Z)throw Error("Invalid byte index");if(tt==Z)return!1;if(e=255&Q[tt],tt++,0==(128&e))return e;if(192==(224&e)){if((n=(31&e)<<6|st())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&e)){if((n=(15&e)<<12|st()<<6|st())>=2048)return rt(n,t)?n:65533;throw Error("Invalid continuation byte")}if(240==(248&e)&&(n=(7&e)<<18|st()<<12|st()<<6|st())>=65536&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}var at={version:"2.1.2",encode:function(t,e){for(var n=!1!==(e=e||{}).strict,r=nt(t),o=r.length,i=-1,s="";++i<o;)s+=it(r[i],n);return s},decode:function(t,e){var n=!1!==(e=e||{}).strict;Q=nt(t),Z=Q.length,tt=0;for(var r,o=[];!1!==(r=ct(n));)o.push(r);return function(t){for(var e,n=t.length,r=-1,o="";++r<n;)(e=t[r])>65535&&(o+=et((e-=65536)>>>10&1023|55296),e=56320|1023&e),o+=et(e);return o}(o)}},ut=f(function(t,e){!function(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(256),r=0;r<t.length;r++)n[t.charCodeAt(r)]=r;e.encode=function(e){var n,r=new Uint8Array(e),o=r.length,i="";for(n=0;n<o;n+=3)i+=t[r[n]>>2],i+=t[(3&r[n])<<4|r[n+1]>>4],i+=t[(15&r[n+1])<<2|r[n+2]>>6],i+=t[63&r[n+2]];return o%3==2?i=i.substring(0,i.length-1)+"=":o%3==1&&(i=i.substring(0,i.length-2)+"=="),i},e.decode=function(t){var e,r,o,i,s,c=.75*t.length,a=t.length,u=0;"="===t[t.length-1]&&(c--,"="===t[t.length-2]&&c--);var h=new ArrayBuffer(c),p=new Uint8Array(h);for(e=0;e<a;e+=4)r=n[t.charCodeAt(e)],o=n[t.charCodeAt(e+1)],i=n[t.charCodeAt(e+2)],s=n[t.charCodeAt(e+3)],p[u++]=r<<2|o>>4,p[u++]=(15&o)<<4|i>>2,p[u++]=(3&i)<<6|63&s;return h}}()}),ht=(ut.encode,ut.decode,void 0!==ht?ht:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder),pt=function(){try{return 2===new Blob(["hi"]).size}catch(t){return!1}}(),lt=pt&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(t){return!1}}(),ft=ht&&ht.prototype.append&&ht.prototype.getBlob;function dt(t){return t.map(function(t){if(t.buffer instanceof ArrayBuffer){var e=t.buffer;if(t.byteLength!==e.byteLength){var n=new Uint8Array(t.byteLength);n.set(new Uint8Array(e,t.byteOffset,t.byteLength)),e=n.buffer}return e}return t})}function yt(t,e){e=e||{};var n=new ht;return dt(t).forEach(function(t){n.append(t)}),e.type?n.getBlob(e.type):n.getBlob()}function vt(t,e){return new Blob(dt(t),e||{})}"undefined"!=typeof Blob&&(yt.prototype=Blob.prototype,vt.prototype=Blob.prototype);var bt=pt?lt?Blob:vt:ft?yt:void 0,mt=f(function(t,e){var n;"undefined"!=typeof ArrayBuffer&&(n=ut);var r="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),o="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),i=r||o;e.protocol=3;var s=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},c=V(s),a={type:"error",data:"parser error"};function u(t,e,n){for(var r=new Array(t.length),o=K(t.length,n),i=function(t,n,o){e(n,function(e,n){r[t]=n,o(e,r)})},s=0;s<t.length;s++)i(s,t[s],o)}e.encodePacket=function(t,n,r,o){"function"==typeof n&&(o=n,n=!1),"function"==typeof r&&(o=r,r=null);var c=void 0===t.data?void 0:t.data.buffer||t.data;if("undefined"!=typeof ArrayBuffer&&c instanceof ArrayBuffer)return function(t,n,r){if(!n)return e.encodeBase64Packet(t,r);var o=t.data,i=new Uint8Array(o),c=new Uint8Array(1+o.byteLength);c[0]=s[t.type];for(var a=0;a<i.length;a++)c[a+1]=i[a];return r(c.buffer)}(t,n,o);if(void 0!==bt&&c instanceof bt)return function(t,n,r){if(!n)return e.encodeBase64Packet(t,r);if(i)return function(t,n,r){if(!n)return e.encodeBase64Packet(t,r);var o=new FileReader;return o.onload=function(){e.encodePacket({type:t.type,data:o.result},n,!0,r)},o.readAsArrayBuffer(t.data)}(t,n,r);var o=new Uint8Array(1);return o[0]=s[t.type],r(new bt([o.buffer,t.data]))}(t,n,o);if(c&&c.base64)return function(t,n){return o("b"+e.packets[t.type]+t.data.data)}(t);var a=s[t.type];return void 0!==t.data&&(a+=r?at.encode(String(t.data),{strict:!1}):String(t.data)),o(""+a)},e.encodeBase64Packet=function(t,n){var r,o="b"+e.packets[t.type];if(void 0!==bt&&t.data instanceof bt){var i=new FileReader;return i.onload=function(){var t=i.result.split(",")[1];n(o+t)},i.readAsDataURL(t.data)}try{r=String.fromCharCode.apply(null,new Uint8Array(t.data))}catch(e){for(var s=new Uint8Array(t.data),c=new Array(s.length),a=0;a<s.length;a++)c[a]=s[a];r=String.fromCharCode.apply(null,c)}return o+=btoa(r),n(o)},e.decodePacket=function(t,n,r){if(void 0===t)return a;if("string"==typeof t){if("b"===t.charAt(0))return e.decodeBase64Packet(t.substr(1),n);if(r&&!1===(t=function(t){try{t=at.decode(t,{strict:!1})}catch(t){return!1}return t}(t)))return a;var o=t.charAt(0);return Number(o)==o&&c[o]?t.length>1?{type:c[o],data:t.substring(1)}:{type:c[o]}:a}o=new Uint8Array(t)[0];var i=G(t,1);return bt&&"blob"===n&&(i=new bt([i])),{type:c[o],data:i}},e.decodeBase64Packet=function(t,e){var r=c[t.charAt(0)];if(!n)return{type:r,data:{base64:!0,data:t.substr(1)}};var o=n.decode(t.substr(1));return"blob"===e&&bt&&(o=new bt([o])),{type:r,data:o}},e.encodePayload=function(t,n,r){"function"==typeof n&&(r=n,n=null);var o=J(t);return n&&o?bt&&!i?e.encodePayloadAsBlob(t,r):e.encodePayloadAsArrayBuffer(t,r):t.length?void u(t,function(t,r){e.encodePacket(t,!!o&&n,!1,function(t){r(null,function(t){return t.length+":"+t}(t))})},function(t,e){return r(e.join(""))}):r("0:")},e.decodePayload=function(t,n,r){if("string"!=typeof t)return e.decodePayloadAsBinary(t,n,r);var o;if("function"==typeof n&&(r=n,n=null),""===t)return r(a,0,1);for(var i,s,c="",u=0,h=t.length;u<h;u++){var p=t.charAt(u);if(":"===p){if(""===c||c!=(i=Number(c)))return r(a,0,1);if(c!=(s=t.substr(u+1,i)).length)return r(a,0,1);if(s.length){if(o=e.decodePacket(s,n,!1),a.type===o.type&&a.data===o.data)return r(a,0,1);if(!1===r(o,u+i,h))return}u+=i,c=""}else c+=p}return""!==c?r(a,0,1):void 0},e.encodePayloadAsArrayBuffer=function(t,n){if(!t.length)return n(new ArrayBuffer(0));u(t,function(t,n){e.encodePacket(t,!0,!0,function(t){return n(null,t)})},function(t,e){var r=e.reduce(function(t,e){var n;return t+(n="string"==typeof e?e.length:e.byteLength).toString().length+n+2},0),o=new Uint8Array(r),i=0;return e.forEach(function(t){var e="string"==typeof t,n=t;if(e){for(var r=new Uint8Array(t.length),s=0;s<t.length;s++)r[s]=t.charCodeAt(s);n=r.buffer}o[i++]=e?0:1;var c=n.byteLength.toString();for(s=0;s<c.length;s++)o[i++]=parseInt(c[s]);for(o[i++]=255,r=new Uint8Array(n),s=0;s<r.length;s++)o[i++]=r[s]}),n(o.buffer)})},e.encodePayloadAsBlob=function(t,n){u(t,function(t,n){e.encodePacket(t,!0,!0,function(t){var e=new Uint8Array(1);if(e[0]=1,"string"==typeof t){for(var r=new Uint8Array(t.length),o=0;o<t.length;o++)r[o]=t.charCodeAt(o);t=r.buffer,e[0]=0}var i=(t instanceof ArrayBuffer?t.byteLength:t.size).toString(),s=new Uint8Array(i.length+1);for(o=0;o<i.length;o++)s[o]=parseInt(i[o]);if(s[i.length]=255,bt){var c=new bt([e.buffer,s.buffer,t]);n(null,c)}})},function(t,e){return n(new bt(e))})},e.decodePayloadAsBinary=function(t,n,r){"function"==typeof n&&(r=n,n=null);for(var o=t,i=[];o.byteLength>0;){for(var s=new Uint8Array(o),c=0===s[0],u="",h=1;255!==s[h];h++){if(u.length>310)return r(a,0,1);u+=s[h]}o=G(o,2+u.length),u=parseInt(u);var p=G(o,0,u);if(c)try{p=String.fromCharCode.apply(null,new Uint8Array(p))}catch(t){var l=new Uint8Array(p);for(p="",h=0;h<l.length;h++)p+=String.fromCharCode(l[h])}i.push(p),o=G(o,u)}var f=i.length;i.forEach(function(t,o){r(e.decodePacket(t,n,!0),o,f)})}}),gt=(mt.protocol,mt.packets,mt.encodePacket,mt.encodeBase64Packet,mt.decodePacket,mt.decodeBase64Packet,mt.encodePayload,mt.decodePayload,mt.encodePayloadAsArrayBuffer,mt.encodePayloadAsBlob,mt.decodePayloadAsBinary,wt);function wt(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.forceNode=t.forceNode,this.isReactNative=t.isReactNative,this.extraHeaders=t.extraHeaders,this.localAddress=t.localAddress}A(wt.prototype),wt.prototype.onError=function(t,e){var n=new Error(t);return n.type="TransportError",n.description=e,this.emit("error",n),this},wt.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},wt.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},wt.prototype.send=function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)},wt.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},wt.prototype.onData=function(t){var e=mt.decodePacket(t,this.socket.binaryType);this.onPacket(e)},wt.prototype.onPacket=function(t){this.emit("packet",t)},wt.prototype.onClose=function(){this.readyState="closed",this.emit("close")};var Ct,_t={encode:function(t){var e="";for(var n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e},decode:function(t){for(var e={},n=t.split("&"),r=0,o=n.length;r<o;r++){var i=n[r].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}},xt=function(t,e){var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t},Et="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),kt=64,St={},Nt=0,At=0;function Tt(t){var e="";do{e=Et[t%kt]+e,t=Math.floor(t/kt)}while(t>0);return e}function Ot(){var t=Tt(+new Date);return t!==Ct?(Nt=0,Ct=t):t+"."+Tt(Nt++)}for(;At<kt;At++)St[Et[At]]=At;Ot.encode=Tt,Ot.decode=function(t){var e=0;for(At=0;At<t.length;At++)e=e*kt+St[t.charAt(At)];return e};var Pt=Ot,Bt=k("engine.io-client:polling"),Rt=It,Dt=null!=new Y({xdomain:!1}).responseType;function It(t){Dt&&!(t&&t.forceBase64)||(this.supportsBinary=!1),gt.call(this,t)}xt(It,gt),It.prototype.name="polling",It.prototype.doOpen=function(){this.poll()},It.prototype.pause=function(t){var e=this;function n(){Bt("paused"),e.readyState="paused",t()}if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(Bt("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){Bt("pre-pause polling complete"),--r||n()})),this.writable||(Bt("we are currently writing - waiting to pause"),r++,this.once("drain",function(){Bt("pre-pause writing complete"),--r||n()}))}else n()},It.prototype.poll=function(){Bt("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},It.prototype.onData=function(t){var e=this;Bt("polling got data %s",t),mt.decodePayload(t,this.socket.binaryType,function(t,n,r){if("opening"===e.readyState&&e.onOpen(),"close"===t.type)return e.onClose(),!1;e.onPacket(t)}),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():Bt('ignoring poll - transport state "%s"',this.readyState))},It.prototype.doClose=function(){var t=this;function e(){Bt("writing close packet"),t.write([{type:"close"}])}"open"===this.readyState?(Bt("transport open - closing"),e()):(Bt("transport not open - deferring close"),this.once("open",e))},It.prototype.write=function(t){var e=this;this.writable=!1;var n=function(){e.writable=!0,e.emit("drain")};mt.encodePayload(t,this.supportsBinary,function(t){e.doWrite(t,n)})},It.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(t[this.timestampParam]=Pt()),this.supportsBinary||t.sid||(t.b64=1),t=_t.encode(t),this.port&&("https"===e&&443!==Number(this.port)||"http"===e&&80!==Number(this.port))&&(n=":"+this.port),t.length&&(t="?"+t),e+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+t};var jt=k("engine.io-client:polling-xhr"),Ft=Ut,qt=Mt;function Lt(){}function Ut(t){if(Rt.call(this,t),this.requestTimeout=t.requestTimeout,this.extraHeaders=t.extraHeaders,"undefined"!=typeof location){var e="https:"===location.protocol,n=location.port;n||(n=e?443:80),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||n!==t.port,this.xs=t.secure!==e}}function Mt(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,this.xs=!!t.xs,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.agent=t.agent,this.isBinary=t.isBinary,this.supportsBinary=t.supportsBinary,this.enablesXDR=t.enablesXDR,this.requestTimeout=t.requestTimeout,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.extraHeaders=t.extraHeaders,this.create()}if(xt(Ut,Rt),Ut.prototype.supportsBinary=!0,Ut.prototype.request=function(t){return(t=t||{}).uri=this.uri(),t.xd=this.xd,t.xs=this.xs,t.agent=this.agent||!1,t.supportsBinary=this.supportsBinary,t.enablesXDR=this.enablesXDR,t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,t.requestTimeout=this.requestTimeout,t.extraHeaders=this.extraHeaders,new Mt(t)},Ut.prototype.doWrite=function(t,e){var n=this.request({method:"POST",data:t,isBinary:"string"!=typeof t&&void 0!==t}),r=this;n.on("success",e),n.on("error",function(t){r.onError("xhr post error",t)}),this.sendXhr=n},Ut.prototype.doPoll=function(){jt("xhr poll");var t=this.request(),e=this;t.on("data",function(t){e.onData(t)}),t.on("error",function(t){e.onError("xhr poll error",t)}),this.pollXhr=t},A(Mt.prototype),Mt.prototype.create=function(){var t={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized;var e=this.xhr=new Y(t),n=this;try{jt("xhr open %s: %s",this.method,this.uri),e.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var r in e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(r)&&e.setRequestHeader(r,this.extraHeaders[r])}catch(t){}if("POST"===this.method)try{e.setRequestHeader("Content-type",this.isBinary?"application/octet-stream":"text/plain;charset=UTF-8")}catch(t){}try{e.setRequestHeader("Accept","*/*")}catch(t){}"withCredentials"in e&&(e.withCredentials=!0),this.requestTimeout&&(e.timeout=this.requestTimeout),this.hasXDR()?(e.onload=function(){n.onLoad()},e.onerror=function(){n.onError(e.responseText)}):e.onreadystatechange=function(){if(2===e.readyState)try{var t=e.getResponseHeader("Content-Type");n.supportsBinary&&"application/octet-stream"===t&&(e.responseType="arraybuffer")}catch(t){}4===e.readyState&&(200===e.status||1223===e.status?n.onLoad():setTimeout(function(){n.onError(e.status)},0))},jt("xhr data %s",this.data),e.send(this.data)}catch(t){return void setTimeout(function(){n.onError(t)},0)}"undefined"!=typeof document&&(this.index=Mt.requestsCount++,Mt.requests[this.index]=this)},Mt.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},Mt.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},Mt.prototype.onError=function(t){this.emit("error",t),this.cleanup(!0)},Mt.prototype.cleanup=function(t){if(null!=this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=Lt:this.xhr.onreadystatechange=Lt,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete Mt.requests[this.index],this.xhr=null}},Mt.prototype.onLoad=function(){var t;try{var e;try{e=this.xhr.getResponseHeader("Content-Type")}catch(t){}t="application/octet-stream"===e&&this.xhr.response||this.xhr.responseText}catch(t){this.onError(t)}null!=t&&this.onData(t)},Mt.prototype.hasXDR=function(){return"undefined"!=typeof XDomainRequest&&!this.xs&&this.enablesXDR},Mt.prototype.abort=function(){this.cleanup()},Mt.requestsCount=0,Mt.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",Yt);else if("function"==typeof addEventListener){var Ht="onpagehide"in self?"pagehide":"unload";addEventListener(Ht,Yt,!1)}function Yt(){for(var t in Mt.requests)Mt.requests.hasOwnProperty(t)&&Mt.requests[t].abort()}Ft.Request=qt;var Vt,Wt=Gt,zt=/\n/g,Xt=/\\n/g;function Jt(){}function Gt(t){if(Rt.call(this,t),this.query=this.query||{},!Vt){var e="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==l?l:{};Vt=e.___eio=e.___eio||[]}this.index=Vt.length;var n=this;Vt.push(function(t){n.onData(t)}),this.query.j=this.index,"function"==typeof addEventListener&&addEventListener("beforeunload",function(){n.script&&(n.script.onerror=Jt)},!1)}xt(Gt,Rt),Gt.prototype.supportsBinary=!1,Gt.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),Rt.prototype.doClose.call(this)},Gt.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(e,n):(document.head||document.body).appendChild(e),this.script=e,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout(function(){var t=document.createElement("iframe");document.body.appendChild(t),document.body.removeChild(t)},100)},Gt.prototype.doWrite=function(t,e){var n=this;if(!this.form){var r,o=document.createElement("form"),i=document.createElement("textarea"),s=this.iframeId="eio_iframe_"+this.index;o.className="socketio",o.style.position="absolute",o.style.top="-1000px",o.style.left="-1000px",o.target=s,o.method="POST",o.setAttribute("accept-charset","utf-8"),i.name="d",o.appendChild(i),document.body.appendChild(o),this.form=o,this.area=i}function c(){a(),e()}function a(){if(n.iframe)try{n.form.removeChild(n.iframe)}catch(t){n.onError("jsonp polling iframe removal error",t)}try{r=document.createElement('<iframe src="javascript:0" name="'+n.iframeId+'">')}catch(t){(r=document.createElement("iframe")).name=n.iframeId,r.src="javascript:0"}r.id=n.iframeId,n.form.appendChild(r),n.iframe=r}this.form.action=this.uri(),a(),t=t.replace(Xt,"\\\n"),this.area.value=t.replace(zt,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===n.iframe.readyState&&c()}:this.iframe.onload=c};var Kt,$t,Qt=k("engine.io-client:websocket");if("undefined"!=typeof WebSocket)Kt=WebSocket;else if("undefined"!=typeof self)Kt=self.WebSocket||self.MozWebSocket;else try{$t={}}catch(u){}var Zt=Kt||$t,te=ee;function ee(t){t&&t.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=Kt&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(Zt=$t),gt.call(this,t)}xt(ee,gt),ee.prototype.name="websocket",ee.prototype.supportsBinary=!0,ee.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e=this.protocols,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(n.headers=this.extraHeaders),this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?e?new Zt(t,e):new Zt(t):new Zt(t,e,n)}catch(t){return this.emit("error",t)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},ee.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},ee.prototype.write=function(t){var e=this;this.writable=!1;for(var n=t.length,r=0,i=n;r<i;r++)!function(t){mt.encodePacket(t,e.supportsBinary,function(r){if(!e.usingBrowserWebSocket){var i={};t.options&&(i.compress=t.options.compress),e.perMessageDeflate&&("string"==typeof r?o.byteLength(r):r.length)<e.perMessageDeflate.threshold&&(i.compress=!1)}try{e.usingBrowserWebSocket?e.ws.send(r):e.ws.send(r,i)}catch(t){Qt("websocket closed before onclose event")}--n||(e.emit("flush"),setTimeout(function(){e.writable=!0,e.emit("drain")},0))})}(t[r])},ee.prototype.onClose=function(){gt.prototype.onClose.call(this)},ee.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},ee.prototype.uri=function(){var t=this.query||{},e=this.secure?"wss":"ws",n="";return this.port&&("wss"===e&&443!==Number(this.port)||"ws"===e&&80!==Number(this.port))&&(n=":"+this.port),this.timestampRequests&&(t[this.timestampParam]=Pt()),this.supportsBinary||(t.b64=1),(t=_t.encode(t)).length&&(t="?"+t),e+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+t},ee.prototype.check=function(){return!(!Zt||"__initialize"in Zt&&this.name===ee.prototype.name)};var ne={polling:function(t){var e=!1,n=!1,r=!1!==t.jsonp;if("undefined"!=typeof location){var o="https:"===location.protocol,i=location.port;i||(i=o?443:80),e=t.hostname!==location.hostname||i!==t.port,n=t.secure!==o}if(t.xdomain=e,t.xscheme=n,"open"in new Y(t)&&!t.forceJSONP)return new Ft(t);if(!r)throw new Error("JSONP disabled");return new Wt(t)},websocket:te},re=[].indexOf,oe=function(t,e){if(re)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1},ie=k("engine.io-client:socket"),se=ce;function ce(t,e){if(!(this instanceof ce))return new ce(t,e);e=e||{},t&&"object"==typeof t&&(e=t,t=null),t?(t=v(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=v(e.host).host),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.agent=e.agent||!1,this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?443:80),this.query=e.query||{},"string"==typeof this.query&&(this.query=_t.decode(this.query)),this.upgrade=!1!==e.upgrade,this.path=(e.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!e.forceJSONP,this.jsonp=!1!==e.jsonp,this.forceBase64=!!e.forceBase64,this.enablesXDR=!!e.enablesXDR,this.timestampParam=e.timestampParam||"t",this.timestampRequests=e.timestampRequests,this.transports=e.transports||["polling","websocket"],this.transportOptions=e.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=e.policyPort||843,this.rememberUpgrade=e.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=e.onlyBinaryUpgrades,this.perMessageDeflate=!1!==e.perMessageDeflate&&(e.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=e.pfx||null,this.key=e.key||null,this.passphrase=e.passphrase||null,this.cert=e.cert||null,this.ca=e.ca||null,this.ciphers=e.ciphers||null,this.rejectUnauthorized=void 0===e.rejectUnauthorized||e.rejectUnauthorized,this.forceNode=!!e.forceNode,this.isReactNative="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),("undefined"==typeof self||this.isReactNative)&&(e.extraHeaders&&Object.keys(e.extraHeaders).length>0&&(this.extraHeaders=e.extraHeaders),e.localAddress&&(this.localAddress=e.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}ce.priorWebsocketSuccess=!1,A(ce.prototype),ce.protocol=mt.protocol,ce.Socket=ce,ce.Transport=gt,ce.transports=ne,ce.parser=mt,ce.prototype.createTransport=function(t){ie('creating transport "%s"',t);var e=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}(this.query);e.EIO=mt.protocol,e.transport=t;var n=this.transportOptions[t]||{};return this.id&&(e.sid=this.id),new ne[t]({query:e,socket:this,agent:n.agent||this.agent,hostname:n.hostname||this.hostname,port:n.port||this.port,secure:n.secure||this.secure,path:n.path||this.path,forceJSONP:n.forceJSONP||this.forceJSONP,jsonp:n.jsonp||this.jsonp,forceBase64:n.forceBase64||this.forceBase64,enablesXDR:n.enablesXDR||this.enablesXDR,timestampRequests:n.timestampRequests||this.timestampRequests,timestampParam:n.timestampParam||this.timestampParam,policyPort:n.policyPort||this.policyPort,pfx:n.pfx||this.pfx,key:n.key||this.key,passphrase:n.passphrase||this.passphrase,cert:n.cert||this.cert,ca:n.ca||this.ca,ciphers:n.ciphers||this.ciphers,rejectUnauthorized:n.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:n.perMessageDeflate||this.perMessageDeflate,extraHeaders:n.extraHeaders||this.extraHeaders,forceNode:n.forceNode||this.forceNode,localAddress:n.localAddress||this.localAddress,requestTimeout:n.requestTimeout||this.requestTimeout,protocols:n.protocols||void 0,isReactNative:this.isReactNative})},ce.prototype.open=function(){var t;if(this.rememberUpgrade&&ce.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length){var e=this;return void setTimeout(function(){e.emit("error","No transports available")},0)}t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)},ce.prototype.setTransport=function(t){ie("setting transport %s",t.name);var e=this;this.transport&&(ie("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(t){e.onPacket(t)}).on("error",function(t){e.onError(t)}).on("close",function(){e.onClose("transport close")})},ce.prototype.probe=function(t){ie('probing transport "%s"',t);var e=this.createTransport(t,{probe:1}),n=!1,r=this;function o(){r.onlyBinaryUpgrades&&(n=n||!this.supportsBinary&&r.transport.supportsBinary),n||(ie('probe transport "%s" opened',t),e.send([{type:"ping",data:"probe"}]),e.once("packet",function(o){if(!n)if("pong"===o.type&&"probe"===o.data){if(ie('probe transport "%s" pong',t),r.upgrading=!0,r.emit("upgrading",e),!e)return;ce.priorWebsocketSuccess="websocket"===e.name,ie('pausing current transport "%s"',r.transport.name),r.transport.pause(function(){n||"closed"!==r.readyState&&(ie("changing transport and sending upgrade packet"),h(),r.setTransport(e),e.send([{type:"upgrade"}]),r.emit("upgrade",e),e=null,r.upgrading=!1,r.flush())})}else{ie('probe transport "%s" failed',t);var i=new Error("probe error");i.transport=e.name,r.emit("upgradeError",i)}}))}function i(){n||(n=!0,h(),e.close(),e=null)}function s(n){var o=new Error("probe error: "+n);o.transport=e.name,i(),ie('probe transport "%s" failed because of error: %s',t,n),r.emit("upgradeError",o)}function c(){s("transport closed")}function a(){s("socket closed")}function u(t){e&&t.name!==e.name&&(ie('"%s" works - aborting "%s"',t.name,e.name),i())}function h(){e.removeListener("open",o),e.removeListener("error",s),e.removeListener("close",c),r.removeListener("close",a),r.removeListener("upgrading",u)}ce.priorWebsocketSuccess=!1,e.once("open",o),e.once("error",s),e.once("close",c),this.once("close",a),this.once("upgrading",u),e.open()},ce.prototype.onOpen=function(){if(ie("socket open"),this.readyState="open",ce.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){ie("starting upgrade probes");for(var t=0,e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])}},ce.prototype.onPacket=function(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(ie('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emit("data",t.data),this.emit("message",t.data)}else ie('packet received with socket readyState "%s"',this.readyState)},ce.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},ce.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout(function(){"closed"!==e.readyState&&e.onClose("ping timeout")},t||e.pingInterval+e.pingTimeout)},ce.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout(function(){ie("writing ping packet - expecting pong within %sms",t.pingTimeout),t.ping(),t.onHeartbeat(t.pingTimeout)},t.pingInterval)},ce.prototype.ping=function(){var t=this;this.sendPacket("ping",function(){t.emit("ping")})},ce.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},ce.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(ie("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},ce.prototype.write=ce.prototype.send=function(t,e,n){return this.sendPacket("message",t,e,n),this},ce.prototype.sendPacket=function(t,e,n,r){if("function"==typeof e&&(r=e,e=void 0),"function"==typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var o={type:t,data:e,options:n};this.emit("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}},ce.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var t=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?r():e()}):this.upgrading?r():e()}function e(){t.onClose("forced close"),ie("socket closing - telling transport to close"),t.transport.close()}function n(){t.removeListener("upgrade",n),t.removeListener("upgradeError",n),e()}function r(){t.once("upgrade",n),t.once("upgradeError",n)}return this},ce.prototype.onError=function(t){ie("socket error %j",t),ce.priorWebsocketSuccess=!1,this.emit("error",t),this.onClose("transport error",t)},ce.prototype.onClose=function(t,e){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(ie('socket close with reason: "%s"',t),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)},ce.prototype.filterUpgrades=function(t){for(var e=[],n=0,r=t.length;n<r;n++)~oe(this.transports,t[n])&&e.push(t[n]);return e};var ae=se,ue=mt;ae.parser=ue;var he=function(t,e){for(var n=[],r=(e=e||0)||0;r<t.length;r++)n[r-e]=t[r];return n};var pe=function(t,e,n){return t.on(e,n),{destroy:function(){t.removeListener(e,n)}}};var le=[].slice,fe=function(t,e){if("string"==typeof e&&(e=t[e]),"function"!=typeof e)throw new Error("bind() requires a function");var n=le.call(arguments,2);return function(){return e.apply(t,n.concat(le.call(arguments)))}},de=f(function(t,e){var n=k("socket.io-client:socket");t.exports=i;var r={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},o=A.prototype.emit;function i(t,e,n){this.io=t,this.nsp=e,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}A(i.prototype),i.prototype.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[pe(t,"open",fe(this,"onopen")),pe(t,"packet",fe(this,"onpacket")),pe(t,"close",fe(this,"onclose"))]}},i.prototype.open=i.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},i.prototype.send=function(){var t=he(arguments);return t.unshift("message"),this.emit.apply(this,t),this},i.prototype.emit=function(t){if(r.hasOwnProperty(t))return o.apply(this,arguments),this;var e=he(arguments),i={type:(void 0!==this.flags.binary?this.flags.binary:J(e))?M.BINARY_EVENT:M.EVENT,data:e,options:{}};return i.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof e[e.length-1]&&(n("emitting packet with ack id %d",this.ids),this.acks[this.ids]=e.pop(),i.id=this.ids++),this.connected?this.packet(i):this.sendBuffer.push(i),this.flags={},this},i.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},i.prototype.onopen=function(){if(n("transport is open - connecting"),"/"!==this.nsp)if(this.query){var t="object"==typeof this.query?_t.encode(this.query):this.query;n("sending connect packet with query %s",t),this.packet({type:M.CONNECT,query:t})}else this.packet({type:M.CONNECT})},i.prototype.onclose=function(t){n("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},i.prototype.onpacket=function(t){if(t.nsp===this.nsp||t.type===M.ERROR&&"/"===t.nsp)switch(t.type){case M.CONNECT:this.onconnect();break;case M.EVENT:case M.BINARY_EVENT:this.onevent(t);break;case M.ACK:case M.BINARY_ACK:this.onack(t);break;case M.DISCONNECT:this.ondisconnect();break;case M.ERROR:this.emit("error",t.data)}},i.prototype.onevent=function(t){var e=t.data||[];n("emitting event %j",e),null!=t.id&&(n("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?o.apply(this,e):this.receiveBuffer.push(e)},i.prototype.ack=function(t){var e=this,r=!1;return function(){if(!r){r=!0;var o=he(arguments);n("sending ack %j",o),e.packet({type:J(o)?M.BINARY_ACK:M.ACK,id:t,data:o})}}},i.prototype.onack=function(t){var e=this.acks[t.id];"function"==typeof e?(n("calling ack %s with %j",t.id,t.data),e.apply(this,t.data),delete this.acks[t.id]):n("bad ack %s",t.id)},i.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},i.prototype.emitBuffered=function(){var t;for(t=0;t<this.receiveBuffer.length;t++)o.apply(this,this.receiveBuffer[t]);for(this.receiveBuffer=[],t=0;t<this.sendBuffer.length;t++)this.packet(this.sendBuffer[t]);this.sendBuffer=[]},i.prototype.ondisconnect=function(){n("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},i.prototype.destroy=function(){if(this.subs){for(var t=0;t<this.subs.length;t++)this.subs[t].destroy();this.subs=null}this.io.destroy(this)},i.prototype.close=i.prototype.disconnect=function(){return this.connected&&(n("performing disconnect (%s)",this.nsp),this.packet({type:M.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},i.prototype.compress=function(t){return this.flags.compress=t,this},i.prototype.binary=function(t){return this.flags.binary=t,this}}),ye=ve;function ve(t){this.ms=(t=t||{}).min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}ve.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return 0|Math.min(t,this.max)},ve.prototype.reset=function(){this.attempts=0},ve.prototype.setMin=function(t){this.ms=t},ve.prototype.setMax=function(t){this.max=t},ve.prototype.setJitter=function(t){this.jitter=t};var be=k("socket.io-client:manager"),me=Object.prototype.hasOwnProperty,ge=we;function we(t,e){if(!(this instanceof we))return new we(t,e);t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.nsps={},this.subs=[],this.opts=e,this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(e.randomizationFactor||.5),this.backoff=new ye({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this.readyState="closed",this.uri=t,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var n=e.parser||M;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this.autoConnect=!1!==e.autoConnect,this.autoConnect&&this.open()}we.prototype.emitAll=function(){for(var t in this.emit.apply(this,arguments),this.nsps)me.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)},we.prototype.updateSocketIds=function(){for(var t in this.nsps)me.call(this.nsps,t)&&(this.nsps[t].id=this.generateId(t))},we.prototype.generateId=function(t){return("/"===t?"":t+"#")+this.engine.id},A(we.prototype),we.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection},we.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts},we.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay},we.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor},we.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax},we.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout},we.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},we.prototype.open=we.prototype.connect=function(t,e){if(be("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;be("opening %s",this.uri),this.engine=ae(this.uri,this.opts);var n=this.engine,r=this;this.readyState="opening",this.skipReconnect=!1;var o=pe(n,"open",function(){r.onopen(),t&&t()}),i=pe(n,"error",function(e){if(be("connect_error"),r.cleanup(),r.readyState="closed",r.emitAll("connect_error",e),t){var n=new Error("Connection error");n.data=e,t(n)}else r.maybeReconnectOnOpen()});if(!1!==this._timeout){var s=this._timeout;be("connect attempt will timeout after %d",s);var c=setTimeout(function(){be("connect attempt timed out after %d",s),o.destroy(),n.close(),n.emit("error","timeout"),r.emitAll("connect_timeout",s)},s);this.subs.push({destroy:function(){clearTimeout(c)}})}return this.subs.push(o),this.subs.push(i),this},we.prototype.onopen=function(){be("open"),this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(pe(t,"data",fe(this,"ondata"))),this.subs.push(pe(t,"ping",fe(this,"onping"))),this.subs.push(pe(t,"pong",fe(this,"onpong"))),this.subs.push(pe(t,"error",fe(this,"onerror"))),this.subs.push(pe(t,"close",fe(this,"onclose"))),this.subs.push(pe(this.decoder,"decoded",fe(this,"ondecoded")))},we.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},we.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},we.prototype.ondata=function(t){this.decoder.add(t)},we.prototype.ondecoded=function(t){this.emit("packet",t)},we.prototype.onerror=function(t){be("error",t),this.emitAll("error",t)},we.prototype.socket=function(t,e){var n=this.nsps[t];if(!n){n=new de(this,t,e),this.nsps[t]=n;var r=this;n.on("connecting",o),n.on("connect",function(){n.id=r.generateId(t)}),this.autoConnect&&o()}function o(){~oe(r.connecting,n)||r.connecting.push(n)}return n},we.prototype.destroy=function(t){var e=oe(this.connecting,t);~e&&this.connecting.splice(e,1),this.connecting.length||this.close()},we.prototype.packet=function(t){be("writing packet %j",t);var e=this;t.query&&0===t.type&&(t.nsp+="?"+t.query),e.encoding?e.packetBuffer.push(t):(e.encoding=!0,this.encoder.encode(t,function(n){for(var r=0;r<n.length;r++)e.engine.write(n[r],t.options);e.encoding=!1,e.processPacketQueue()}))},we.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},we.prototype.cleanup=function(){be("cleanup");for(var t=this.subs.length,e=0;e<t;e++)this.subs.shift().destroy();this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},we.prototype.close=we.prototype.disconnect=function(){be("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},we.prototype.onclose=function(t){be("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},we.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)be("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();be("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var n=setTimeout(function(){t.skipReconnect||(be("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open(function(e){e?(be("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(be("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(n)}})}},we.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)};var Ce=f(function(t,e){var n=k("socket.io-client");t.exports=e=o;var r=e.managers={};function o(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var o,i=N(t),s=i.source,c=i.id;return e.forceNew||e["force new connection"]||!1===e.multiplex||r[c]&&i.path in r[c].nsps?(n("ignoring socket cache for %s",s),o=ge(s,e)):(r[c]||(n("new io instance for %s",s),r[c]=ge(s,e)),o=r[c]),i.query&&!e.query&&(e.query=i.query),o.socket(i.path,e)}e.protocol=M.protocol,e.connect=o,e.Manager=ge,e.Socket=de}),_e=(Ce.managers,Ce.protocol,Ce.connect),xe=(Ce.Manager,Ce.Socket,function(t,e){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)});function Ee(t,e){function n(){this.constructor=t}xe(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function ke(t){return"function"==typeof t}var Se=!1,Ne={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){Se=t},get useDeprecatedSynchronousErrorHandling(){return Se}};function Ae(t){setTimeout(function(){throw t})}var Te={closed:!0,next:function(t){},error:function(t){if(Ne.useDeprecatedSynchronousErrorHandling)throw t;Ae(t)},complete:function(){}},Oe=Array.isArray||function(t){return t&&"number"==typeof t.length};function Pe(t){return null!==t&&"object"==typeof t}function Be(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(t,e){return e+1+") "+t.toString()}).join("\n  "):"",this.name="UnsubscriptionError",this.errors=t,this}Be.prototype=Object.create(Error.prototype);var Re=Be,De=function(){function t(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){var n=this._parent,r=this._parents,o=this._unsubscribe,i=this._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var s=-1,c=r?r.length:0;n;)n.remove(this),n=++s<c&&r[s]||null;if(ke(o))try{o.call(this)}catch(n){e=!0,t=n instanceof Re?Ie(n.errors):[n]}if(Oe(i))for(s=-1,c=i.length;++s<c;){var a=i[s];if(Pe(a))try{a.unsubscribe()}catch(n){e=!0,t=t||[],n instanceof Re?t=t.concat(Ie(n.errors)):t.push(n)}}if(e)throw new Re(t)}},t.prototype.add=function(e){var n=e;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;(n=new t)._subscriptions=[r]}break;default:if(!e)return t.EMPTY;throw new Error("unrecognized teardown "+e+" added to Subscription.")}if(n._addParent(this)){var o=this._subscriptions;o?o.push(n):this._subscriptions=[n]}return n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.prototype._addParent=function(t){var e=this._parent,n=this._parents;return e!==t&&(e?n?-1===n.indexOf(t)&&(n.push(t),!0):(this._parents=[t],!0):(this._parent=t,!0))},t.EMPTY=((e=new t).closed=!0,e),t}();function Ie(t){return t.reduce(function(t,e){return t.concat(e instanceof Re?e.errors:e)},[])}var je="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),Fe=function(t){function e(n,r,o){var i=t.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=Te;break;case 1:if(!n){i.destination=Te;break}if("object"==typeof n){n instanceof e?(i.syncErrorThrowable=n.syncErrorThrowable,i.destination=n,n.add(i)):(i.syncErrorThrowable=!0,i.destination=new qe(i,n));break}default:i.syncErrorThrowable=!0,i.destination=new qe(i,n,r,o)}return i}return Ee(e,t),e.prototype[je]=function(){return this},e.create=function(t,n,r){var o=new e(t,n,r);return o.syncErrorThrowable=!1,o},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parent,e=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=t,this._parents=e,this},e}(De),qe=function(t){function e(e,n,r,o){var i,s=t.call(this)||this;s._parentSubscriber=e;var c=s;return ke(n)?i=n:n&&(i=n.next,r=n.error,o=n.complete,n!==Te&&(ke((c=Object.create(n)).unsubscribe)&&s.add(c.unsubscribe.bind(c)),c.unsubscribe=s.unsubscribe.bind(s))),s._context=c,s._next=i,s._error=r,s._complete=o,s}return Ee(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;Ne.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=Ne.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):Ae(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;Ae(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};Ne.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),Ne.useDeprecatedSynchronousErrorHandling)throw t;Ae(t)}},e.prototype.__tryOrSetError=function(t,e,n){if(!Ne.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return Ne.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(Ae(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(Fe);var Le="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ue(){}var Me=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,o=function(t,e,n){if(t){if(t instanceof Fe)return t;if(t[je])return t[je]()}return t||e||n?new Fe(t,e,n):new Fe(Te)}(t,e,n);if(o.add(r?r.call(o,this.source):this.source||Ne.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),Ne.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){Ne.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){var e=t.destination;if(t.closed||t.isStopped)return!1;t=e&&e instanceof Fe?e:null}return!0}(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=He(e))(function(e,r){var o;o=n.subscribe(function(e){try{t(e)}catch(t){r(t),o&&o.unsubscribe()}},r,e)})},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[Le]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:function(t){return t?1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)}:Ue}(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=He(t))(function(t,n){var r;e.subscribe(function(t){return r=t},function(t){return n(t)},function(){return t(r)})})},t.create=function(e){return new t(e)},t}();function He(t){if(t||(t=Ne.Promise||Promise),!t)throw new Error("no Promise impl found");return t}function Ye(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}Ye.prototype=Object.create(Error.prototype);var Ve=Ye,We=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return Ee(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(De),ze=function(t){function e(e){var n=t.call(this,e)||this;return n.destination=e,n}return Ee(e,t),e}(Fe),Xe=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return Ee(e,t),e.prototype[je]=function(){return new ze(this)},e.prototype.lift=function(t){var e=new Je(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new Ve;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].next(t)},e.prototype.error=function(t){if(this.closed)throw new Ve;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new Ve;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new Ve;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new Ve;return this.hasError?(t.error(this.thrownError),De.EMPTY):this.isStopped?(t.complete(),De.EMPTY):(this.observers.push(t),new We(this,t))},e.prototype.asObservable=function(){var t=new Me;return t.source=this,t},e.create=function(t,e){return new Je(t,e)},e}(Me),Je=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return Ee(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):De.EMPTY},e}(Xe);var Ge=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new Ke(t,n),o=e.subscribe(r);return r.closed||(r.connection=n.connect()),o},t}(),Ke=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return Ee(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},e}(Fe),$e=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return Ee(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new De).add(this.source.subscribe(new Qe(this.getSubject(),this))),t.closed?(this._connection=null,t=De.EMPTY):this._connection=t),t},e.prototype.refCount=function(){return(t=this).lift(new Ge(t));var t},e}(Me).prototype,Qe=($e._subscribe,$e._isComplete,$e.getSubject,$e.connect,$e.refCount,function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return Ee(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(ze)),Ze=(function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}Ee(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null}}(Fe),function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;return s.keySelector=n,s.elementSelector=r,s.durationSelector=o,s.subjectSelector=i,s.groups=null,s.attemptedToUnsubscribe=!1,s.count=0,s}Ee(e,t),e.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(t){return void this.error(t)}this._group(t,e)},e.prototype._group=function(t,e){var n=this.groups;n||(n=this.groups=new Map);var r,o=n.get(e);if(this.elementSelector)try{r=this.elementSelector(t)}catch(t){this.error(t)}else r=t;if(!o){o=this.subjectSelector?this.subjectSelector():new Xe,n.set(e,o);var i=new tn(e,o,this);if(this.destination.next(i),this.durationSelector){var s=void 0;try{s=this.durationSelector(new tn(e,o))}catch(t){return void this.error(t)}this.add(s.subscribe(new Ze(e,o,this)))}}o.closed||o.next(r)},e.prototype._error=function(t){var e=this.groups;e&&(e.forEach(function(e,n){e.error(t)}),e.clear()),this.destination.error(t)},e.prototype._complete=function(){var t=this.groups;t&&(t.forEach(function(t,e){t.complete()}),t.clear()),this.destination.complete()},e.prototype.removeGroup=function(t){this.groups.delete(t)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))}}(Fe),function(t){function e(e,n,r){var o=t.call(this,n)||this;return o.key=e,o.group=n,o.parent=r,o}return Ee(e,t),e.prototype._next=function(t){this.complete()},e.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},e}(Fe)),tn=function(t){function e(e,n,r){var o=t.call(this)||this;return o.key=e,o.groupSubject=n,o.refCountSubscription=r,o}return Ee(e,t),e.prototype._subscribe=function(t){var e=new De,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&e.add(new en(n)),e.add(r.subscribe(t)),e},e}(Me),en=function(t){function e(e){var n=t.call(this)||this;return n.parent=e,e.count++,n}return Ee(e,t),e.prototype.unsubscribe=function(){var e=this.parent;e.closed||this.closed||(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(De),nn=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return Ee(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Ve;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(Xe),rn=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return Ee(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,n){return t.call(this)||this}return Ee(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(De)),on=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Ee(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(rn),sn=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}(),cn=function(t){function e(n,r){void 0===r&&(r=sn.now);var o=t.call(this,n,function(){return e.delegate&&e.delegate!==o?e.delegate.now():r()})||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return Ee(e,t),e.prototype.schedule=function(n,r,o){return void 0===r&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,o):t.prototype.schedule.call(this,n,r,o)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(sn),an=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ee(e,t),e}(cn))(on),un=new Me(function(t){return t.complete()});function hn(t){return t?function(t){return new Me(function(e){return t.schedule(function(){return e.complete()})})}(t):un}var pn,ln=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.closed||e.complete()}};function fn(t,e){return new Me(e?function(n){var r=new De,o=0;return r.add(e.schedule(function(){o!==t.length?(n.next(t[o++]),n.closed||r.add(this.schedule())):n.complete()})),r}:ln(t))}function dn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];switch(function(t){return t&&"function"==typeof t.schedule}(n)?t.pop():n=void 0,t.length){case 0:return hn(n);case 1:return n?fn(t,n):function(t){var e=new Me(function(e){e.next(t),e.complete()});return e._isScalar=!0,e.value=t,e}(t[0]);default:return fn(t,n)}}function yn(t){t.subscriber.error(t.error)}pn||(pn={});var vn=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){switch(this.kind){case"N":return dn(this.value);case"E":return t=this.error,new Me(e?function(n){return e.schedule(yn,0,{error:t,subscriber:n})}:function(e){return e.error(t)});case"C":return hn()}var t,e;throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}(),bn=function(t){function e(e,n,r){void 0===r&&(r=0);var o=t.call(this,e)||this;return o.scheduler=n,o.delay=r,o}return Ee(e,t),e.dispatch=function(t){t.notification.observe(t.destination),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new mn(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(vn.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(vn.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(vn.createComplete()),this.unsubscribe()},e}(Fe),mn=function(t,e){this.notification=t,this.destination=e},gn=(function(t){function e(e,n,r){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var o=t.call(this)||this;return o.scheduler=r,o._events=[],o._infiniteTimeWindow=!1,o._bufferSize=e<1?1:e,o._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(o._infiniteTimeWindow=!0,o.next=o.nextInfiniteTimeWindow):o.next=o.nextTimeWindow,o}Ee(e,t),e.prototype.nextInfiniteTimeWindow=function(e){var n=this._events;n.push(e),n.length>this._bufferSize&&n.shift(),t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this._events.push(new gn(this._getNow(),e)),this._trimBufferThenGetEvents(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),o=this.scheduler,i=r.length;if(this.closed)throw new Ve;if(this.isStopped||this.hasError?e=De.EMPTY:(this.observers.push(t),e=new We(this,t)),o&&t.add(t=new bn(t,o)),n)for(var s=0;s<i&&!t.closed;s++)t.next(r[s]);else for(s=0;s<i&&!t.closed;s++)t.next(r[s].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||an).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,n=this._windowTime,r=this._events,o=r.length,i=0;i<o&&!(t-r[i].time<n);)i++;return o>e&&(i=Math.max(i,o-e)),i>0&&r.splice(0,i),r}}(Xe),function(t,e){this.time=t,this.value=e}),wn=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.value=null,e.hasNext=!1,e.hasCompleted=!1,e}Ee(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),De.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),De.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)}}(Xe),1),Cn={};var _n=function(t){var e=wn++;return Cn[e]=t,Promise.resolve().then(function(){return function(t){var e=Cn[t];e&&e()}(e)}),e},xn=function(t){delete Cn[t]},En=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Ee(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=_n(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(xn(n),e.scheduled=void 0)},e}(rn),kn=(new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ee(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,o=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<o&&(t=n.shift()));if(this.active=!1,e){for(;++r<o&&(t=n.shift());)t.unsubscribe();throw e}},e}(cn))(En),new cn(rn),function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Ee(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(function(){return e.flush(null)})))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(cancelAnimationFrame(n),e.scheduled=void 0)},e}(rn)),Sn=(new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ee(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,o=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<o&&(t=n.shift()));if(this.active=!1,e){for(;++r<o&&(t=n.shift());)t.unsubscribe();throw e}},e}(cn))(kn),function(t){function e(e,n){void 0===e&&(e=Sn),void 0===n&&(n=Number.POSITIVE_INFINITY);var r=t.call(this,e,function(){return r.frame})||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}Ee(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10}(cn),function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var o=t.call(this,e,n)||this;return o.scheduler=e,o.work=n,o.index=r,o.active=!0,o.index=e.index=r,o}return Ee(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var o=new e(this.scheduler,this.work);return this.add(o),o.schedule(n,r)},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var o=t.actions;return o.push(this),o.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,n){void 0===n&&(n=0)},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(rn)),Nn=(function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}Ee(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)}}(Fe),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ee(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(Fe)),An=function(t){function e(e,n,r){var o=t.call(this)||this;return o.parent=e,o.outerValue=n,o.outerIndex=r,o.index=0,o}return Ee(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(Fe);var Tn="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";var On=function(t){if(t instanceof Me)return function(e){return t._isScalar?(e.next(t.value),void e.complete()):t.subscribe(e)};if(t&&"function"==typeof t[Le])return function(t){return function(e){var n=t[Le]();if("function"!=typeof n.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(e)}}(t);if(function(t){return t&&"number"==typeof t.length&&"function"!=typeof t}(t))return ln(t);if(function(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}(t))return function(t){return function(e){return t.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Ae),e}}(t);if(t&&"function"==typeof t[Tn])return function(t){return function(e){for(var n=t[Tn]();;){var r=n.next();if(r.done){e.complete();break}if(e.next(r.value),e.closed)break}return"function"==typeof n.return&&e.add(function(){n.return&&n.return()}),e}}(t);var e=Pe(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function Pn(t,e,n,r,o){if(void 0===o&&(o=new An(t,n,r)),!o.closed)return On(e)(o)}var Bn,Rn={},Dn=(function(t){function e(e,n){var r=t.call(this,e)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}Ee(e,t),e.prototype._next=function(t){this.values.push(Rn),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var n=0;n<e;n++){var r=t[n];this.add(Pn(this,r,r,n))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,n,r,o){var i=this.values,s=this.toRespond?i[n]===Rn?--this.toRespond:this.toRespond:0;i[n]=e,0===s&&(this.resultSelector?this._tryResultSelector(i):this.destination.next(i.slice()))},e.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)}}(Nn),function(t){function e(e,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var o=t.call(this,e)||this;return o.project=n,o.concurrent=r,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}Ee(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=new An(this,void 0,void 0);this.destination.add(r),Pn(this,t,e,n,r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}(Nn),function(t){function e(e,n){var r=t.call(this,e)||this;r.sources=n,r.completed=0,r.haveValues=0;var o=n.length;r.values=new Array(o);for(var i=0;i<o;i++){var s=Pn(r,n[i],null,i);s&&r.add(s)}return r}Ee(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.values[n]=e,o._hasValue||(o._hasValue=!0,this.haveValues++)},e.prototype.notifyComplete=function(t){var e=this.destination,n=this.haveValues,r=this.values,o=r.length;t._hasValue?(this.completed++,this.completed===o&&(n===o&&e.next(r),e.complete())):e.complete()}}(Nn),new Me(Ue),function(t){function e(e){var n=t.call(this,e)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}Ee(e,t),e.prototype._next=function(t){this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var n=0;n<e&&!this.hasFirst;n++){var r=t[n],o=Pn(this,r,r,n);this.subscriptions&&this.subscriptions.push(o),this.add(o)}this.observables=null}},e.prototype.notifyNext=function(t,e,n,r,o){if(!this.hasFirst){this.hasFirst=!0;for(var i=0;i<this.subscriptions.length;i++)if(i!==n){var s=this.subscriptions[i];s.unsubscribe(),this.remove(s)}this.subscriptions=null}this.destination.next(e)}}(Nn),function(t){function e(e,n,r){void 0===r&&(r=Object.create(null));var o=t.call(this,e)||this;return o.iterators=[],o.active=0,o.resultSelector="function"==typeof n?n:null,o.values=r,o}Ee(e,t),e.prototype._next=function(t){var e=this.iterators;Oe(t)?e.push(new In(t)):e.push("function"==typeof t[Tn]?new Dn(t[Tn]()):new jn(this.destination,this,t))},e.prototype._complete=function(){var t=this.iterators,e=t.length;if(this.unsubscribe(),0!==e){this.active=e;for(var n=0;n<e;n++){var r=t[n];r.stillUnsubscribed?this.destination.add(r.subscribe(r,n)):this.active--}}else this.destination.complete()},e.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},e.prototype.checkIterators=function(){for(var t=this.iterators,e=t.length,n=this.destination,r=0;r<e;r++)if("function"==typeof(s=t[r]).hasValue&&!s.hasValue())return;var o=!1,i=[];for(r=0;r<e;r++){var s,c=(s=t[r]).next();if(s.hasCompleted()&&(o=!0),c.done)return void n.complete();i.push(c.value)}this.resultSelector?this._tryresultSelector(i):n.next(i),o&&n.complete()},e.prototype._tryresultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)}}(Fe),function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return t&&t.done},t}()),In=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[Tn]=function(){return this},t.prototype.next=function(t){var e=this.index++;return e<this.length?{value:this.array[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),jn=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.parent=n,o.observable=r,o.stillUnsubscribed=!0,o.buffer=[],o.isComplete=!1,o}return Ee(e,t),e.prototype[Tn]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t,e,n,r,o){this.buffer.push(e),this.parent.checkIterators()},e.prototype.subscribe=function(t,e){return Pn(this,this.observable,this,e)},e}(Nn),Fn={iceServers:[{urls:"turn:api.deckdeckgo.com:3478",username:"user",credential:"deckdeckgo"}]},qn={ordered:!1,maxPacketLifeTime:1e3};!function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED_WITH_SIGNALING_SERVER=2]="CONNECTED_WITH_SIGNALING_SERVER",t[t.CONNECTED=3]="CONNECTED",t[t.NOT_CONNECTED=4]="NOT_CONNECTED"}(Bn||(Bn={}));var Ln=window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection||window.msRTCPeerConnection,Un=window.RTCSessionDescription||window.mozRTCSessionDescription||window.webkitRTCSessionDescription||window.msRTCSessionDescription,Mn=function(){function t(){var t=this;this.state=new nn(Bn.DISCONNECTED),this.event=new Xe,this.dataChannelStateChanged=function(){"open"===t.dataChannelOut.readyState&&(t.dataChannelOut.onmessage=t.receiveDataChannelMessage,t.state.next(Bn.CONNECTED))},this.receiveDataChannelMessage=function(e){if(e){var n=JSON.parse(e.data);t.event.next(n)}}}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.connect=function(){var t=this;return new Promise(function(e){return h.a(t,void 0,void 0,function(){var t,n=this;return h.b(this,function(r){return this.room?(t=this.serverUrl?this.serverUrl:"https://api.deckdeckgo.com",this.state.next(Bn.CONNECTING),this.socket=_e(t,{transports:["websocket","xhr-polling"],query:"type=app"}),this.socket.on("connect",function(){return h.a(n,void 0,void 0,function(){return h.b(this,function(t){return this.socket.emit("join",{room:this.room,deck:!0}),[2]})})}),this.socket.on("joined",function(){return h.a(n,void 0,void 0,function(){return h.b(this,function(t){return this.state.next(Bn.CONNECTED_WITH_SIGNALING_SERVER),[2]})})}),this.socket.on("signaling_message",function(t){return h.a(n,void 0,void 0,function(){var e,n=this;return h.b(this,function(r){switch(r.label){case 0:return this.rtcPeerConn||this.startSignaling(),"app_here"!==t.type?[3,3]:this.rtcPeerConn.currentLocalDescription?[3,2]:[4,this.rtcPeerConn.createOffer().then(function(t){n.sendLocalDesc(t)},function(t){n.state.next(Bn.NOT_CONNECTED)})];case 1:r.sent(),r.label=2;case 2:return[2];case 3:return(e=JSON.parse(t.message)).sdp?(this.rtcPeerConn.setRemoteDescription(new Un(e.sdp)).then(function(){},function(t){n.state.next(Bn.NOT_CONNECTED)}),[3,6]):[3,4];case 4:return[4,this.rtcPeerConn.addIceCandidate(new RTCIceCandidate(e.candidate))];case 5:r.sent(),r.label=6;case 6:return[2]}})})}),this.socket.on("connect_error",function(){n.state.next(Bn.NOT_CONNECTED)}),this.socket.on("connect_timeout",function(){n.state.next(Bn.NOT_CONNECTED)}),this.socket.on("error",function(){n.state.next(Bn.NOT_CONNECTED)}),this.socket.on("reconnect_failed",function(){n.state.next(Bn.NOT_CONNECTED)}),this.socket.on("reconnect_error",function(){n.state.next(Bn.NOT_CONNECTED)}),e(),[2]):(e(),[2])})})})},t.prototype.disconnect=function(){var t=this;return new Promise(function(e){t.dataChannelOut&&t.dataChannelOut.close(),t.rtcPeerConn&&t.rtcPeerConn.close(),t.dataChannelOut=null,t.rtcPeerConn=null,t.socket&&(t.socket.emit("leave",{room:t.room}),t.socket.removeAllListeners(),t.socket.disconnect()),t.state.next(Bn.DISCONNECTED),e()})},t.prototype.watchState=function(){return this.state.asObservable()},t.prototype.watchEvent=function(){return this.event.asObservable()},t.prototype.startSignaling=function(){var t=this;this.rtcPeerConn=new Ln(Fn),this.dataChannelOut=this.rtcPeerConn.createDataChannel("deckgo_"+this.room,qn),this.dataChannelOut.onopen=this.dataChannelStateChanged,this.rtcPeerConn.onicecandidate=function(e){e.candidate&&t.socket.emit("signal",{type:"ice_candidate",message:JSON.stringify({candidate:e.candidate}),room:t.room})}},t.prototype.sendLocalDesc=function(t){var e=this;this.rtcPeerConn.setLocalDescription(t).then(function(){e.socket.emit("signal",{type:"sending_local_description",message:JSON.stringify({sdp:e.rtcPeerConn.localDescription}),room:e.room})},function(t){e.state.next(Bn.NOT_CONNECTED)})},t.prototype.emit=function(t){this.dataChannelOut&&this.dataChannelOut.send(JSON.stringify(t))},t}(),Hn=function(){function t(t){this.communicationService=t,this.leftOffset=0,this.communicationService=Mn.getInstance()}return t.prototype.componentDidLoad=function(){return h.a(this,void 0,void 0,function(){var t=this;return h.b(this,function(e){switch(e.label){case 0:return this.subscriptionState=this.communicationService.watchState().subscribe(function(e){t.state.emit(e)}),this.subscriptionEvent=this.communicationService.watchEvent().subscribe(function(e){return h.a(t,void 0,void 0,function(){return h.b(this,function(t){switch(t.label){case 0:return e.emitter!==a.APP?[3,11]:e.type!==c.SLIDES_REQUEST?[3,2]:[4,this.answerApp()];case 1:return t.sent(),[3,11];case 2:return e.type!==c.CLEAR_SLIDE?[3,4]:[4,this.clear()];case 3:return t.sent(),[3,11];case 4:return e.type!==c.START_DRAWING?[3,6]:[4,this.startDrawing(e)];case 5:return t.sent(),[3,11];case 6:return e.type!==c.END_DRAWING?[3,8]:[4,this.endDrawing(e)];case 7:return t.sent(),[3,11];case 8:return e.type!==c.DRAW?[3,10]:[4,this.draw(e)];case 9:return t.sent(),[3,11];case 10:this.event.emit(e),t.label=11;case 11:return[2]}})})}),[4,this.initConnect()];case 1:return e.sent(),this.initCanvasWidth(),[4,this.initContext()];case 2:return e.sent(),[2]}})})},t.prototype.initCanvasWidth=function(){this.width&&this.length&&(this.canvasWidth=this.width*this.length)},t.prototype.componentDidUnload=function(){return h.a(this,void 0,void 0,function(){return h.b(this,function(t){switch(t.label){case 0:return[4,this.communicationService.disconnect()];case 1:return t.sent(),this.subscriptionState&&this.subscriptionState.unsubscribe(),this.subscriptionEvent&&this.subscriptionEvent.unsubscribe(),[2]}})})},t.prototype.initConnect=function(){return h.a(this,void 0,void 0,function(){return h.b(this,function(t){switch(t.label){case 0:return[4,this.connect()];case 1:return t.sent(),[2]}})})},t.prototype.connect=function(){var t=this;return new Promise(function(e){return h.a(t,void 0,void 0,function(){return h.b(this,function(t){switch(t.label){case 0:return this.room?(this.communicationService.room=this.room,this.communicationService.serverUrl=this.server,[4,this.communicationService.disconnect()]):(e(),[2]);case 1:return t.sent(),[4,this.communicationService.connect()];case 2:return t.sent(),e(),[2]}})})})},t.prototype.initContext=function(){var t=this;return new Promise(function(e){var n=t.el.shadowRoot.querySelector("canvas");n?(t.ctx=n.getContext("2d"),e()):e()})},t.prototype.setCanvasIndex=function(t){var e=this;return new Promise(function(n){var r=e.el.shadowRoot.querySelector("canvas");r?(r.style.zIndex=""+t,n()):n()})},t.prototype.startDrawing=function(t){var e=this;return new Promise(function(n){return h.a(e,void 0,void 0,function(){return h.b(this,function(e){switch(e.label){case 0:return this.startX=this.interpolateX(t)-this.leftOffset,this.startY=this.interpolateY(t),[4,this.setCanvasIndex(1)];case 1:return e.sent(),n(),[2]}})})})},t.prototype.draw=function(t){var e=this;return new Promise(function(n){e.ctx.beginPath();var r=e.interpolateX(t)-e.leftOffset,o=e.interpolateY(t);t.action===i.CIRCLE?e.drawCircle(r,o):e.drawPencil(r,o),e.ctx.strokeStyle=t.color?t.color:"red",e.ctx.lineWidth=6,e.ctx.stroke(),e.ctx.closePath(),n()})},t.prototype.drawPencil=function(t,e){this.ctx.moveTo(this.startX,this.startY),this.ctx.lineTo(t,e),this.startX=t,this.startY=e},t.prototype.drawCircle=function(t,e){this.ctx.clearRect(-1*this.leftOffset,0,this.width,this.height),this.ctx.moveTo(this.startX,this.startY+(e-this.startY)/2),this.ctx.bezierCurveTo(this.startX,this.startY,t,this.startY,t,this.startY+(e-this.startY)/2),this.ctx.bezierCurveTo(t,e,this.startX,e,this.startX,this.startY+(e-this.startY)/2)},t.prototype.endDrawing=function(t){var e=this;return new Promise(function(t){return h.a(e,void 0,void 0,function(){return h.b(this,function(e){switch(e.label){case 0:return this.startX=null,this.startY=null,[4,this.setCanvasIndex(0)];case 1:return e.sent(),t(),[2]}})})})},t.prototype.interpolateX=function(t){return t.clientX*(this.width/t.windowWidth)},t.prototype.interpolateY=function(t){return t.clientY*(this.height/t.windowHeight)},t.prototype.answerApp=function(){var t=this;return new Promise(function(e){t.communicationService.emit({type:c.SLIDES_ANSWER,emitter:a.DECK,length:t.length,slides:t.slides}),e()})},t.prototype.moveDraw=function(t,e){var n=this;return new Promise(function(r){var o=n.el.shadowRoot.querySelector("canvas");o?(n.leftOffset=t,o.style.setProperty("--left-offset",n.leftOffset+"px"),o.style.setProperty("--left-offset-transition",e),r()):r()})},t.prototype.nextSlide=function(){this.emitSlidePrevNext(c.NEXT_SLIDE)},t.prototype.prevSlide=function(){this.emitSlidePrevNext(c.PREV_SLIDE)},t.prototype.slideTo=function(t,e){return h.a(this,void 0,void 0,function(){return h.b(this,function(n){return this.communicationService.emit({type:c.SLIDE_TO,emitter:a.DECK,index:t,speed:e}),[2]})})},t.prototype.clear=function(){var t=this;return new Promise(function(e){t.ctx.beginPath(),t.ctx.clearRect(-1*t.leftOffset,0,t.width,t.height),t.ctx.stroke(),t.ctx.closePath(),e()})},t.prototype.emitSlidePrevNext=function(t){this.communicationService.emit({type:t,emitter:a.DECK})},t.prototype.render=function(){return Object(p.b)("canvas",{width:this.canvasWidth,height:this.height})},Object.defineProperty(t,"is",{get:function(){return"deckgo-remote"},enumerable:!0,configurable:!0}),Object.defineProperty(t,"encapsulation",{get:function(){return"shadow"},enumerable:!0,configurable:!0}),Object.defineProperty(t,"properties",{get:function(){return{canvasWidth:{state:!0},connect:{method:!0},el:{elementRef:!0},height:{type:Number,attr:"height"},length:{type:Number,attr:"length",watchCallbacks:["initCanvasWidth"]},moveDraw:{method:!0},nextSlide:{method:!0},prevSlide:{method:!0},room:{type:String,attr:"room",watchCallbacks:["initConnect"]},server:{type:String,attr:"server",watchCallbacks:["initConnect"]},slides:{type:"Any",attr:"slides"},slideTo:{method:!0},width:{type:Number,attr:"width",watchCallbacks:["initCanvasWidth"]}}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"events",{get:function(){return[{name:"state",method:"state",bubbles:!0,cancelable:!0,composed:!0},{name:"event",method:"event",bubbles:!0,cancelable:!0,composed:!0}]},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return"canvas{position:fixed;top:0;-webkit-transition-duration:var(--left-offset-transition,0ms);transition-duration:var(--left-offset-transition,0ms);-webkit-transform:translate3d(var(--left-offset,0),0,0);transform:translate3d(var(--left-offset,0),0,0);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-touch-action:none;touch-action:none;pointer-events:none}"},enumerable:!0,configurable:!0}),t}()}.call(this,n(2),n(330),n(331).Buffer)}}]);