UNPKG

smart-house-frontend

Version:
2 lines 112 kB
webpackJsonp([9],{419:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=n(3),s=n(420),a=function(){function e(e){this.devicesService=e}return e.prototype.resolve=function(){return this.devicesService.getSensors()},e=r([i.Injectable(),o("design:paramtypes",["function"==typeof(t="undefined"!=typeof s.DevicesService&&s.DevicesService)&&t||Object])],e);var t}();t.DeviceListResolver=a},420:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=n(3),s=n(67),a=function(){function e(e){this.http=e}return e.prototype.getSensors=function(){return this.http.get("/sensors")},e.prototype.get=function(e){return void 0===e&&(e=""),this.http.get("/sensors/"+e)},e.prototype.save=function(e){return this.http.post("/sensors",e)},e.prototype.update=function(e){return this.http.put("/sensors/"+e._id,e)},e.prototype.delete=function(e){return this.http.delete("/sensors/"+e._id)},e=r([i.Injectable(),o("design:paramtypes",["function"==typeof(t="undefined"!=typeof s.ShHttpService&&s.ShHttpService)&&t||Object])],e);var t}();t.DevicesService=a},434:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=n(3),s=n(29),a=n(389),c=n(387),u=n(435),p=n(438),l=n(442),h=n(420),f=n(419),d=n(445),y=n(499),v=n(504),g=n(507),m=function(){function t(){}return t=r([i.NgModule({id:e.id,imports:[s.RouterModule,a.FormsModule,c.SharedModule],declarations:[l.DeviceWidgetComponent,g.SensorWidgetComponent,v.SwitcherWidgetComponent,y.ServoWidgetComponent,u.DeviceListComponent,p.DeviceComponent],exports:[u.DeviceListComponent,p.DeviceComponent,l.DeviceWidgetComponent],providers:[h.DevicesService,f.DeviceListResolver,d.DeviceWidgetService]}),o("design:paramtypes",[])],t)}();t.DevicesModule=m},435:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=n(3),s=n(29),a=n(420),c=n(398),u=[{topic:"mqttId",name:"ID",sortable:!0},{topic:"type",name:"Type",sortable:!0},{topic:"description",name:"Description",sortable:!0}],p=function(){function e(e,t,n,r){this.devicesService=e,this.dialogService=t,this.viewContainerRef=n,this.router=r,this.editOnItemClick=!0,this.showDeleteButton=!0,this.statisticLink="",this.sortBy="",this.reverse=!1,this._headers=[],this._headers=u}return e.prototype.setSortBy=function(e){var t=this;this.reverse=this.sortBy===e&&!this.reverse,this.sortBy=e,this.deviceList.sort(function(n,r){return n[e]<r[e]?t.reverse?1:-1:n[e]>r[e]?t.reverse?-1:1:0})},e.prototype.isActive=function(e){return e===this.sortBy},e.prototype.getItemEditLink=function(e){return this.editOnItemClick?["./",e]:[]},e.prototype.goToDeviceStatistic=function(e,t,n){n.stopPropagation(),this.router.navigate([this.statisticLink,e,"day",t])},e.prototype.removeSensor=function(e,t){var n=this,r={title:"",message:"Are you sure you want to delete this device?"};t.stopPropagation(),this.dialogService.confirm(this.viewContainerRef,r).filter(function(e){return e}).subscribe(function(){n.devicesService.delete(e).subscribe(function(e){n.deviceList=n.deviceList.filter(function(t){return t._id!==e._id})})})},Object.defineProperty(e.prototype,"headers",{get:function(){return this._headers},enumerable:!0,configurable:!0}),r([i.Input(),o("design:type",Object)],e.prototype,"deviceList",void 0),r([i.Input(),o("design:type",Boolean)],e.prototype,"editOnItemClick",void 0),r([i.Input(),o("design:type",Boolean)],e.prototype,"showDeleteButton",void 0),r([i.Input(),o("design:type",String)],e.prototype,"statisticLink",void 0),e=r([i.Component({selector:"sh-device-list",template:n(436),styles:[n(437)]}),o("design:paramtypes",["function"==typeof(t="undefined"!=typeof a.DevicesService&&a.DevicesService)&&t||Object,"function"==typeof(p="undefined"!=typeof c.DialogService&&c.DialogService)&&p||Object,"function"==typeof(l="undefined"!=typeof i.ViewContainerRef&&i.ViewContainerRef)&&l||Object,"function"==typeof(h="undefined"!=typeof s.Router&&s.Router)&&h||Object])],e);var t,p,l,h}();t.DeviceListComponent=p},436:function(e,t){e.exports='<div *ngIf="deviceList.length === 0" class="empty-list">\n <div class="container empty-list__container">\n <div class="empty-list__container__text">\n <h3 class="empty-list__container__text__main">There are no devices yet</h3>\n <h4 class="empty-list__container__text__additional">Once you connect your device to the system, it will be listed here.</h4>\n </div><!-- empty-list__container__text -->\n </div><!-- empty-list__container -->\n</div><!-- empty-list -->\n\n<div *ngIf="deviceList.length !== 0" class="sensors-list">\n <table class="highlight responsive-table sensors-list-table">\n <thead class="sensors-list-table__head">\n <th *ngFor="let header of headers"\n (click)="setSortBy(header.topic)"\n class="sensors-list-table__head__item"\n [class.active]="isActive(header.topic)"\n [class.sortable]="header.sortable">\n {{ header.name }}\n <div [class]="reverse ? \'up\' : \'down\'"></div>\n </th><!-- sensors-list-table__head__item -->\n </thead><!-- sensors-list-table__head -->\n <tbody class="sensors-list-table__body">\n <tr *ngFor="let item of deviceList"\n [routerLink]="getItemEditLink(item._id)"\n class="sensors-list-table__body__row">\n <td *ngFor="let header of headers"\n class="sensors-list-table__body__row__item">\n {{item[header.topic]}}\n </td><!-- sensors-list-table__body__row__item -->\n <td *ngIf="statisticLink">\n <div class="sensor-widget_statistic-button"\n (click)="goToDeviceStatistic(item.mqttId, item.type, $event)">\n </div>\n </td>\n <td *ngIf="showDeleteButton"\n class="sensors-list-table__body__row__actions">\n <button (click)="removeSensor(item, $event)"\n class="waves-effect waves-light btn sensors-list-table__body__row__actions__remove"\n name="remove-device"\n type="remove">\n <i class="material-icons sensors-list-table__body__row__actions__remove__icon">delete</i>\n </button><!-- sensors-list-table__body__row__actions__remove -->\n </td><!-- sensors-list-table__body__row__actions -->\n </tr><!-- sensors-list-table__body__row -->\n </tbody><!-- sensors-list-table__body -->\n </table><!-- sensors-list-table -->\n</div><!-- sensors-list -->\n'},437:function(e,t){e.exports=".sub-header__actions{vertical-align:middle;line-height:54px}.sensors-list-table__head__item.sortable{cursor:pointer}.sensors-list-table__head__item.sortable.active .up{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid black}.sensors-list-table__head__item.sortable.active .down{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid black}.sensors-list-table__body__row__actions__remove{padding:0 15px}.empty-list__container{padding:0px}.empty-list__container::before{content:'';display:block;background:url(\"./assets/empty-sensors-list.png\") no-repeat;background-size:150px;background-position:calc(100%/2);height:150px;margin:0 6px 0 0}.empty-list__container__text__main{font-family:Roboto-Regular;font-size:24px;text-align:center}.empty-list__container__text__additional{font-family:Roboto-Regular;font-size:15px;text-align:center}.sensor-widget_statistic-button{position:relative;display:block;float:left;cursor:pointer;width:24px;height:26px;margin-top:1px;background-color:#dedede;background-image:url(./assets/statistic.svg)}.sensor-widget_statistic-button:hover{box-shadow:0 2px 4px 0 rgba(0,0,0,0.5)}\n"},438:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=n(3),s=n(439),a=function(){function e(){this.switcher=!1}return e.prototype.switchSensor=function(){this.device.executor=!this.device.executor},e.prototype.switcherImageUrl=function(){return this.device.executor?"url(assets/switcherON.svg)":"url(assets/switcherOFF.svg)"},r([i.Input(),o("design:type","function"==typeof(t="undefined"!=typeof s.Device&&s.Device)&&t||Object)],e.prototype,"device",void 0),e=r([i.Component({selector:"sh-device",template:n(440),styles:[n(441)]}),o("design:paramtypes",[])],e);var t}();t.DeviceComponent=a},439:function(e,t){"use strict";var n=function(){function e(e){void 0===e&&(e={}),Object.assign(this,{mqttId:"",type:"servo",subType:"socket",description:"",executor:!1,sensor:!1},e)}return e}();t.Device=n},440:function(e,t){e.exports='<div class="device">\n <div class="device__icon"\n [style.background-image]="\'url(assets/\' + device?.subType + \'.svg)\'">\n </div>\n <div *ngIf="device?.type === \'switcher\'"\n (click)="switchSensor()">\n <div class="device__switcher"\n [style.background-image]="switcherImageUrl()">\n </div>\n </div>\n</div>\n'},441:function(e,t){e.exports=".device{width:42px;height:42px;position:absolute;cursor:move}.device__icon{width:100%;height:100%}.device__switcher{position:absolute;left:42px;top:0;width:42px;height:42px;cursor:pointer}\n"},442:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=n(3),s=function(){function e(){this.isEditMode=!1,this.onRemoveWidget=new i.EventEmitter}return e.prototype.removeWidget=function(){this.onRemoveWidget.emit(this.device)},r([i.Input(),o("design:type",Object)],e.prototype,"device",void 0),r([i.Input(),o("design:type",Boolean)],e.prototype,"isEditMode",void 0),r([i.Output(),o("design:type","function"==typeof(t="undefined"!=typeof i.EventEmitter&&i.EventEmitter)&&t||Object)],e.prototype,"onRemoveWidget",void 0),e=r([i.Component({selector:"sh-device-widget",template:n(443),styles:[n(444)]}),o("design:paramtypes",[])],e);var t}();t.DeviceWidgetComponent=s},443:function(e,t){e.exports='<div class="sensor-widget">\n <div class="sensor-widget_header">\n <div class="sensor-widget_button-statistics"\n [routerLink]="[\'../statistic/sensor-details\', device.mqttId, \'day\', device.type]">\n </div>\n <div class="sensor-widget_header_info">\n <span>{{device.description}}</span>\n </div>\n <button class="sensor-widget_button-close"\n *ngIf="isEditMode"\n (click)="removeWidget()">\n </button>\n </div>\n <div>\n <sh-sensor-widget\n [device]="device"\n *ngIf="!device.executor && !device.servo">\n </sh-sensor-widget>\n <sh-switcher-widget\n [device]="device"\n *ngIf="device.executor">\n </sh-switcher-widget>\n <sh-servo-widget\n [device]="device"\n *ngIf="device.servo">\n </sh-servo-widget>\n </div>\n</div>\n'},444:function(e,t){e.exports=".sensor-widget{position:relative;width:182px;height:182px;padding:2px;font-family:Roboto;text-align:center;color:white;background-color:#169eb1;border:solid 1px white;overflow:hidden}.sensor-widget_footer,.sensor-widget_header{position:absolute;width:100%;bottom:0;height:27px;max-height:27px;overflow:hidden}.sensor-widget_footer{bottom:0}.sensor-widget_header{top:0;z-index:1}.sensor-widget_button-close,.sensor-widget_button-statistics{position:absolute;top:0;width:27px;height:27px;border:none;box-shadow:none;cursor:pointer;background:transparent;background-repeat:no-repeat;background-position:center;opacity:0.5}.sensor-widget_button-close:hover,.sensor-widget_button-close:active,.sensor-widget_button-close:focus,.sensor-widget_button-statistics:hover,.sensor-widget_button-statistics:active,.sensor-widget_button-statistics:focus{opacity:1}.sensor-widget_button-close{right:0;background-image:url(./assets/close-icon.svg)}.sensor-widget_button-statistics{left:0;background-image:url(./assets/statistics-icon.svg)}.sensor-widget_header_info{line-height:27px;padding:0 27px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.sensor-widget_info{margin-top:27px;padding:27px 27px;display:table;height:100%;width:100%}.sensor-widget_info_value{display:table-cell;vertical-align:middle;text-align:center;font-size:24px;line-height:1.5;font-weight:bold;width:100%}.sensor-widget_switcher-info{padding:27px 27px;display:table;height:100%;width:100%}\n"},445:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=n(3),s=n(446),a=function(){function e(){this.io=s,this.setupSocket()}return e.prototype.setupSocket=function(){this.socket=this.io.connect({backEndUrl:"",backEndWebSocketUrl:""}.backEndWebSocketUrl)},e.prototype.subscribe=function(e,t){function n(){this.socket.on("event",t),e&&this.socket.emit("subscribe",{device:e})}var r=this;this.socket.connected?n.apply(this):this.socket.on("connect",function(){n.apply(r)})},e.prototype.unsubscribe=function(e){this.socket.emit("unsubscribe",{device:e})},e.prototype.pushEvent=function(e){this.socket.emit("pushEvent",e)},e=r([i.Injectable(),o("design:paramtypes",[])],e)}();t.DeviceWidgetService=a},446:function(e,t,n){function r(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,r=i(e),s=r.source,p=r.id,l=r.path,h=u[p]&&l in u[p].nsps,f=t.forceNew||t["force new connection"]||!1===t.multiplex||h;return f?(c("ignoring socket cache for %s",s),n=a(s,t)):(u[p]||(c("new io instance for %s",s),u[p]=a(s,t)),n=u[p]),r.query&&!t.query?t.query=r.query:t&&"object"==typeof t.query&&(t.query=o(t.query)),n.socket(r.path,t)}function o(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}var i=n(447),s=n(452),a=n(463),c=n(449)("socket.io-client");e.exports=t=r;var u=t.managers={};t.protocol=s.protocol,t.connect=r,t.Manager=n(463),t.Socket=n(493)},447:function(e,t,n){(function(t){function r(e,n){var r=e;n=n||t.location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(i("protocol-less url %s",e),e="undefined"!=typeof n?n.protocol+"//"+e:"https://"+e),i("parse %s",e),r=o(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var s=r.host.indexOf(":")!==-1,a=s?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}var o=n(448),i=n(449)("socket.io-client:url");e.exports=r}).call(t,function(){return this}())},448:function(e,t){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.exports=function(e){var t=e,o=e.indexOf("["),i=e.indexOf("]");o!=-1&&i!=-1&&(e=e.substring(0,o)+e.substring(o,i).replace(/:/g,";")+e.substring(i,e.length));for(var s=n.exec(e||""),a={},c=14;c--;)a[r[c]]=s[c]||"";return o!=-1&&i!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}},449:[965,450],450:function(e,t,n){function r(){return t.colors[p++%t.colors.length]}function o(e){function n(){}function o(){var e=o,n=+new Date,i=n-(u||n);e.diff=i,e.prev=u,e.curr=n,u=n,null==e.useColors&&(e.useColors=t.useColors()),null==e.color&&e.useColors&&(e.color=r());for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&(s=["%o"].concat(s));var c=0;s[0]=s[0].replace(/%([a-z%])/g,function(n,r){if("%%"===n)return n;c++;var o=t.formatters[r];if("function"==typeof o){var i=s[c];n=o.call(e,i),s.splice(c,1),c--}return n}),s=t.formatArgs.apply(e,s);var p=o.log||t.log||console.log.bind(console);p.apply(e,s)}n.enabled=!1,o.enabled=!0;var i=t.enabled(e)?o:n;return i.namespace=e,i}function i(e){t.save(e);for(var n=(e||"").split(/[\s,]+/),r=n.length,o=0;o<r;o++)n[o]&&(e=n[o].replace(/[\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*?"),"-"===e[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))}function s(){t.enable("")}function a(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}t=e.exports=o.debug=o,t.coerce=c,t.disable=s,t.enable=i,t.enabled=a,t.humanize=n(451),t.names=[],t.skips=[],t.formatters={};var u,p=0},451:function(e,t){function n(e){if(e=String(e),!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*p;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"hrs":case"hr":case"h":return n*c;case"minutes":case"minute":case"mins":case"min":case"m":return n*a;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function r(e){return e>=u?Math.round(e/u)+"d":e>=c?Math.round(e/c)+"h":e>=a?Math.round(e/a)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function o(e){return i(e,u,"day")||i(e,c,"hour")||i(e,a,"minute")||i(e,s,"second")||e+" ms"}function i(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}var s=1e3,a=60*s,c=60*a,u=24*c,p=365.25*u;e.exports=function(e,t){t=t||{};var i=typeof e;if("string"===i&&e.length>0)return n(e);if("number"===i&&isNaN(e)===!1)return t.long?o(e):r(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},452:function(e,t,n){function r(){}function o(e){var n="",r=!1;return n+=e.type,t.BINARY_EVENT!=e.type&&t.BINARY_ACK!=e.type||(n+=e.attachments,n+="-"),e.nsp&&"/"!=e.nsp&&(r=!0,n+=e.nsp),null!=e.id&&(r&&(n+=",",r=!1),n+=e.id),null!=e.data&&(r&&(n+=","),n+=h.stringify(e.data)),l("encoded %j as %s",e,n),n}function i(e,t){function n(e){var n=d.deconstructPacket(e),r=o(n.packet),i=n.buffers;i.unshift(r),t(i)}d.removeBlobs(e,n)}function s(){this.reconstructor=null}function a(e){var n={},r=0;if(n.type=Number(e.charAt(0)),null==t.types[n.type])return p();if(t.BINARY_EVENT==n.type||t.BINARY_ACK==n.type){for(var o="";"-"!=e.charAt(++r)&&(o+=e.charAt(r),r!=e.length););if(o!=Number(o)||"-"!=e.charAt(r))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"==e.charAt(r+1))for(n.nsp="";++r;){var i=e.charAt(r);if(","==i)break;if(n.nsp+=i,r==e.length)break}else n.nsp="/";var s=e.charAt(r+1);if(""!==s&&Number(s)==s){for(n.id="";++r;){var i=e.charAt(r);if(null==i||Number(i)!=i){--r;break}if(n.id+=e.charAt(r),r==e.length)break}n.id=Number(n.id)}return e.charAt(++r)&&(n=c(n,e.substr(r))),l("decoded %s as %j",e,n),n}function c(e,t){try{e.data=h.parse(t)}catch(e){return p()}return e}function u(e){this.reconPack=e,this.buffers=[]}function p(e){return{type:t.ERROR,data:"parser error"}}var l=n(453)("socket.io-parser"),h=n(456),f=n(459),d=n(460),y=n(462);t.protocol=4,t.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],t.CONNECT=0,t.DISCONNECT=1,t.EVENT=2,t.ACK=3,t.ERROR=4,t.BINARY_EVENT=5,t.BINARY_ACK=6,t.Encoder=r,t.Decoder=s,r.prototype.encode=function(e,n){if(l("encoding packet %j",e),t.BINARY_EVENT==e.type||t.BINARY_ACK==e.type)i(e,n);else{var r=o(e);n([r])}},f(s.prototype),s.prototype.add=function(e){var n;if("string"==typeof e)n=a(e),t.BINARY_EVENT==n.type||t.BINARY_ACK==n.type?(this.reconstructor=new u(n),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",n)):this.emit("decoded",n);else{if(!y(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,this.emit("decoded",n))}},s.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},u.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length==this.reconPack.attachments){var t=d.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},u.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},453:function(e,t,n){function r(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function o(){var e=arguments,n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return e;var r="color: "+this.color;e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1));var o=0,i=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(o++,"%c"===e&&(i=o))}),e.splice(i,0,r),e}function i(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}}function a(){var e;try{e=t.storage.debug}catch(e){}return e}function c(){try{return window.localStorage}catch(e){}}t=e.exports=n(454),t.log=i,t.formatArgs=o,t.save=s,t.load=a,t.useColors=r,t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:c(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){return JSON.stringify(e)},t.enable(a())},454:function(e,t,n){function r(){return t.colors[p++%t.colors.length]}function o(e){function n(){}function o(){var e=o,n=+new Date,i=n-(u||n);e.diff=i,e.prev=u,e.curr=n,u=n,null==e.useColors&&(e.useColors=t.useColors()),null==e.color&&e.useColors&&(e.color=r());var s=Array.prototype.slice.call(arguments);s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&(s=["%o"].concat(s));var a=0;s[0]=s[0].replace(/%([a-z%])/g,function(n,r){if("%%"===n)return n;a++;var o=t.formatters[r];if("function"==typeof o){var i=s[a];n=o.call(e,i),s.splice(a,1),a--}return n}),"function"==typeof t.formatArgs&&(s=t.formatArgs.apply(e,s));var c=o.log||t.log||console.log.bind(console);c.apply(e,s)}n.enabled=!1,o.enabled=!0;var i=t.enabled(e)?o:n;return i.namespace=e,i}function i(e){t.save(e);for(var n=(e||"").split(/[\s,]+/),r=n.length,o=0;o<r;o++)n[o]&&(e=n[o].replace(/\*/g,".*?"),"-"===e[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))}function s(){t.enable("")}function a(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}t=e.exports=o,t.coerce=c,t.disable=s,t.enable=i,t.enabled=a,t.humanize=n(455),t.names=[],t.skips=[],t.formatters={};var u,p=0},455:function(e,t){function n(e){if(e=""+e,!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*p;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"hrs":case"hr":case"h":return n*c;case"minutes":case"minute":case"mins":case"min":case"m":return n*a;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}}}function r(e){return e>=u?Math.round(e/u)+"d":e>=c?Math.round(e/c)+"h":e>=a?Math.round(e/a)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function o(e){return i(e,u,"day")||i(e,c,"hour")||i(e,a,"minute")||i(e,s,"second")||e+" ms"}function i(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}var s=1e3,a=60*s,c=60*a,u=24*c,p=365.25*u;e.exports=function(e,t){return t=t||{},"string"==typeof e?n(e):t.long?o(e):r(e)}},456:function(e,t,n){var r;(function(e,o){(function(){function i(e,t){function n(e){if(n[e]!==v)return n[e];var i;if("bug-string-char-index"==e)i="a"!="a"[0];else if("json"==e)i=n("json-stringify")&&n("json-parse");else{var s,a='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var u=t.stringify,p="function"==typeof u&&b;if(p){(s=function(){return 1}).toJSON=s;try{p="0"===u(0)&&"0"===u(new r)&&'""'==u(new o)&&u(m)===v&&u(v)===v&&u()===v&&"1"===u(s)&&"[1]"==u([s])&&"[null]"==u([v])&&"null"==u(null)&&"[null,null,null]"==u([v,m,null])&&u({a:[s,!0,!1,null,"\0\b\n\f\r\t"]})==a&&"1"===u(null,s)&&"[\n 1,\n 2\n]"==u([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==u(new c(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==u(new c(864e13))&&'"-000001-01-01T00:00:00.000Z"'==u(new c(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==u(new c(-1))}catch(e){p=!1}}i=p}if("json-parse"==e){var l=t.parse;if("function"==typeof l)try{if(0===l("0")&&!l(!1)){s=l(a);var h=5==s.a.length&&1===s.a[0];if(h){try{h=!l('"\t"')}catch(e){}if(h)try{h=1!==l("01")}catch(e){}if(h)try{h=1!==l("1.")}catch(e){}}}}catch(e){h=!1}i=h}}return n[e]=!!i}e||(e=u.Object()),t||(t=u.Object());var r=e.Number||u.Number,o=e.String||u.String,s=e.Object||u.Object,c=e.Date||u.Date,p=e.SyntaxError||u.SyntaxError,l=e.TypeError||u.TypeError,h=e.Math||u.Math,f=e.JSON||u.JSON;"object"==typeof f&&f&&(t.stringify=f.stringify,t.parse=f.parse);var d,y,v,g=s.prototype,m=g.toString,b=new c(-0xc782b5b800cec);try{b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}catch(e){}if(!n("json")){var _="[object Function]",w="[object Date]",x="[object Number]",k="[object String]",S="[object Array]",R="[object Boolean]",C=n("bug-string-char-index");if(!b)var O=h.floor,A=[0,31,59,90,120,151,181,212,243,273,304,334],j=function(e,t){return A[t]+365*(e-1970)+O((e-1969+(t=+(t>1)))/4)-O((e-1901+t)/100)+O((e-1601+t)/400)};if((d=g.hasOwnProperty)||(d=function(e){var t,n={};return(n.__proto__=null,n.__proto__={toString:1},n).toString!=m?d=function(e){var t=this.__proto__,n=e in(this.__proto__=null,this);return this.__proto__=t,n}:(t=n.constructor,d=function(e){var n=(this.constructor||t).prototype;return e in this&&!(e in n&&this[e]===n[e])}),n=null,d.call(this,e)}),y=function(e,t){var n,r,o,i=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,r=new n;for(o in r)d.call(r,o)&&i++;return n=r=null,i?y=2==i?function(e,t){var n,r={},o=m.call(e)==_;for(n in e)o&&"prototype"==n||d.call(r,n)||!(r[n]=1)||!d.call(e,n)||t(n)}:function(e,t){var n,r,o=m.call(e)==_;for(n in e)o&&"prototype"==n||!d.call(e,n)||(r="constructor"===n)||t(n);(r||d.call(e,n="constructor"))&&t(n)}:(r=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],y=function(e,t){var n,o,i=m.call(e)==_,s=!i&&"function"!=typeof e.constructor&&a[typeof e.hasOwnProperty]&&e.hasOwnProperty||d;for(n in e)i&&"prototype"==n||!s.call(e,n)||t(n);for(o=r.length;n=r[--o];s.call(e,n)&&t(n));}),y(e,t)},!n("json-stringify")){var D={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},E="000000",T=function(e,t){return(E+(t||0)).slice(-e)},B="\\u00",P=function(e){for(var t='"',n=0,r=e.length,o=!C||r>10,i=o&&(C?e.split(""):e);n<r;n++){var s=e.charCodeAt(n);switch(s){case 8:case 9:case 10:case 12:case 13:case 34:case 92:t+=D[s];break;default:if(s<32){t+=B+T(2,s.toString(16));break}t+=o?i[n]:e.charAt(n)}}return t+'"'},I=function(e,t,n,r,o,i,s){var a,c,u,p,h,f,g,b,_,C,A,D,E,B,N,M;try{a=t[e]}catch(e){}if("object"==typeof a&&a)if(c=m.call(a),c!=w||d.call(a,"toJSON"))"function"==typeof a.toJSON&&(c!=x&&c!=k&&c!=S||d.call(a,"toJSON"))&&(a=a.toJSON(e));else if(a>-1/0&&a<1/0){if(j){for(h=O(a/864e5),u=O(h/365.2425)+1970-1;j(u+1,0)<=h;u++);for(p=O((h-j(u,0))/30.42);j(u,p+1)<=h;p++);h=1+h-j(u,p),f=(a%864e5+864e5)%864e5,g=O(f/36e5)%24,b=O(f/6e4)%60,_=O(f/1e3)%60,C=f%1e3}else u=a.getUTCFullYear(),p=a.getUTCMonth(),h=a.getUTCDate(),g=a.getUTCHours(),b=a.getUTCMinutes(),_=a.getUTCSeconds(),C=a.getUTCMilliseconds();a=(u<=0||u>=1e4?(u<0?"-":"+")+T(6,u<0?-u:u):T(4,u))+"-"+T(2,p+1)+"-"+T(2,h)+"T"+T(2,g)+":"+T(2,b)+":"+T(2,_)+"."+T(3,C)+"Z"}else a=null;if(n&&(a=n.call(t,e,a)),null===a)return"null";if(c=m.call(a),c==R)return""+a;if(c==x)return a>-1/0&&a<1/0?""+a:"null";if(c==k)return P(""+a);if("object"==typeof a){for(B=s.length;B--;)if(s[B]===a)throw l();if(s.push(a),A=[],N=i,i+=o,c==S){for(E=0,B=a.length;E<B;E++)D=I(E,a,n,r,o,i,s),A.push(D===v?"null":D); M=A.length?o?"[\n"+i+A.join(",\n"+i)+"\n"+N+"]":"["+A.join(",")+"]":"[]"}else y(r||a,function(e){var t=I(e,a,n,r,o,i,s);t!==v&&A.push(P(e)+":"+(o?" ":"")+t)}),M=A.length?o?"{\n"+i+A.join(",\n"+i)+"\n"+N+"}":"{"+A.join(",")+"}":"{}";return s.pop(),M}};t.stringify=function(e,t,n){var r,o,i,s;if(a[typeof t]&&t)if((s=m.call(t))==_)o=t;else if(s==S){i={};for(var c,u=0,p=t.length;u<p;c=t[u++],s=m.call(c),(s==k||s==x)&&(i[c]=1));}if(n)if((s=m.call(n))==x){if((n-=n%1)>0)for(r="",n>10&&(n=10);r.length<n;r+=" ");}else s==k&&(r=n.length<=10?n:n.slice(0,10));return I("",(c={},c[""]=e,c),o,i,r,"",[])}}if(!n("json-parse")){var N,M,L=o.fromCharCode,U={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},q=function(){throw N=M=null,p()},F=function(){for(var e,t,n,r,o,i=M,s=i.length;N<s;)switch(o=i.charCodeAt(N)){case 9:case 10:case 13:case 32:N++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=C?i.charAt(N):i[N],N++,e;case 34:for(e="@",N++;N<s;)if(o=i.charCodeAt(N),o<32)q();else if(92==o)switch(o=i.charCodeAt(++N)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=U[o],N++;break;case 117:for(t=++N,n=N+4;N<n;N++)o=i.charCodeAt(N),o>=48&&o<=57||o>=97&&o<=102||o>=65&&o<=70||q();e+=L("0x"+i.slice(t,N));break;default:q()}else{if(34==o)break;for(o=i.charCodeAt(N),t=N;o>=32&&92!=o&&34!=o;)o=i.charCodeAt(++N);e+=i.slice(t,N)}if(34==i.charCodeAt(N))return N++,e;q();default:if(t=N,45==o&&(r=!0,o=i.charCodeAt(++N)),o>=48&&o<=57){for(48==o&&(o=i.charCodeAt(N+1),o>=48&&o<=57)&&q(),r=!1;N<s&&(o=i.charCodeAt(N),o>=48&&o<=57);N++);if(46==i.charCodeAt(N)){for(n=++N;n<s&&(o=i.charCodeAt(n),o>=48&&o<=57);n++);n==N&&q(),N=n}if(o=i.charCodeAt(N),101==o||69==o){for(o=i.charCodeAt(++N),43!=o&&45!=o||N++,n=N;n<s&&(o=i.charCodeAt(n),o>=48&&o<=57);n++);n==N&&q(),N=n}return+i.slice(t,N)}if(r&&q(),"true"==i.slice(N,N+4))return N+=4,!0;if("false"==i.slice(N,N+5))return N+=5,!1;if("null"==i.slice(N,N+4))return N+=4,null;q()}return"$"},z=function(e){var t,n;if("$"==e&&q(),"string"==typeof e){if("@"==(C?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=F(),"]"!=e;n||(n=!0))n&&(","==e?(e=F(),"]"==e&&q()):q()),","==e&&q(),t.push(z(e));return t}if("{"==e){for(t={};e=F(),"}"!=e;n||(n=!0))n&&(","==e?(e=F(),"}"==e&&q()):q()),","!=e&&"string"==typeof e&&"@"==(C?e.charAt(0):e[0])&&":"==F()||q(),t[e.slice(1)]=z(F());return t}q()}return e},H=function(e,t,n){var r=W(e,t,n);r===v?delete e[t]:e[t]=r},W=function(e,t,n){var r,o=e[t];if("object"==typeof o&&o)if(m.call(o)==S)for(r=o.length;r--;)H(o,r,n);else y(o,function(e){H(o,e,n)});return n.call(e,t,o)};t.parse=function(e,t){var n,r;return N=0,M=""+e,n=z(F()),"$"!=F()&&q(),N=M=null,t&&m.call(t)==_?W((r={},r[""]=n,r),"",t):n}}}return t.runInContext=i,t}var s=n(458),a={function:!0,object:!0},c=a[typeof t]&&t&&!t.nodeType&&t,u=a[typeof window]&&window||this,p=c&&a[typeof e]&&e&&!e.nodeType&&"object"==typeof o&&o;if(!p||p.global!==p&&p.window!==p&&p.self!==p||(u=p),c&&!s)i(u,c);else{var l=u.JSON,h=u.JSON3,f=!1,d=i(u,u.JSON3={noConflict:function(){return f||(f=!0,u.JSON=l,u.JSON3=h,l=h=null),d}});u.JSON={parse:d.parse,stringify:d.stringify}}s&&(r=function(){return d}.call(t,n,t,e),!(void 0!==r&&(e.exports=r)))}).call(this)}).call(t,n(457)(e),function(){return this}())},457:function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},458:function(e,t){(function(t){e.exports=t}).call(t,{})},459:function(e,t){function n(e){if(e)return r(e)}function r(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}e.exports=n,n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},n.prototype.once=function(e,t){function n(){r.off(e,n),t.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},n.fn=t,this.on(e,n),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[e];if(!n)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===t||r.fn===t){n.splice(o,1);break}return this},n.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks[e];if(n){n=n.slice(0);for(var r=0,o=n.length;r<o;++r)n[r].apply(this,t)}return this},n.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},n.prototype.hasListeners=function(e){return!!this.listeners(e).length}},460:function(e,t,n){(function(e){var r=n(461),o=n(462);t.deconstructPacket=function(e){function t(e){if(!e)return e;if(o(e)){var i={_placeholder:!0,num:n.length};return n.push(e),i}if(r(e)){for(var s=new Array(e.length),a=0;a<e.length;a++)s[a]=t(e[a]);return s}if("object"==typeof e&&!(e instanceof Date)){var s={};for(var c in e)s[c]=t(e[c]);return s}return e}var n=[],i=e.data,s=e;return s.data=t(i),s.attachments=n.length,{packet:s,buffers:n}},t.reconstructPacket=function(e,t){function n(e){if(e&&e._placeholder){var o=t[e.num];return o}if(r(e)){for(var i=0;i<e.length;i++)e[i]=n(e[i]);return e}if(e&&"object"==typeof e){for(var s in e)e[s]=n(e[s]);return e}return e}return e.data=n(e.data),e.attachments=void 0,e},t.removeBlobs=function(t,n){function i(t,c,u){if(!t)return t;if(e.Blob&&t instanceof Blob||e.File&&t instanceof File){s++;var p=new FileReader;p.onload=function(){u?u[c]=this.result:a=this.result,--s||n(a)},p.readAsArrayBuffer(t)}else if(r(t))for(var l=0;l<t.length;l++)i(t[l],l,t);else if(t&&"object"==typeof t&&!o(t))for(var h in t)i(t[h],h,t)}var s=0,a=t;i(a),s||n(a)}}).call(t,function(){return this}())},461:function(e,t){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},462:function(e,t){(function(t){function n(e){return t.Buffer&&t.Buffer.isBuffer(e)||t.ArrayBuffer&&e instanceof ArrayBuffer}e.exports=n}).call(t,function(){return this}())},463:function(e,t,n){function r(e,t){return this instanceof r?(e&&"object"==typeof e&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new h({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[],this.encoder=new a.Encoder,this.decoder=new a.Decoder,this.autoConnect=t.autoConnect!==!1,void(this.autoConnect&&this.open())):new r(e,t)}var o=n(464),i=n(493),s=n(494),a=n(452),c=n(496),u=n(497),p=n(449)("socket.io-client:manager"),l=n(491),h=n(498),f=Object.prototype.hasOwnProperty;e.exports=r,r.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var e in this.nsps)f.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},r.prototype.updateSocketIds=function(){for(var e in this.nsps)f.call(this.nsps,e)&&(this.nsps[e].id=this.engine.id)},s(r.prototype),r.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},r.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},r.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},r.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},r.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},r.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},r.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},r.prototype.open=r.prototype.connect=function(e,t){if(p("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;p("opening %s",this.uri),this.engine=o(this.uri,this.opts);var n=this.engine,r=this;this.readyState="opening",this.skipReconnect=!1;var i=c(n,"open",function(){r.onopen(),e&&e()}),s=c(n,"error",function(t){if(p("connect_error"),r.cleanup(),r.readyState="closed",r.emitAll("connect_error",t),e){var n=new Error("Connection error");n.data=t,e(n)}else r.maybeReconnectOnOpen()});if(!1!==this._timeout){var a=this._timeout;p("connect attempt will timeout after %d",a);var u=setTimeout(function(){p("connect attempt timed out after %d",a),i.destroy(),n.close(),n.emit("error","timeout"),r.emitAll("connect_timeout",a)},a);this.subs.push({destroy:function(){clearTimeout(u)}})}return this.subs.push(i),this.subs.push(s),this},r.prototype.onopen=function(){p("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(c(e,"data",u(this,"ondata"))),this.subs.push(c(e,"ping",u(this,"onping"))),this.subs.push(c(e,"pong",u(this,"onpong"))),this.subs.push(c(e,"error",u(this,"onerror"))),this.subs.push(c(e,"close",u(this,"onclose"))),this.subs.push(c(this.decoder,"decoded",u(this,"ondecoded")))},r.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},r.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},r.prototype.ondata=function(e){this.decoder.add(e)},r.prototype.ondecoded=function(e){this.emit("packet",e)},r.prototype.onerror=function(e){p("error",e),this.emitAll("error",e)},r.prototype.socket=function(e,t){function n(){~l(o.connecting,r)||o.connecting.push(r)}var r=this.nsps[e];if(!r){r=new i(this,e,t),this.nsps[e]=r;var o=this;r.on("connecting",n),r.on("connect",function(){r.id=o.engine.id}),this.autoConnect&&n()}return r},r.prototype.destroy=function(e){var t=l(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},r.prototype.packet=function(e){p("writing packet %j",e);var t=this;e.query&&0===e.type&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,function(n){for(var r=0;r<n.length;r++)t.engine.write(n[r],e.options);t.encoding=!1,t.processPacketQueue()}))},r.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},r.prototype.cleanup=function(){p("cleanup");for(var e=this.subs.length,t=0;t<e;t++){var n=this.subs.shift();n.destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},r.prototype.close=r.prototype.disconnect=function(){p("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},r.prototype.onclose=function(e){p("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},r.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)p("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();p("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var n=setTimeout(function(){e.skipReconnect||(p("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open(function(t){t?(p("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(p("reconnect success"),e.onreconnect())}))},t);this.subs.push({destroy:function(){clearTimeout(n)}})}},r.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)}},464:function(e,t,n){e.exports=n(465)},465:function(e,t,n){e.exports=n(466),e.exports.parser=n(473)},466:function(e,t,n){(function(t){function r(e,n){if(!(this instanceof r))return new r(e,n);n=n||{},e&&"object"==typeof e&&(n=e,e=null),e?(e=p(e),n.hostname=e.host,n.secure="https"===e.protocol||"wss"===e.protocol,n.port=e.port,e.query&&(n.query=e.query)):n.host&&(n.hostname=p(n.host).host),this.secure=null!=n.secure?n.secure:t.location&&"https:"===location.protocol,n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.agent=n.agent||!1,this.hostname=n.hostname||(t.location?location.hostname:"localhost"),this.port=n.port||(t.location&&location.port?location.port:this.secure?443:80),this.query=n.query||{},"string"==typeof this.query&&(this.query=h.decode(this.query)),this.upgrade=!1!==n.upgrade,this.path=(n.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!n.forceJSONP,this.jsonp=!1!==n.jsonp,this.forceBase64=!!n.forceBase64,this.enablesXDR=!!n.enablesXDR,this.timestampParam=n.timestampParam||"t",this.timestampRequests=n.timestampRequests,this.transports=n.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=n.policyPort||843,this.rememberUpgrade=n.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=n.onlyBinaryUpgrades,this.perMessageDeflate=!1!==n.perMessageDeflate&&(n.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=n.pfx||null,this.key=n.key||null,this.passphrase=n.passphrase||null,this.cert=n.cert||null,this.ca=n.ca||null,this.ciphers=n.ciphers||null,this.rejectUnauthorized=void 0===n.rejectUnauthorized?null:n.rejectUnauthorized,this.forceNode=!!n.forceNode;var o="object"==typeof t&&t;o.global===o&&(n.extraHeaders&&Object.keys(n.extraHeaders).length>0&&(this.extraHeaders=n.extraHeaders),n.localAddress&&(this.localAddress=n.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}function o(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var i=n(467),s=n(482),a=n(486)("engine.io-client:socket"),c=n(491),u=n(473),p=n(448),l=n(492),h=n(483);e.exports=r,r.priorWebsocketSuccess=!1,s(r.prototype),r.protocol=u.protocol,r.Socket=r,r.Transport=n(472),r.transports=n(467),r.parser=n(473),r.prototype.createTransport=function(e){a('creating transport "%s"',e);var t=o(this.query);t.EIO=u.protocol,t.transport=e,this.id&&(t.sid=this.id);var n=new i[e]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:t,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized,perMessageDeflate:this.perMessageDeflate,extraHeaders:this.extraHeaders,forceNode:this.forceNode,localAddress:this.localAddress});return n},r.prototype.open=function(){var e;if(this.rememberUpgrade&&r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout(function(){t.emit("error","No transports available")},0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},r.prototype.setTransport=function(e){a("setting transport %s",e.name);var t=this;this.transport&&(a("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",function(){t.onDrain()}).on("packet",function(e){t.onPacket(e)}).on("error",function(e){t.onError(e)}).on("close",function(){t.onClose("transport close")})},r.prototype.probe=function(e){function t(){if(h.onlyBinaryUpgrades){var t=!this.supportsBinary&&h.transport.supportsBinary;l=l||t}l||(a('probe transport "%s" opened',e),p.send([{type:"ping",data:"probe"}]),p.once("packet",function(t){if(!l)if("pong"===t.type&&"probe"===t.data){if(a('probe transport "%s" pong',e),h.upgrading=!0,h.emit("upgrading",p),!p)return;r.priorWebsocketSuccess="websocket"===p.name,a('pausing current transport "%s"',h.transport.name),h.transport.pause(function(){l||"closed"!==h.readyState&&(a("changing transport and sending upgrade packet"),u(),h.setTransport(p),p.send([{type:"upgrade"}]),h.emit("upgrade",p),p=null,h.upgrading=!1,h.flush())})}else{a('probe transport "%s" failed',e);var n=new Error("probe error");n.transport=p.name,h.emit("upgradeError",n)}}))}function n(){l||(l=!0,u(),p.close(),p=null)}function o(t){var r=new Error("probe error: "+t);r.transport=p.name,n(),a('probe transport "%s" failed because of error: %s',e,t),h.emit("upgradeError",r)}function i(){o("transport closed")}function s(){o("socket closed")}function c(e){p&&e.name!==p.name&&(a('"%s" works - aborting "%s"',e.name,p.name),n())}function u(){p.removeListener("open",t),p.removeListener("error",o),p.removeListener("close",i),h.removeListener("close",s),h.removeListener("upgrading",c)}a('probing transport "%s"',e);var p=this.createTransport(e,{probe:1}),l=!1,h=this;r.priorWebsocketSuccess=!1,p.once("open",t),p.once("error",o),p.once("close",i),this.once("close",s),this.once("upgrading",c),p.open()},r.prototype.onOpen=function(){if(a("socket open"),this.readyState="open",r.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("