1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2382],{52382:function(t,n,e){var o,i;(function(){(function(){(function(){var t=[].slice;this.ActionCable={INTERNAL:{message_types:{welcome:"welcome",ping:"ping",confirmation:"confirm_subscription",rejection:"reject_subscription"},default_mount_path:"/cable",protocols:["actioncable-v1-json","actioncable-unsupported"]},WebSocket:window.WebSocket,logger:window.console,createConsumer:function(t){var n;return null==t&&(t=null!=(n=this.getConfig("url"))?n:this.INTERNAL.default_mount_path),new r.Consumer(this.createWebSocketURL(t))},getConfig:function(t){var n;return null!=(n=document.head.querySelector("meta[name='action-cable-"+t+"']"))?n.getAttribute("content"):void 0},createWebSocketURL:function(t){var n;return t&&!/^wss?:/i.test(t)?((n=document.createElement("a")).href=t,n.href=n.href,n.protocol=n.protocol.replace("http","ws"),n.href):t},startDebugging:function(){return this.debugging=!0},stopDebugging:function(){return this.debugging=null},log:function(){var n,e;if(n=1<=arguments.length?t.call(arguments,0):[],this.debugging)return n.push(Date.now()),(e=this.logger).log.apply(e,["[ActionCable]"].concat(t.call(n)))}}}).call(this)}).call(this);var r=this.ActionCable;(function(){(function(){r.ConnectionMonitor=function(){var t,n,e;function o(t){var n,e;this.connection=t,this.visibilityDidChange=(n=this.visibilityDidChange,e=this,function(){return n.apply(e,arguments)}),this.reconnectAttempts=0}return o.pollInterval={min:3,max:30},o.staleThreshold=6,o.prototype.start=function(){if(!this.isRunning())return this.startedAt=n(),delete this.stoppedAt,this.startPolling(),document.addEventListener("visibilitychange",this.visibilityDidChange),r.log("ConnectionMonitor started. pollInterval = "+this.getPollInterval()+" ms")},o.prototype.stop=function(){if(this.isRunning())return this.stoppedAt=n(),this.stopPolling(),document.removeEventListener("visibilitychange",this.visibilityDidChange),r.log("ConnectionMonitor stopped")},o.prototype.isRunning=function(){return null!=this.startedAt&&null==this.stoppedAt},o.prototype.recordPing=function(){return this.pingedAt=n()},o.prototype.recordConnect=function(){return this.reconnectAttempts=0,this.recordPing(),delete this.disconnectedAt,r.log("ConnectionMonitor recorded connect")},o.prototype.recordDisconnect=function(){return this.disconnectedAt=n(),r.log("ConnectionMonitor recorded disconnect")},o.prototype.startPolling=function(){return this.stopPolling(),this.poll()},o.prototype.stopPolling=function(){return clearTimeout(this.pollTimeout)},o.prototype.poll=function(){var t;return this.pollTimeout=setTimeout((t=this,function(){return t.reconnectIfStale(),t.poll()}),this.getPollInterval())},o.prototype.getPollInterval=function(){var n,e,o,i;return o=(i=this.constructor.pollInterval).min,e=i.max,n=5*Math.log(this.reconnectAttempts+1),Math.round(1e3*t(n,o,e))},o.prototype.reconnectIfStale=function(){if(this.connectionIsStale())return(r.log("ConnectionMonitor detected stale connection. reconnectAttempts = "+this.reconnectAttempts+", pollInterval = "+this.getPollInterval()+" ms, time disconnected = "+e(this.disconnectedAt)+" s, stale threshold = "+this.constructor.staleThreshold+" s"),this.reconnectAttempts++,this.disconnectedRecently())?r.log("ConnectionMonitor skipping reopening recent disconnect"):(r.log("ConnectionMonitor reopening"),this.connection.reopen())},o.prototype.connectionIsStale=function(){var t;return e(null!=(t=this.pingedAt)?t:this.startedAt)>this.constructor.staleThreshold},o.prototype.disconnectedRecently=function(){return this.disconnectedAt&&e(this.disconnectedAt)<this.constructor.staleThreshold},o.prototype.visibilityDidChange=function(){if("visible"===document.visibilityState){var t;return setTimeout((t=this,function(){if(t.connectionIsStale()||!t.connection.isOpen())return r.log("ConnectionMonitor reopening stale connection on visibilitychange. visbilityState = "+document.visibilityState),t.connection.reopen()}),200)}},n=function(){return new Date().getTime()},e=function(t){return(n()-t)/1e3},t=function(t,n,e){return Math.max(n,Math.min(e,t))},o}()}).call(this),(function(){var t,n,e,o,i,s=[].slice,c=[].indexOf||function(t){for(var n=0,e=this.length;n<e;n++)if(n in this&&this[n]===t)return n;return -1};n=(o=r.INTERNAL).message_types,i=2<=(e=o.protocols).length?s.call(e,0,t=e.length-1):(t=0,[]),e[t++],r.Connection=function(){function t(t){var n,e;this.consumer=t,this.open=(n=this.open,e=this,function(){return n.apply(e,arguments)}),this.subscriptions=this.consumer.subscriptions,this.monitor=new r.ConnectionMonitor(this),this.disconnected=!0}return t.reopenDelay=500,t.prototype.send=function(t){return!!this.isOpen()&&(this.webSocket.send(JSON.stringify(t)),!0)},t.prototype.open=function(){return this.isActive()?(r.log("Attempted to open WebSocket, but existing socket is "+this.getState()),!1):(r.log("Opening WebSocket, current state is "+this.getState()+", subprotocols: "+e),null!=this.webSocket&&this.uninstallEventHandlers(),this.webSocket=new r.WebSocket(this.consumer.url,e),this.installEventHandlers(),this.monitor.start(),!0)},t.prototype.close=function(t){var n;if((null!=t?t:{allowReconnect:!0}).allowReconnect||this.monitor.stop(),this.isActive())return null!=(n=this.webSocket)?n.close():void 0},t.prototype.reopen=function(){if(r.log("Reopening WebSocket, current state is "+this.getState()),!this.isActive())return this.open();try{return this.close()}catch(t){return r.log("Failed to reopen WebSocket",t)}finally{r.log("Reopening WebSocket in "+this.constructor.reopenDelay+"ms"),setTimeout(this.open,this.constructor.reopenDelay)}},t.prototype.getProtocol=function(){var t;return null!=(t=this.webSocket)?t.protocol:void 0},t.prototype.isOpen=function(){return this.isState("open")},t.prototype.isActive=function(){return this.isState("open","connecting")}
1,t.prototype.isProtocolSupported=function(){var t;return t=this.getProtocol(),c.call(i,t)>=0},t.prototype.isState=function(){var t,n;return n=1<=arguments.length?s.call(arguments,0):[],t=this.getState(),c.call(n,t)>=0},t.prototype.getState=function(){var t,n;for(n in WebSocket)if(WebSocket[n]===(null!=(t=this.webSocket)?t.readyState:void 0))return n.toLowerCase();return null},t.prototype.installEventHandlers=function(){var t,n;for(t in this.events)n=this.events[t].bind(this),this.webSocket["on"+t]=n},t.prototype.uninstallEventHandlers=function(){var t;for(t in this.events)this.webSocket["on"+t]=function(){}},t.prototype.events={message:function(t){var e,o,i;if(this.isProtocolSupported())switch(e=(i=JSON.parse(t.data)).identifier,o=i.message,i.type){case n.welcome:return this.monitor.recordConnect(),this.subscriptions.reload();case n.ping:return this.monitor.recordPing();case n.confirmation:return this.subscriptions.notify(e,"connected");case n.rejection:return this.subscriptions.reject(e);default:return this.subscriptions.notify(e,"received",o)}},open:function(){if(r.log("WebSocket onopen event, using '"+this.getProtocol()+"' subprotocol"),this.disconnected=!1,!this.isProtocolSupported())return r.log("Protocol is unsupported. Stopping monitor and disconnecting."),this.close({allowReconnect:!1})},close:function(t){if(r.log("WebSocket onclose event"),!this.disconnected)return this.disconnected=!0,this.monitor.recordDisconnect(),this.subscriptions.notifyAll("disconnected",{willAttemptReconnect:this.monitor.isRunning()})},error:function(){return r.log("WebSocket onerror event")}},t}()}).call(this),(function(){var t=[].slice;r.Subscriptions=function(){function n(t){this.consumer=t,this.subscriptions=[]}return n.prototype.create=function(t,n){var e;return e=new r.Subscription(this.consumer,"object"==typeof t?t:{channel:t},n),this.add(e)},n.prototype.add=function(t){return this.subscriptions.push(t),this.consumer.ensureActiveConnection(),this.notify(t,"initialized"),this.sendCommand(t,"subscribe"),t},n.prototype.remove=function(t){return this.forget(t),this.findAll(t.identifier).length||this.sendCommand(t,"unsubscribe"),t},n.prototype.reject=function(t){var n,e,o,i,r;for(n=0,o=this.findAll(t),i=[],e=o.length;n<e;n++)r=o[n],this.forget(r),this.notify(r,"rejected"),i.push(r);return i},n.prototype.forget=function(t){var n;return this.subscriptions=(function(){var e,o,i,r;for(e=0,i=this.subscriptions,r=[],o=i.length;e<o;e++)(n=i[e])!==t&&r.push(n);return r}).call(this),t},n.prototype.findAll=function(t){var n,e,o,i,r;for(n=0,o=this.subscriptions,i=[],e=o.length;n<e;n++)(r=o[n]).identifier===t&&i.push(r);return i},n.prototype.reload=function(){var t,n,e,o,i;for(t=0,e=this.subscriptions,o=[],n=e.length;t<n;t++)i=e[t],o.push(this.sendCommand(i,"subscribe"));return o},n.prototype.notifyAll=function(){var n,e,o,i,r,s,c;for(e=arguments[0],n=2<=arguments.length?t.call(arguments,1):[],r=this.subscriptions,s=[],o=0,i=r.length;o<i;o++)c=r[o],s.push(this.notify.apply(this,[c,e].concat(t.call(n))));return s},n.prototype.notify=function(){var n,e,o,i,r,s,c;for(s=arguments[0],e=arguments[1],n=3<=arguments.length?t.call(arguments,2):[],c="string"==typeof s?this.findAll(s):[s],r=[],o=0,i=c.length;o<i;o++)s=c[o],r.push("function"==typeof s[e]?s[e].apply(s,n):void 0);return r},n.prototype.sendCommand=function(t,n){var e;return e=t.identifier,this.consumer.send({command:n,identifier:e})},n}()}).call(this),(function(){r.Subscription=function(){var t;function n(n,e,o){this.consumer=n,null==e&&(e={}),this.identifier=JSON.stringify(e),t(this,o)}return n.prototype.perform=function(t,n){return null==n&&(n={}),n.action=t,this.send(n)},n.prototype.send=function(t){return this.consumer.send({command:"message",identifier:this.identifier,data:JSON.stringify(t)})},n.prototype.unsubscribe=function(){return this.consumer.subscriptions.remove(this)},t=function(t,n){var e,o;if(null!=n)for(e in n)o=n[e],t[e]=o;return t},n}()}).call(this),(function(){r.Consumer=function(){function t(t){this.url=t,this.subscriptions=new r.Subscriptions(this),this.connection=new r.Connection(this)}return t.prototype.send=function(t){return this.connection.send(t)},t.prototype.connect=function(){return this.connection.open()},t.prototype.disconnect=function(){return this.connection.close({allowReconnect:!1})},t.prototype.ensureActiveConnection=function(){if(!this.connection.isActive())return this.connection.open()},t}()}).call(this)}).call(this),t.exports?t.exports=r:void 0===(i="function"==typeof(o=r)?o.call(n,e,n,t):o)||(t.exports=i)}).call(this)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.