All Downloads are FREE. Search and download functionalities are using the official Maven repository.

static.vendor.altair.11-es2018.js Maven / Gradle / Ivy

(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{"+R79":function(t,n,e){"use strict";e.r(n),e.d(n,"ActionCableSubscriptionProvider",function(){return c});var o=e("1CyG"),i=e("HDdC"),r=e("9e53"),s=e.n(r);class c extends o.a{execute(t){const n=s.a.createConsumer(this.subscriptionUrl);return new i.a(e=>{this.subscription=n.subscriptions.create(Object.assign({},{channel:this.connectionParams.channel||"GraphqlChannel",channelId:Math.round(Date.now()+1e5*Math.random()).toString(16)},{}),{connected:function(){this.perform("execute",t)},received:function(t){(t.result.data||t.result.errors)&&e.next(t.result),t.more||e.complete()}})})}close(){var t;null===(t=this.subscription)||void 0===t||t.unsubscribe()}}},"9e53":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(){return this.pollTimeout=setTimeout((t=this,function(){return t.reconnectIfStale(),t.poll()}),this.getPollInterval());var t},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)=0},e.prototype.isState=function(){var t,n;return n=1<=arguments.length?i.call(arguments,0):[],t=this.getState(),s.call(n,t)>=0},e.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},e.prototype.installEventHandlers=function(){var t,n;for(t in this.events)n=this.events[t].bind(this),this.webSocket["on"+t]=n},e.prototype.uninstallEventHandlers=function(){var t;for(t in this.events)this.webSocket["on"+t]=function(){}},e.prototype.events={message:function(n){var e,o,i;if(this.isProtocolSupported())switch(e=(i=JSON.parse(n.data)).identifier,o=i.message,i.type){case t.welcome:return this.monitor.recordConnect(),this.subscriptions.reload();case t.ping:return this.monitor.recordPing();case t.confirmation:return this.subscriptions.notify(e,"connected");case t.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")}},e}()}).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,o;return o=new r.Subscription(this.consumer,"object"==typeof(e=t)?e:{channel:e},n),this.add(o)},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(i=[],n=0,e=(o=this.findAll(t)).length;n




© 2015 - 2024 Weber Informatics LLC | Privacy Policy