1(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){"use strict";var message_utils=require("./message-utils");module.exports=MessageBuffer;function MessageBuffer(){this._messages=[];this._startIndex=0;this._messageId=0}MessageBuffer.prototype.write=function(msg){msg=message_utils.formatId(this._messageId++)+"#"+msg;this._messages.push(msg);return msg};MessageBuffer.prototype.handleACK=function(msg){var ackId=message_utils.parseACK(msg);if(ackId===null){return-1}return this.discard(ackId)};MessageBuffer.prototype.discard=function(nextId){var keepIdx=nextId-this._startIndex;if(keepIdx<0){throw new Error("Discard position id too small")}if(keepIdx>this._messages.length){throw new Error("Discard position id too big")}this._messages=this._messages.slice(keepIdx);this._startIndex=nextId;return keepIdx};MessageBuffer.prototype.nextId=function(){return this._messageId};MessageBuffer.prototype.getMessagesFrom=function(startId){var from=startId-this._startIndex;if(from<0){throw new Error("Message buffer underrun detected")}if(from>this._messages.length){throw new Error("Message id larger than expected")}return this._messages.slice(from)}},{"./message-utils":3}],2:[function(require,module,exports){"use strict";var message_utils=require("./message-utils");module.exports=MessageReceiver;function MessageReceiver(ackTimeout){this._pendingMsgId=0;this._ackTimer=null;this._ackTimeout=ackTimeout||2e3;this.onacktimeout=function(e){}}MessageReceiver.parseId=parseId;function parseId(str){return parseInt(str,16)}MessageReceiver.prototype.receive=function(msg){var self=this;var result=message_utils.parseTag(msg);if(!result){throw new Error("Invalid robust-message, no msg-id found")}this._pendingMsgId=result.id+1;if(!this._ackTimer){this._ackTimer=setTimeout(function(){self._ackTimer=null;self.onacktimeout({messageId:self._pendingMessageId})},this._ackTimeout)}return result.data};MessageReceiver.prototype.nextId=function(){return this._pendingMsgId};MessageReceiver.prototype.ACK=function(){return"ACK "+message_utils.formatId(this._pendingMsgId)};MessageReceiver.prototype.CONTINUE=function(){return"CONTINUE "+message_utils.formatId(this._pendingMsgId)}},{"./message-utils":3}],3:[function(require,module,exports){"use strict";exports.formatId=formatId;function formatId(id){return id.toString(16).toUpperCase()}exports.parseId=parseId;function parseId(str){return parseInt(str,16)}exports.parseTag=function(val){var m=/^([\dA-F]+)#([\s\S]*)$/.exec(val);if(!m){return null}return{id:parseId(m[1]),data:m[2]}};exports.parseCONTINUE=function(val){var m=/^CONTINUE ([\dA-F]+)$/.exec(val);if(!m){return null}return parseId(m[1])};exports.parseACK=function(val){var m=/^ACK ([\dA-F]+)$/.exec(val);if(!m){return null}return parseId(m[1])}},{}],4:[function(require,module,exports){"use strict";var assert=require("assert");exports.addPathParams=function(url,params){var pathFragment="";for(var key in params){if(params.hasOwnProperty(key)){if(!/^\w*$/.test(key)||!/^\w*$/.test(params[key])){throw new Error("util.addPathParams doesn't implement escaping")}pathFragment+="/"+key+"="+params[key]}}return url.replace(/\/?(\?|$)/,pathFragment+"$1")};function parseUrl(url){var urlParts=/^([^?]*)(\?.*)?$/.exec(url);assert(urlParts);var mainUrl=urlParts[1];var search=urlParts[2]||"";var chunks=mainUrl.split(/\//);var firstParamIndex=chunks.length;var lastParamIndex;var seenParam=false;while(firstParamIndex>0){var prevChunk=chunks[firstParamIndex-1];if(/^[a-z]+=/i.test(prevChunk)){if(!lastParamIndex)lastParamIndex=firstParamIndex;seenParam=true;firstParamIndex--}else if(!seenParam){firstParamIndex--}else{break}}if(!seenParam){return{prefix:chunks,params:[],suffix:[],search:search}}assert(firstParamIndex>=0&&firstParamIndex<=chunks.length);assert(lastParamIndex>=0&&firstParamIndex<=chunks.length);return{prefix:chunks.slice(0,firstParamIndex),params:chunks.slice(firstParamIndex,lastParamIndex),suffix:chunks.slice(lastParamIndex),search:search}}function formatUrl(urlObj){var url=[].concat(urlObj.prefix).concat(urlObj.params).concat(urlObj.suffix).join("/");return url+urlObj.search}exports.reorderPathParams=function(url,order){var urlObj=parseUrl(url);var params=urlObj.params.filter(function(v){return v.length>0});var frontParams=[];for(var i=0;i<params.length;i++){var m=/^(.+)=(.*)$/.exec(params[i]);assert(m);var desiredOrder=order.indexOf(m[1]);if(desiredOrder>=0){frontParams[desiredOrder]=params[i];delete params[i]}}urlObj.params=frontParams.concat(params).filter(function(v){return typeof v!=="undefined"});return formatUrl(urlObj)};exports.extractParams=function(url){var urlObj=parseUrl(url);var result={};for(var i=0;i<urlObj.params.length;i++){var m=/^(.+?)=(.*)$/.exec(urlObj.params[i]);result[m[1]]=m[2]}return result}},{assert:26}],5:[function(require,module,exports){"use strict";module.exports=function(msg){if(typeof console!=="undefined"&&!module.exports.suppress){console.log(new Date+" [DBG]: "+msg)}};module.exports.suppress=false},{}],6:[function(require,module,exports){"use strict";module.exports=BaseConnectionDecorator;function BaseConnectionDecorator(conn){this._conn=conn;conn.onopen=this._handleOpen.bind(this);conn.onmessage=this._handleMessage.bind(this);conn.onerror=this._handleError.bind(this);
1conn.onclose=this._handleClose.bind(this)}BaseConnectionDecorator.prototype.send=function(data){this._conn.send(data)};BaseConnectionDecorator.prototype.close=function(code,reason){return this._conn.close.apply(this._conn,arguments)};BaseConnectionDecorator.prototype._handleOpen=function(){if(this.onopen){this.onopen.apply(this,arguments)}};BaseConnectionDecorator.prototype._handleMessage=function(){if(this.onmessage){this.onmessage.apply(this,arguments)}};BaseConnectionDecorator.prototype._handleError=function(){if(this.onerror){this.onerror.apply(this,arguments)}};BaseConnectionDecorator.prototype._handleClose=function(){if(this.onclose){this.onclose.apply(this,arguments)}};Object.defineProperty(BaseConnectionDecorator.prototype,"readyState",{get:function readyState(){return this._conn.readyState}});Object.defineProperty(BaseConnectionDecorator.prototype,"url",{get:function readyState(){return this._conn.url}});Object.defineProperty(BaseConnectionDecorator.prototype,"protocol",{get:function readyState(){return this._conn.protocol}});Object.defineProperty(BaseConnectionDecorator.prototype,"extensions",{get:function readyState(){return this._conn.extensions}})},{}],7:[function(require,module,exports){"use strict";var EventEmitter=require("events").EventEmitter;var inherits=require("inherits");module.exports=ConnectionContext;function ConnectionContext(){EventEmitter.call(this)}inherits(ConnectionContext,EventEmitter)},{events:30,inherits:31}],8:[function(require,module,exports){"use strict";var BaseConnectionDecorator=require("./base-connection-decorator");exports.decorate=function(factory,options){return function(url,ctx,callback){factory(url,ctx,function(err,conn){var wrapper=new BaseConnectionDecorator(conn);conn.onclose=function(e){ctx.emit("disconnect",e);if(wrapper.onclose){wrapper.onclose.apply(wrapper,arguments)}};callback(err,wrapper)})}}},{"./base-connection-decorator":6}],9:[function(require,module,exports){(function(global){"use strict";var BaseConnectionDecorator=require("./base-connection-decorator");var debug=require("../debug");function extendSession(){global.jQuery.ajax("__extendsession__",{type:"POST",async:true}).done(function(){debug("__extendsession__ succeeded")}).fail(function(){debug("__extendsession__ failed")})}exports.decorate=function(factory,options){return function(url,ctx,callback){var duration=options.extendSessionInterval||5*60*1e3;var handle=null;factory(url,ctx,function(err,conn){if(!err){handle=setInterval(extendSession,duration)}var wrapper=new BaseConnectionDecorator(conn);conn.onclose=function(){clearInterval(handle);handle=null;if(wrapper.onclose)wrapper.onclose.apply(wrapper,arguments)};callback(err,wrapper)})}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"../debug":5,"./base-connection-decorator":6}],10:[function(require,module,exports){(function(global){"use strict";var MultiplexClient=require("../multiplex-client");var util=require("../util");var PromisedConnection=require("../promised-connection");var pathParams=require("../../common/path-params");exports.decorate=function(factory,options){return function(url,ctx,callback){var multiplexClientPromise=util.promise();if(options.subappTag){url=pathParams.addPathParams(url,{s:0})}ctx.multiplexClient={open:function open(relUrl){var pc=new PromisedConnection;multiplexClientPromise.then(function(client){var urlWithParams=pathParams.addPathParams(relUrl,{s:1});pc.resolve(null,client.open(urlWithParams))}).then(null,function(err){pc.resolve(err)});return pc}};return factory(url,ctx,function(err,conn){if(err){callback(err);return}var m=/\/([^\/]+)$/.exec(global.location.pathname);var relUrl=m?m[1]:"";try{var client=new MultiplexClient(conn);callback(null,client.open(relUrl));multiplexClientPromise(true,[client])}catch(e){multiplexClientPromise(false,[e]);callback(e)}})}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"../../common/path-params":4,"../multiplex-client":17,"../promised-connection":18,"../util":24}],11:[function(require,module,exports){"use strict";var assert=require("assert");var EventEmitter=require("events").EventEmitter;var inherits=require("inherits");var debug=require("../debug");var log=require("../log");var util=require("../util");var WebSocket=require("../websocket");var BaseConnectionDecorator=require("./base-connection-decorator");var MessageBuffer=require("../../common/message-buffer");var MessageReceiver=require("../../common/message-receiver");var message_utils=require("../../common/message-utils");var pathParams=require("../../common/path-params");function generateId(size){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";var id="";for(var i=0;i<size;i++){var rnum=Math.floor(Math.random()*chars.length);id+=chars.substring(rnum,rnum+1)}return id}exports.decorate=function(factory,options){return function(url,ctx,callback){var robustId=generateId(18);var timeout=options.reconnectTimeout;if(typeof timeout==="undefined"){timeout=15e3}var connectErrorDelay=options.connectErrorDelay;if(typeof connectErrorDelay==="undefined"){connectErrorDelay=500}var conn=new RobustConnection(timeout,factory,url,ctx,robustId,connectErrorDelay);conn=new BufferedResendConnection(conn);callback(null,conn)}};function promisify_p(conn){var promise=util.promise();if(conn.readyState===WebSocket.OPEN){promise(true,[conn])}else if(conn.readyState===WebSocket.CLOSING||conn.readyState===WebSocket.CLOSED){promise(false,[new Error("WebSocket was closed")]
1)}else if(conn.readyState===WebSocket.CONNECTING){conn.onopen=function(){conn.onopen=null;conn.onclose=null;conn.onerror=null;promise(true,[new util.PauseConnection(conn)])};conn.onerror=function(e){conn.onopen=null;conn.onclose=null;conn.onerror=null;promise(false,[new Error("WebSocket errored"),e])};conn.onclose=function(e){conn.onopen=null;conn.onclose=null;conn.onerror=null;promise(false,[new Error("WebSocket closed"),e])}}else{throw new Error("Unexpected WebSocket readyState: "+conn.readyState)}return promise}function RobustConnection(timeout,factory,url,ctx,robustId,connectErrorDelay){this._timeout=timeout;this._factory=factory;this._url=url;this.url=url;this._ctx=ctx;this._robustId=robustId;this._connectErrorDelay=connectErrorDelay;this._conn=null;this._stayClosed=false;this.onopen=this.onclose=this.onerror=this.onmessage=function(){};this._setReadyState(WebSocket.CONNECTING);this._connect(this._timeout)}RobustConnection.prototype._setReadyState=function(value){if(typeof this.readyState!=="undefined"&&this.readyState>value){throw new Error("Invalid readyState transition: "+this.readyState+" to "+value)}this.readyState=value};RobustConnection.prototype._acceptConn=function(conn){assert(!this._conn||this._conn.readyState>WebSocket.OPEN,"_acceptConn called while previous conn was still active");assert(conn.readyState===WebSocket.OPEN,"_acceptConn called with non-open conn: "+conn.readyState);assert(this.readyState===WebSocket.CONNECTING||this.readyState===WebSocket.OPEN,"_acceptConn called while readyState was "+this.readyState);this._conn=conn;this._conn.onclose=this._handleClose.bind(this);this._conn.onmessage=this._handleMessage.bind(this);this._conn.onerror=this._handleError.bind(this);this.protocol=conn.protocol;this.extensions=conn.extensions;this.url=conn.url;if(this.readyState===WebSocket.CONNECTING){this._setReadyState(WebSocket.OPEN);if(this.onopen)this.onopen(util.createEvent("open"))}else{log("Connection restored");this.onreconnect(util.createEvent("reconnect"))}};RobustConnection.prototype._clearConn=function(){if(this._conn){this._conn.onopen=null;this._conn.onclose=null;this._conn.onerror=null;this._conn.onmessage=null;this._conn=null}};RobustConnection.prototype._connect=function(timeoutMillis){var _this=this;assert(!this._conn,"_connect called but _conn is not null");assert(this.readyState<=WebSocket.OPEN,"_connect called from wrong readyState");var open_p=function open_p(){var params={};params[_this.readyState===WebSocket.CONNECTING?"n":"o"]=_this._robustId;var url=pathParams.addPathParams(_this._url,params);var promise=util.promise();var connectErrorDelay=_this._connectErrorDelay;_this._factory(url,_this._ctx,function(err,conn){if(err){setTimeout(function(){promise(false,[err])},connectErrorDelay);return}promisify_p(conn).then(function(){promise(true,arguments)},function(){var args=arguments;setTimeout(function(){promise(false,args)},connectErrorDelay)}).done()});return promise};var expires=this.readyState!==WebSocket.OPEN?0:Date.now()+timeoutMillis;var progressCallbacks=new EventEmitter;if(this.readyState===WebSocket.OPEN){progressCallbacks.on("schedule",function(delay){_this._ctx.emit("reconnect-schedule",delay)});progressCallbacks.on("attempt",function(){_this._ctx.emit("reconnect-attempt")});progressCallbacks.on("success",function(){_this._ctx.emit("reconnect-success")});progressCallbacks.on("failure",function(){_this._ctx.emit("reconnect-failure")})}function doReconnect(){progressCallbacks.emit("retry-now")}this._ctx.on("do-reconnect",doReconnect);util.retryPromise_p(open_p,util.createNiceBackoffDelayFunc(),expires,progressCallbacks).then(function(conn){_this._ctx.removeListener("do-reconnect",doReconnect);assert(!_this._conn,"Connection promise fulfilled, but _conn was not null!");if(_this.readyState===WebSocket.CLOSED){conn.close();return}_this._acceptConn(conn);conn.resume()},function(err){log(err);_this._ctx.removeListener("do-reconnect",doReconnect);assert(!_this._conn,"Connection promise rejected, but _conn was not null!");if(_this.readyState===WebSocket.CLOSED){return}
1try{if(_this.readyState===WebSocket.CONNECTING){_this.onerror(util.createEvent("error"))}}finally{_this.close(1006,"",false)}}).done()};RobustConnection.prototype._handleClose=function(e){this._clearConn();if(!this._stayClosed&&(!e.wasClean||e.code>=4600&&e.code<4700)){log("Disconnect detected; attempting reconnect");this.ondisconnect(util.createEvent("disconnect"));this._connect(this._timeout)}else{this._setReadyState(WebSocket.CLOSED);this.onclose(e);this._ctx.emit("disconnect",e)}};RobustConnection.prototype._handleMessage=function(e){if(this.onmessage)this.onmessage(e)};RobustConnection.prototype._handleError=function(e){if(this.onerror)this.onerror(e)};RobustConnection.prototype.send=function(data){if(this.readyState===WebSocket.CONNECTING){throw new Error("Can't send when connection is in CONNECTING state")}else if(this.readyState>WebSocket.OPEN){throw new Error("Connection is already CLOSING or CLOSED")}else if(!this._conn){throw new Error("Can't send when connection is disconnected")}this._conn.send(data)};RobustConnection.prototype.close=function(code,reason){if(this.readyState===WebSocket.CLOSED){return}if(this._conn){try{this._stayClosed=true;this._conn.close(code,reason)}catch(e){this._stayClosed=false;throw e}this._setReadyState(Math.max(this.readyState,WebSocket.CLOSING))}else{this._setReadyState(WebSocket.CLOSED);if(this.onclose){this.onclose(util.createEvent("close",{currentTarget:this,target:this,srcElement:this,code:code,reason:reason,wasClean:false}))}}};function BufferedResendConnection(conn){var _this2=this;BaseConnectionDecorator.call(this,conn);assert(this._conn);assert(conn.constructor===RobustConnection);this._messageBuffer=new MessageBuffer;this._messageReceiver=new MessageReceiver;this._messageReceiver.onacktimeout=function(){if(_this2._conn.readyState===WebSocket.OPEN&&!_this2._disconnected){_this2._conn.send(_this2._messageReceiver.ACK())}};this._disconnected=false;conn.onopen=this._handleOpen.bind(this);conn.onmessage=this._handleMessage.bind(this);conn.onerror=this._handleError.bind(this);conn.onclose=this._handleClose.bind(this);conn.ondisconnect=this._handleDisconnect.bind(this);conn.onreconnect=this._handleReconnect.bind(this)}inherits(BufferedResendConnection,BaseConnectionDecorator);BufferedResendConnection.prototype._handleDisconnect=function(){this._disconnected=true};BufferedResendConnection.prototype._handleReconnect=function(){var _this3=this;this._conn.send(this._messageReceiver.CONTINUE());this._conn.onmessage=function(e){if(message_utils.parseACK(e.data)!==null){return}_this3._disconnected=false;_this3._conn.onmessage=_this3._handleMessage.bind(_this3);try{var continueId=message_utils.parseCONTINUE(e.data);if(continueId===null){throw new Error("The RobustConnection handshake failed, CONTINUE expected")}else{debug("Discard and continue from message "+continueId);_this3._messageBuffer.discard(continueId);var msgs=_this3._messageBuffer.getMessagesFrom(continueId);if(msgs.length>0)debug(msgs.length+" messages were dropped; resending");msgs.forEach(function(msg){_this3._conn.send(msg)})}}catch(err){log("Error: RobustConnection handshake error: "+err);log(err.stack);_this3.close(3007,"RobustConnection handshake error: "+err)}}};BufferedResendConnection.prototype._handleMessage=function(e){try{var ackResult=this._messageBuffer.handleACK(e.data);if(ackResult>=0){debug(ackResult+" message(s) discarded from buffer");return}}catch(err){log("Error: ACK handling failed: "+err);log(err.stack);this.close(3008,"ACK handling failed: "+err);return}e.data=this._messageReceiver.receive(e.data);if(this.onmessage){this.onmessage.apply(this,arguments)}};BufferedResendConnection.prototype.send=function(data){if(typeof data==="undefined"||data===null){throw new Error("data argument must not be undefined or null")}data=this._messageBuffer.write(data);if(!this._disconnected)this._conn.send(data)}},{"../../common/message-buffer":1,"../../common/message-receiver":2,"../../common/message-utils":3,"../../common/path-params":4,"../debug":5,"../log":15,"../util":24,"../websocket":25,"./base-connection-decorator":6,assert:26,events:30,inherits:31}],12:[function(require,module,exports){(function(global){"use strict";var pathParams=require("../../common/path-params");exports.decorate=function(factory,options){return function(url,ctx,callback){if(!exports.ajax){throw new Error("No HTTP transport was provided")}
1exports.ajax("__token__",{type:"GET",cache:false,dataType:"text",success:function success(data,textStatus){var newUrl=pathParams.addPathParams(url,{t:data});factory(newUrl,ctx,callback)},error:function error(jqXHR,textStatus,errorThrown){callback(new Error("Failed to retrieve token: "+errorThrown))}})}};exports.ajax=null;if(typeof global.jQuery!=="undefined"){exports.ajax=global.jQuery.ajax}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"../../common/path-params":4}],13:[function(require,module,exports){(function(global){"use strict";var pathParams=require("../../common/path-params");exports.decorate=function(factory,options){return function(url,ctx,callback){if(!global.location){return factory(url,ctx,callback)}var search=global.location.search.replace(/^\?/,"");var worker="";if(search.match(/\bw=[^&]+/)){worker=search.match(/\bw=[^&]+/)[0].substring(2)}if(!worker){var base=global.jQuery("base").attr("href")||global.location.href;var mtch=base.match(/_w_(\w+)\//);base=mtch[1];if(base){base=base.replace(/\/$/,"");base=base.replace(/^_w_/,"");worker=base}}if(worker){url=pathParams.addPathParams(url,{w:worker})}return factory(url,ctx,callback)}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"../../common/path-params":4}],14:[function(require,module,exports){"use strict";var assert=require("assert");module.exports=fixupUrl;function fixupUrl(href,location){var origHref=href;href=href.replace(/\/_w_[a-f0-9]+\//g,"/");if(href===origHref){return origHref}var m=/^([^#?]*)(\?[^#]*)?(#.*)?$/.exec(href);assert(m);var base=m[1]||"";var search=m[2]||"";var hash=m[3]||"";if(base!==location.origin+location.pathname){return origHref}if(!search){search=location.search}return base+search+hash}},{assert:26}],15:[function(require,module,exports){"use strict";module.exports=function(msg){if(typeof console!=="undefined"&&!module.exports.suppress){console.log(new Date+" [INF]: "+msg)}};module.exports.suppress=false},{}],16:[function(require,module,exports){(function(global){"use strict";var assert=require("assert");var fixupUrl=require("./fixup-url");var log=require("./log");var token=require("./decorators/token");var subapp=require("./subapp");var extendSession=require("./decorators/extend-session");var reconnect=require("./decorators/reconnect");var disconnect=require("./decorators/disconnect");var multiplex=require("./decorators/multiplex");var workerId=require("./decorators/worker-id");var sockjs=require("./sockjs");var PromisedConnection=require("./promised-connection");var ConnectionContext=require("./decorators/connection-context");var ReconnectUI=require("./reconnect-ui");var ui=require("./ui");var ProtocolChooser=require("./protocol-chooser");var reconnectUI=new ReconnectUI;function initSession(shiny,options,shinyServer){if(subapp.isSubApp()){shiny.createSocket=function(){return subapp.createSocket()}}else{ProtocolChooser.init(shinyServer,options.disableProtocols);var factory=sockjs.createFactory(ProtocolChooser,options);if(options.workerId){factory=workerId.decorate(factory,options)}if(options.token){factory=token.decorate(factory,options)}if(options.reconnect){factory=reconnect.decorate(factory,options)}else{factory=disconnect.decorate(factory,options)}if(options.extendSession){factory=extendSession.decorate(factory,options)}factory=multiplex.decorate(factory,options);shiny.createSocket=function(){var url=location.protocol+"//"+location.host+location.pathname.replace(/\/[^\/]*$/,"");url+="/__sockjs__/";reconnectUI.hide();var ctx=new ConnectionContext;var doReconnectHandler=function doReconnectHandler(){ctx.emit("do-reconnect")};reconnectUI.on("do-reconnect",doReconnectHandler);if(reconnectUI.listenerCount("do-reconnect")>1){log("do-reconnect handlers are leaking!")}ctx.on("reconnect-schedule",function(delay){reconnectUI.showCountdown(delay)});ctx.on("reconnect-attempt",function(){reconnectUI.showAttempting()});ctx.on("reconnect-success",function(){reconnectUI.hide()});var onDisconnected=function onDisconnected(){reconnectUI.removeListener("do-reconnect",doReconnectHandler);reconnectUI.showDisconnected()};ctx.on("reconnect-failure",onDisconnected);ctx.on("disconnect",onDisconnected);var pc=new PromisedConnection;factory(url,ctx,function(err,conn){pc.resolve(err,conn)});assert(ctx.multiplexClient);shinyServer.multiplexer=ctx.multiplexClient;pc.allowReconnect=true;ctx.on("disconnect",function(e){if(e.code&&e.code>=4700&&e.code<4800){pc.allowReconnect=true}else{pc.allowReconnect=false}});return pc}}}global.preShinyInit=function(options){if(options.fixupInternalLinks&&!subapp.isSubApp()){global.jQuery(function(){fixupInternalLinks()})}if(!global.Shiny){return}global.ShinyServer=global.ShinyServer||{};initSession(global.Shiny,options,global.ShinyServer);if(!subapp.isSubApp()){global.Shiny.oncustommessage=function(message){if(message.license)ui.onLicense(global.Shiny,message.license);if(message.credentials)ui.onLoggedIn(message.credentials);if(typeof message==="string"&&console.log)console.log(message);if(message.alert&&console.log)console.log(message.alert);if(message.console&&console.log)console.log(message.console)}}};global.fixupInternalLinks=fixupInternalLinks;function fixupInternalLinks(){global.jQuery("body").on("click","a",function(ev){assert(!subapp.isSubApp());if(ev.currentTarget.href===null||!ev.currentTarget.href){return}var href=fixupUrl(ev.currentTarget.href,global.location);if(href===ev.currentTarget.href){return}ev.currentTarget.href=href})}global.Shiny.createSocket=function(){throw new Error("shiny-server-client was loaded but preShinyInit() was not called")}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./decorators/connection-context":7,"./decorators/disconnect":8,"./decorators/extend-session":9,"./decorators/multiplex":10,"./decorators/reconnect":11,"./decorators/token":12,"./decorators/worker-id":13,"./fixup-url":14,"./log":15,"./promised-connection":18,"./protocol-chooser":19,"./reconnect-ui":20,"./sockjs":21,"./subapp":22,"./ui":23,assert:26}],17:[function(require,module,exports){(function(global){"use strict";var log=require("./log");var debug=require("./debug");module.exports=MultiplexClient;function MultiplexClient(conn){var _this=this;this._conn=conn;this._channels={};this._channelCount=0;this._nextId=0;this._pendingChannels=[];
1this.onclose=[];this._conn.onopen=function(){log("Connection opened. "+global.location.href);var channel=void 0;while(channel=_this._pendingChannels.shift()){if(channel.readyState===0){channel._open()}else{debug("NOT opening channel "+channel.id)}}};this._conn.onclose=function(e){log("Connection closed. Info: "+JSON.stringify(e));debug("SockJS connection closed");for(var key in _this._channels){if(_this._channels.hasOwnProperty(key)){_this._channels[key]._destroy(e)}}for(var i=0;i<_this.onclose.length;i++){_this.onclose[i]()}};this._conn.onmessage=function(e){var msg=parseMultiplexData(e.data);if(!msg){log("Invalid multiplex packet received from server");_this._conn.close();return}var id=msg.id;var method=msg.method;var payload=msg.payload;var channel=_this._channels[id];if(!channel){log("Multiplex channel "+id+" not found");return}if(method==="c"){_this._conn.close(payload.code,payload.reason)}else if(method==="m"){channel.onmessage({data:payload})}}}MultiplexClient.prototype.open=function(url){var channel=new MultiplexClientChannel(this,this._nextId+++"",this._conn,url);this._channels[channel.id]=channel;this._channelCount++;switch(this._conn.readyState){case 0:this._pendingChannels.push(channel);break;case 1:setTimeout(function(){channel._open()},0);break;default:setTimeout(function(){channel.close()},0);break}return channel};MultiplexClient.prototype.removeChannel=function(id){delete this._channels[id];this._channelCount--;debug("Removed channel "+id+", "+this._channelCount+" left");if(this._channelCount===0&&this._conn.readyState<2){debug("Closing SockJS connection since no channels are left");this._conn.close()}};function MultiplexClientChannel(owner,id,conn,url){this._owner=owner;this.id=id;this.conn=conn;this.url=url;this.readyState=0;this.onopen=function(){};this.onclose=function(){};this.onmessage=function(){}}MultiplexClientChannel.prototype._open=function(parentURL){debug("Open channel "+this.id);this.readyState=1;this.conn.send(formatOpenEvent(this.id,this.url));if(this.onopen)this.onopen()};MultiplexClientChannel.prototype.send=function(data){if(this.readyState===0)throw new Error("Invalid state: can't send when readyState is 0");if(this.readyState===1)this.conn.send(formatMessage(this.id,data))};MultiplexClientChannel.prototype.close=function(code,reason){if(this.readyState>=2)return;debug("Close channel "+this.id);if(this.conn.readyState===1){this.conn.send(formatCloseEvent(this.id,code,reason))}this._destroy({code:code,reason:reason,wasClean:true})};MultiplexClientChannel.prototype._destroy=function(e){var _this2=this;if(this.readyState!==3){this.readyState=3;debug("Channel "+this.id+" is closed");setTimeout(function(){_this2._owner.removeChannel(_this2.id);if(_this2.onclose)_this2.onclose(e)},0)}};function formatMessage(id,message){return id+"|m|"+message}function formatOpenEvent(id,url){return id+"|o|"+url}function formatCloseEvent(id,code,reason){return id+"|c|"+JSON.stringify({code:code,reason:reason})}function parseMultiplexData(msg){try{var m=/^(\d+)\|(m|o|c)\|([\s\S]*)$/m.exec(msg);if(!m)return null;msg={id:m[1],method:m[2],payload:m[3]};switch(msg.method){case"m":break;case"o":if(msg.payload.length===0)return null;break;case"c":try{msg.payload=JSON.parse(msg.payload)}catch(e){return null}break;default:return null}return msg}catch(e){log("Error parsing multiplex data: "+e);return null}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./debug":5,"./log":15}],18:[function(require,module,exports){"use strict";var util=require("./util");var WebSocket=require("./websocket");module.exports=PromisedConnection;function PromisedConnection(){this._conn=null;this._closed=false}PromisedConnection.prototype.resolve=function(err,conn){var _this=this;if(err){this._closed=true}this._conn=conn;if(this._closed){this._conn.close.apply(this._conn,this._closed)}else{this._conn.onclose=function(evt){if(_this.onclose)_this.onclose(evt)};this._conn.onopen=function(evt){if(_this.onopen)_this.onopen(evt)};this._conn.onmessage=function(evt){if(_this.onmessage)_this.onmessage(evt)};
1this._conn.onerror=function(evt){if(_this.onerror)_this.onerror(evt)}}};PromisedConnection.prototype.close=function(code,reason){var _this2=this;if(this._closed){return}this._closed=arguments;if(this._conn){this._conn.close.apply(this._conn,arguments)}else{setTimeout(function(){if(_this2.onclose){var evt=util.createEvent("close",{currentTarget:_this2,target:_this2,srcElement:_this2,code:code||1005,reason:reason||"",wasClean:true});_this2.onclose(evt)}},0)}};PromisedConnection.prototype.send=function(data){if(this._conn){return this._conn.send(data)}else if(this.readyState===WebSocket.CONNECTING){throw new Error("Can't execute 'send' on 'WebSocket' when in CONNECTING state.")}else if(this.readyState===WebSocket.CLOSED){throw new Error("Can't execute 'send' on 'WebSocket' when in CLOSED state.")}else if(this.readyState===WebSocket.CLOSING){throw new Error("Can't execute 'send' on 'WebSocket' when in CLOSING state.")}else{throw new Error("Unexpected PromisedConnection readyState "+this.readyState)}};PromisedConnection.prototype._getConnProperty=function(prop,ifPending,ifFailed){if(!this._conn&&this._closed){return ifFailed}else if(this._conn){return this._conn[prop]}else{return ifPending}};Object.defineProperty(PromisedConnection.prototype,"readyState",{get:function readyState(){if(this._closed)return WebSocket.CLOSED;else return this._getConnProperty("readyState",WebSocket.CONNECTING,WebSocket.CLOSED)}});Object.defineProperty(PromisedConnection.prototype,"protocol",{get:function protocol(){return this._getConnProperty("readyState","","")}});Object.defineProperty(PromisedConnection.prototype,"extensions",{ 2get:function protocol(){return this._getConnProperty("extensions","","")}})},{"./util":24,"./websocket":25}],19:[function(require,module,exports){(function(global){"use strict";var whitelist=[];Object.defineProperty(exports,"whitelist",{get:function get(){return whitelist}});exports.init=function(shinyServer,disableProtocols){var $=global.jQuery;function supports_html5_storage(){try{return"localStorage"in window&&window["localStorage"]!==null}catch(e){return false}}var availableOptions=["websocket","xdr-streaming","xhr-streaming","iframe-eventsource","iframe-htmlfile","xdr-polling","xhr-polling","iframe-xhr-polling","jsonp-polling"];if(/\bEdge\//.test(window.navigator.userAgent)){availableOptions.splice($.inArray("xhr-streaming",availableOptions),1)}var store=null;if(supports_html5_storage()){store=window.localStorage;var whitelistStr=store["shiny.whitelist"];if(!whitelistStr||whitelistStr===""){whitelist=availableOptions}else{whitelist=JSON.parse(whitelistStr);$.each(whitelist,function(i,p){if($.inArray(p,availableOptions)===-1){whitelist.splice($.inArray(p,whitelist),1)}})}}if(whitelist.length==0){whitelist=availableOptions}var networkSelectorVisible=false;var networkSelector=undefined;var networkOptions=undefined;function buildNetworkSelector(){networkSelector=$('<div style="top: 50%; left: 50%; position: absolute; z-index: 99999;">'+'<div style="position: relative; width: 300px; margin-left: -150px; padding: .5em 1em 0 1em; height: 400px; margin-top: -190px; background-color: #FAFAFA; border: 1px solid #CCC; font.size: 1.2em;">'+"<h3>Select Network Methods</h3>"+'<div id="ss-net-opts"></div>'+'<div id="ss-net-prot-warning" style="color: #44B">'+(supports_html5_storage()?"":"These network settings can only be configured in browsers that support HTML5 Storage. Please update your browser or unblock storage for this domain.")+"</div>"+'<div style="float: right;">'+'<input type="button" value="Reset" onclick="ShinyServer.enableAll()"></input>'+'<input type="button" value="OK" onclick="ShinyServer.toggleNetworkSelector();" style="margin-left: 1em;" id="netOptOK"></input>'+"</div>"+"</div></div>");networkOptions=$("#ss-net-opts",networkSelector);$.each(availableOptions,function(index,val){var label=$(document.createElement("label")).css({color:$.inArray(val,disableProtocols)>=0?"silver":"",display:"block"});var checkbox=$(document.createElement("input")).attr("type","checkbox").attr("id","ss-net-opt-"+val).attr("name","shiny-server-proto-checkbox").attr("value",index+"").attr("checked",$.inArray(val,whitelist)>=0?"checked":null).attr("disabled",supports_html5_storage()?null:"disabled");label.append(checkbox);label.append(val+" ");networkOptions.append(label);checkbox.on("change",function(evt){shinyServer.setOption(val,$(evt.target).prop("checked"))})})}$(document).keydown(function(event){if(event.shiftKey&&event.ctrlKey&&event.altKey&&event.keyCode==65){toggleNetworkSelector()}});shinyServer.toggleNetworkSelector=toggleNetworkSelector;function toggleNetworkSelector(){if(networkSelectorVisible){networkSelectorVisible=false;networkSelector.hide()}else{if(networkSelector===undefined){buildNetworkSelector();$("body").append(networkSelector)}networkSelectorVisible=true;networkSelector.show()}}shinyServer.enableAll=enableAll;function enableAll(){$("input",networkOptions).each(function(index,val){$(val).prop("checked",true)});$.each(availableOptions,function(index,val){setOption(val,true)})}shinyServer.setOption=setOption;function setOption(option,enabled){$("#ss-net-prot-warning").html("Updated settings will be applied when you refresh your browser or load a new Shiny application.");
2if(enabled&&$.inArray(option,whitelist)===-1){whitelist.push(option)}if(!enabled&&$.inArray(option,whitelist>=0)){if(whitelist.length===1){$("#ss-net-prot-warning").html("You must leave at least one method selected.");$("#ss-net-opt-"+option).prop("checked",true)}else{whitelist.splice($.inArray(option,whitelist),1)}}store["shiny.whitelist"]=JSON.stringify(whitelist)}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],20:[function(require,module,exports){(function(global){"use strict";var EventEmitter=require("events").EventEmitter;var inherits=require("inherits");var $=global.jQuery;var dialogHtml='<div id="ss-connect-dialog" style="display: none;"></div><div id="ss-overlay" class="ss-gray-out" style="display: none;"></div>';var countdownContentsHtml='<label>Reconnect failed. Retrying in <span id="ss-dialog-countdown"></span> seconds...</label> <a id="ss-reconnect-link" href="#" class="ss-dialog-link">Try now</a>';var reconnectContentsHtml="<label>Attempting to reconnect...</label><label> </label>";var disconnectContentsHtml='<label>Disconnected from the server.</label> <a id="ss-reload-link" href="#" class="ss-dialog-link">Reload</a>';module.exports=ReconnectUI;function ReconnectUI(){var _this=this;EventEmitter.call(this);$(function(){var dialog=$(dialogHtml);dialog.appendTo("body");$(document).on("click","#ss-reconnect-link",function(e){e.preventDefault();_this.emit("do-reconnect")});$(document).on("click","#ss-reload-link",function(e){e.preventDefault();window.location.reload()})})}inherits(ReconnectUI,EventEmitter);ReconnectUI.prototype.showCountdown=function(delay){if(delay<200)return;var attemptTime=Date.now()+delay;$("#ss-connect-dialog").html(countdownContentsHtml);$("#ss-connect-dialog").show();function updateCountdown(seconds){if(typeof seconds==="undefined"){seconds=Math.max(0,Math.floor((attemptTime-Date.now())/1e3))+""}$("#ss-dialog-countdown").html(seconds)}updateCountdown(Math.round(delay/1e3));if(delay>15e3){var updateInterval=setInterval(function(){if(Date.now()>attemptTime){clearInterval(updateInterval)}else{updateCountdown()}},15e3)}};ReconnectUI.prototype.showAttempting=function(){$("body").addClass("ss-reconnecting");$("#ss-connect-dialog").html(reconnectContentsHtml);$("#ss-connect-dialog").show()};ReconnectUI.prototype.hide=function(){$("body").removeClass("ss-reconnecting");$("#ss-connect-dialog").hide();$("#ss-overlay").hide()};ReconnectUI.prototype.showDisconnected=function(){$("#ss-connect-dialog").html(disconnectContentsHtml).show();$("#ss-overlay").show();$("body").removeClass("ss-reconnecting");$("#ss-overlay").addClass("ss-gray-out")}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{events:30,inherits:31}],21:[function(require,module,exports){(function(global){"use strict";var log=require("./log");var pathParams=require("../common/path-params");var currConn=null;global.__shinyserverdebug__={interrupt:function interrupt(){log("OK, we'll silently drop messages starting now.");currConn.send=function(data){log("Dropping message "+data)};currConn.onmessage=function(e){log("Ignoring message "+e.data)}},disconnect:function disconnect(){log("OK, we'll simulate a disconnection.");currConn.close(4600)}};exports.createFactory=function(protocolChooser,options){return function(url,context,callback){if(!callback)throw new Error("callback is required");url=pathParams.reorderPathParams(url,["n","o","t","w","s"]);var whitelist=[];protocolChooser.whitelist.forEach(function(prot){if(!options.disableProtocols||options.disableProtocols.indexOf(prot)<0){whitelist.push(prot)}});if(whitelist.length==0){whitelist.push("dummy")}var transportDebugging=options.transportDebugging==true;var sockjsOptions={protocols_whitelist:whitelist,debug:transportDebugging};var conn=new global.SockJS(url,null,sockjsOptions);currConn=conn;callback(null,conn)}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"../common/path-params":4,"./log":15}],22:[function(require,module,exports){(function(global){"use strict";exports.isSubApp=isSubApp;function isSubApp(){var subApp=global.location.search.match(/\?.*__suba
2pp__=(\d)/);return subApp&&subApp[1]}exports.createSocket=createSocket;function createSocket(){if(!window.parent||!window.parent.ShinyServer||!window.parent.ShinyServer.multiplexer){throw new Error("Multiplexer not found in parent")}var relURL=window.frameElement.getAttribute("src");relURL=relURL.replace(/\/?(\?.*|$)/,"/__sockjs__/");return window.parent.ShinyServer.multiplexer.open(relURL)}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],23:[function(require,module,exports){(function(global){"use strict";var $=global.jQuery;exports.onLoggedIn=onLoggedIn;function onLoggedIn(credentials){if(!credentials)return;var user=credentials.user;var str='<div class="shiny-server-account">'+' Logged in as <span class="shiny-server-username"></span>';if(credentials.strategy!=="proxy-auth"){str+=' <a href="__logout__">Logout</a>'}str+="</div>";var div=$(str);div.find(".shiny-server-username").text(user);$("body").append(div)}function formatDate(date){if(!date)return"?/?/????";var months=["January","February","March","April","May","June","July","August","September","October","November","December"];return months[date.getMonth()]+" "+date.getDate()+", "+date.getFullYear()}exports.onLicense=onLicense;function onLicense(Shiny,license){if(!license)return;if(license.status!=="expired"&&license.status!=="grace")return;var noun=license.evaluation?"evaluation":"license";var message="Your Shiny Server "+noun+" expired";if(license.expiration)message+=" on "+formatDate(new Date(license.expiration));message+=".";if(license.status==="expired"){setTimeout(function(){window.alert(message+"\n\n"+"Please purchase and activate a license.")},0);if(Shiny&&Shiny.shinyapp&&Shiny.shinyapp.$socket){Shiny.shinyapp.$socket.close()}}else if(license.status==="grace"){$(".shiny-server-expired").remove();var div=$('<div class="shiny-server-expired">'+"WARNING: "+message+"</div>");$("body").append(div);setTimeout(function(){div.animate({top:-(div.height()+16)},"slow",function(){div.remove()})},8e3)}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],24:[function(require,module,exports){(function(global){"use strict";var log=require("./log");var pinkySwear=require("pinkyswear");exports.createNiceBackoffDelayFunc=function(){var niceBackoff=[0,1,2,3,5];var pos=-1;return function(){pos=Math.min(++pos,niceBackoff.length-1);return niceBackoff[pos]*1e3}};exports.retryPromise_p=function(create_p,delayFunc,expiration,progressCallbacks){if(!progressCallbacks)progressCallbacks={emit:function emit(){}};var promise=exports.promise();var delay=delayFunc();delay=Math.min(delay,expiration-Date.now());delay=Math.max(0,delay);function attempt(){progressCallbacks.removeListener("retry-now",retryNow);progressCallbacks.emit("attempt");create_p().then(function(value){progressCallbacks.emit("success");promise(true,[value])},function(err){if(Date.now()>=expiration){progressCallbacks.emit("failure");promise(false,[err])}else{exports.retryPromise_p(create_p,delayFunc,expiration,progressCallbacks).then(function(){promise(true,arguments)},function(){promise(false,arguments)}).done()}}).done()}var timeoutHandle=setTimeout(attempt,delay);function retryNow(){clearTimeout(timeoutHandle);attempt()}progressCallbacks.on("retry-now",retryNow);progressCallbacks.emit("schedule",delay);return promise};exports.createEvent=function(type,props){if(global.document){try{return new Event(type,props)}catch(e){var evt=global.document.createEvent("Event");evt.initEvent(type,true,false);for(var key in props){evt[key]=props[key]}return evt}}else if(props){props.type=type;return props}else{return{type:type}}};function addDone(prom){prom.done=function(){prom.then(null,function(err){log("Unhandled promise error: "+err);log(err.stack)})};return prom}exports.promise=function(){return pinkySwear(addDone)};exports.PauseConnection=PauseConnection;function PauseConnection(conn){this._conn=conn;this._paused=true;this._events=[];this._timeout=null;this.readyState=conn.readyState;var pauseConnection=this;["onopen","onmessage","onerror","onclose"].forEach(function(evt){conn[evt]=function(){if(pauseConnection._paused){pauseConnection._events.push({event:evt,args:arguments,readyState:conn.readyState})}else{this.readyState=conn.readyState;pauseConnection[evt].apply(this,arguments)}}})}PauseConnection.prototype.resume=function(){var _this=this;this._timeout=setTimeout(function(){while(_this._events.length){var e=_this._events.shift();_this.readyState=e.readyState;_this[e.event].apply(_this,e.args)}_this._paused=false},0)};PauseConnection.prototype.pause=function(){clearTimeout(this._timeout);this._paused=true};PauseConnection.prototype.close=function(){this._conn.close.apply(this._conn,arguments)};PauseConnection.prototype.send=function(){this._conn.send.apply(this._conn,arguments)};Object.defineProperty(PauseConnection.prototype,"url",{get:function get(){return this._conn.url}});Object.defineProperty(PauseConnection.prototype,"protocol",{get:function get(){return this._conn.protocol}});Object.defineProperty(PauseConnection.prototype,"extensions",{get:function get(){return this._conn.extensions}})}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./log":15,pinkyswear:32}],25:[function(require,module,exports){"use strict";exports.CONNECTING=0;exports.OPEN=1;exports.CLOSING=2;exports.CLOSED=3},{}],26:[function(require,module,exports){var util=require("util/");var pSlice=Array.prototype.slice;var hasOwn=Object.prototype.hasOwnProperty;var assert=module.exports=ok;assert.AssertionError=function AssertionError(options){this.name="AssertionError";this.actual=options.actual;this.expected=options.expected;this.operator=options.operator;if(options.message){this.message=options.message;this.generatedMessage=false}else{this.message=getMessage(this);this.generatedMessage=true}var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace){Error.captureStackTrace(this,stackStartFunction)}else{var err=new Error;if(err.stack){var out=err.stack;var fn_name=stackStartFunction.name;var idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}};util.inherits(assert.AssertionError,Error);function replacer(key,value){if(util.isUndefined(value)){return""+value}if(util.isNumber(value)&&!isFinite(value)){return value.toString()}if(util.isFunction(value)||util.isRegExp(value)){return value.toString()}return value}
2function truncate(s,n){if(util.isString(s)){return s.length<n?s:s.slice(0,n)}else{return s}}function getMessage(self){return truncate(JSON.stringify(self.actual,replacer),128)+" "+self.operator+" "+truncate(JSON.stringify(self.expected,replacer),128)}function fail(actual,expected,message,operator,stackStartFunction){throw new assert.AssertionError({message:message,actual:actual,expected:expected,operator:operator,stackStartFunction:stackStartFunction})}assert.fail=fail;function ok(value,message){if(!value)fail(value,true,message,"==",assert.ok)}assert.ok=ok;assert.equal=function equal(actual,expected,message){if(actual!=expected)fail(actual,expected,message,"==",assert.equal)};assert.notEqual=function notEqual(actual,expected,message){if(actual==expected){fail(actual,expected,message,"!=",assert.notEqual)}};assert.deepEqual=function deepEqual(actual,expected,message){if(!_deepEqual(actual,expected)){fail(actual,expected,message,"deepEqual",assert.deepEqual)}};function _deepEqual(actual,expected){if(actual===expected){return true}else if(util.isBuffer(actual)&&util.isBuffer(expected)){if(actual.length!=expected.length)return false;for(var i=0;i<actual.length;i++){if(actual[i]!==expected[i])return false}return true}else if(util.isDate(actual)&&util.isDate(expected)){return actual.getTime()===expected.getTime()}else if(util.isRegExp(actual)&&util.isRegExp(expected)){return actual.source===expected.source&&actual.global===expected.global&&actual.multiline===expected.multiline&&actual.lastIndex===expected.lastIndex&&actual.ignoreCase===expected.ignoreCase}else if(!util.isObject(actual)&&!util.isObject(expected)){return actual==expected}else{return objEquiv(actual,expected)}}function isArguments(object){return Object.prototype.toString.call(object)=="[object Arguments]"}function objEquiv(a,b){if(util.isNullOrUndefined(a)||util.isNullOrUndefined(b))return false;if(a.prototype!==b.prototype)return false;if(util.isPrimitive(a)||util.isPrimitive(b)){return a===b}var aIsArgs=isArguments(a),bIsArgs=isArguments(b);if(aIsArgs&&!bIsArgs||!aIsArgs&&bIsArgs)return false;if(aIsArgs){a=pSlice.call(a);b=pSlice.call(b);return _deepEqual(a,b)}var ka=objectKeys(a),kb=objectKeys(b),key,i;if(ka.length!=kb.length)return false;ka.sort();kb.sort();for(i=ka.length-1;i>=0;i--){if(ka[i]!=kb[i])return false}for(i=ka.length-1;i>=0;i--){key=ka[i];if(!_deepEqual(a[key],b[key]))return false}return true}assert.notDeepEqual=function notDeepEqual(actual,expected,message){if(_deepEqual(actual,expected)){fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)}};assert.strictEqual=function strictEqual(actual,expected,message){if(actual!==expected){fail(actual,expected,message,"===",assert.strictEqual)}};assert.notStrictEqual=function notStrictEqual(actual,expected,message){if(actual===expected){fail(actual,expected,message,"!==",assert.n
2otStrictEqual)}};function expectedException(actual,expected){if(!actual||!expected){return false}if(Object.prototype.toString.call(expected)=="[object RegExp]"){return expected.test(actual)}else if(actual instanceof expected){return true}else if(expected.call({},actual)===true){return true}return false}function _throws(shouldThrow,block,expected,message){var actual;if(util.isString(expected)){message=expected;expected=null}try{block()}catch(e){actual=e}message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:".");if(shouldThrow&&!actual){fail(actual,expected,"Missing expected exception"+message)}if(!shouldThrow&&expectedException(actual,expected)){fail(actual,expected,"Got unwanted exception"+message)}if(shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual){throw actual}}assert.throws=function(block,error,message){_throws.apply(this,[true].concat(pSlice.call(arguments)))};assert.doesNotThrow=function(block,message){_throws.apply(this,[false].concat(pSlice.call(arguments)))};assert.ifError=function(err){if(err){throw err}};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){if(hasOwn.call(obj,key))keys.push(key)}return keys}},{"util/":29}],27:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],28:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],29:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i<arguments.length;i++){objects.push(inspect(arguments[i]))}return objects.join(" ")}var i=1;var args=arguments;var len=args.length;var str=String(f).replace(formatRegExp,function(x){if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i<len;x=args[++i]){if(isNull(x)||!isObject(x)){str+=" "+x}else{str+=" "+inspect(x)}}return str};exports.deprecate=function(fn,msg){if(isUndefined(global.process)){return function(){return exports.deprecate(fn,msg).apply(this,arguments)}}if(process.noDeprecation===true){return fn}var warned=false;function deprecated(){if(!warned){if(process.throwDeprecation){throw new Error(msg)}else if(process.traceDeprecation){console.trace(msg)}else{console.error(msg)}warned=true}return fn.apply(this,arguments)}return deprecated};var debugs={};var debugEnviron;exports.debuglog=function(set){if(isUndefined(debugEnviron))debugEnviron=process.env.NODE_DEBUG||"";set=set.toUpperCase();if(!debugs[set]){if(new RegExp("\\b"+set+"\\b","i").test(debugEnviron)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else{debugs[set]=function(){}}}return debugs[set]};function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};if(arguments.length>=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];
vendor: 9,790 bytes, line 2
2if(style){return"�["+inspect.colors[style][0]+"m"+str+"�["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i<l;++i){if(hasOwnProperty(value,String(i))){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),true))}else{output.push("")}}keys.forEach(function(key){if(!key.match(/^\d+$/)){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,true))}});return output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]};if(desc.get){if(desc.set){str=ctx.stylize("[Getter/Setter]","special")}else{str=ctx.stylize("[Getter]","special")}}else{if(desc.set){str=ctx.stylize("[Setter]","special")}}if(!hasOwnProperty(visibleKeys,key)){name="["+key+"]"}if(!str){if(ctx.seen.indexOf(desc.value)<0){if(isNull(recurseTimes)){str=formatValue(ctx,desc.value,null)}else{str=formatValue(ctx,desc.value,recurseTimes-1)}if(str.indexOf("\n")>-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":28,_process:33,inherits:27}],30:[function(require,module,exports){function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}module.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;EventEmitter.defaultMaxListeners=10;EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");this._maxListeners=n;return this};EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(!this._events)this._events={};if(type==="error"){if(!this._events.error||isObject(this._events.error)&&!this._events.error.length){er=arguments[1];if(er instanceof Error){throw er}else{var err=new Error('Uncaught, unspecified "error" event. ('+er+")");err.context=er;throw err}}}handler=this._events[type];if(isUndefined(handler))return false;if(isFunction(handler)){switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:args=Array.prototype.slice.call(arguments,1);handler.apply(this,args)}}else if(isObject(handler)){args=Array.prototype.slice.call(arguments,1);listeners=handler.slice();len=listeners.length;for(i=0;i<len;i++)listeners[i].apply(this,args)}return true};EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener);if(!this._events[type])this._events[type]=listener;else if(isObject(this._events[type]))this._events[type].push(listener);else this._events[type]=[this._events[type],listener];if(isObject(this._events[type])&&!this._events[type].warned){if(!isUndefined(this._maxListeners)){m=this._maxListeners}else{m=EventEmitter.defaultMaxListeners}if(m&&m>0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];
2if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-- >0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this} 3;EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else if(listeners){while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;else if(evlistener)return evlistener.length}return 0};EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],31:[function(require,module,exports){arguments[4][27][0].apply(exports,arguments)},{dup:27}],32:[function(require,module,exports){(function(process,setImmediate){(function(root,factory){if(typeof define==="function"&&define.amd){define([],factory)}else if(typeof module==="object"&&module.exports){module.exports=factory()}else{root.pinkySwear=factory()}})(this,function(){var undef;function isFunction(f){return typeof f=="function"}function isObject(f){return typeof f=="object"}function defer(callback){if(typeof setImmediate!="undefined")setImmediate(callback);else if(typeof process!="undefined"&&process["nextTick"])process["nextTick"](callback);else setTimeout(callback,0)}return function pinkySwear(extend){var state;var values=[];var deferred=[];var set=function(newState,newValues){if(state==null&&newState!=null){state=newState;values=newValues;if(deferred.length)defer(function(){for(var i=0;i<deferred.length;i++)deferred[i]()})}return state};set["then"]=function(onFulfilled,onRejected){var promise2=pinkySwear(extend);var callCallbacks=function(){try{var f=state?onFulfilled:onRejected;if(isFunction(f)){function resolve(x){var then,cbCalled=0;try{if(x&&(isObject(x)||isFunction(x))&&isFunction(then=x["then"])){if(x===promise2)throw new TypeError;then["call"](x,function(){if(!cbCalled++)resolve.apply(undef,arguments)},function(value){if(!cbCalled++)promise2(false,[value])})}else promise2(true,arguments)}catch(e){if(!cbCalled++)promise2(false,[e])}}resolve(f.apply(undef,values||[]))}else promise2(state,values)}catch(e){promise2(false,[e])}};if(state!=null)defer(callCallbacks);else deferred.push(callCallbacks);return promise2};if(extend){set=extend(set)}return set}})}).call(this,require("_process"),require("timers").setImmediate)},{_process:33,timers:34}],33:[function(require,module,exports){var process=module.exports={};var cachedSetTimeout;var cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){cachedSetTimeout=setTimeout}else{cachedSetTimeout=defaultSetTimout}}catch(e){cachedSetTimeout=defaultSetTimout}try{if(typeof clearTimeout==="function"){cachedClearTimeout=clearTimeout}else{cachedClearTimeout=defaultClearTimeout}}catch(e){cachedClearTimeout=defaultClearTimeout}})();function runTimeout(fun){if(cachedSetTimeout===setTimeout){return setTimeout(fun,0)}if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout){cachedSetTimeout=setTimeout;return setTimeout(fun,0)}try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout){return clearTimeout(marker)}if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout){cachedClearTimeout=clearTimeout;return clearTimeout(marker)}try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}var queue=[];var draining=false;var currentQueue;var queueIndex=-1;function cleanUpNextTick(){if(!draining||!currentQueue){return}draining=false;if(currentQueue.length){queue=currentQueue.concat(queue)}else{queueIndex=-1}if(queue.length){drainQueue()}}function drainQueue(){if(draining){return}var timeout=runTimeout(cleanUpNextTick);draining=true;var len=queue.length;while(len){currentQueue=queue;queue=[];while(++queueIndex<len){if(currentQueue){currentQueue[queueIndex].run()}}queueIndex=-1;len=queue.length}currentQueue=null;draining=false;runClearTimeout(timeout)}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1){for(var i=1;i<arguments.length;i++){args[i-1]=arguments[i]}}queue.push(new Item(fun,args));if(queue.length===1&&!draining){runTimeout(drainQueue)}};function Item(fun,array){this.fun=fun;this.array=array}Item.prototype.run=function(){this.fun.apply(null,this.array)};process.title="browser";process.browser=true;process.env={};process.argv=[];process.version="";process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.prependListener=noop;process.prependOnceListener=noop;process.listeners=function(name){return[]};process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")};process.umask=function(){return 0}},{}],34:[function(require,module,exports){(function(setImmediate,clearImmediate){var nextTick=require("process/browser.js").nextTick;var apply=Function.prototype.apply;var slice=Array.prototype.slice;var immediateIds={};var nextImmediateId=0;exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,window,arguments),clearTimeout)};
3exports.setInterval=function(){return new Timeout(apply.call(setInterval,window,arguments),clearInterval)};exports.clearTimeout=exports.clearInterval=function(timeout){timeout.close()};function Timeout(id,clearFn){this._id=id;this._clearFn=clearFn}Timeout.prototype.unref=Timeout.prototype.ref=function(){};Timeout.prototype.close=function(){this._clearFn.call(window,this._id)};exports.enroll=function(item,msecs){clearTimeout(item._idleTimeoutId);item._idleTimeout=msecs};exports.unenroll=function(item){clearTimeout(item._idleTimeoutId);item._idleTimeout=-1};exports._unrefActive=exports.active=function(item){clearTimeout(item._idleTimeoutId);var msecs=item._idleTimeout;if(msecs>=0){item._idleTimeoutId=setTimeout(function onTimeout(){if(item._onTimeout)item._onTimeout()},msecs)}};exports.setImmediate=typeof setImmediate==="function"?setImmediate:function(fn){var id=nextImmediateId++;var args=arguments.length<2?false:slice.call(arguments,1);immediateIds[id]=true;nextTick(function onNextTick(){if(immediateIds[id]){if(args){fn.apply(null,args)}else{fn.call(null)}exports.clearImmediate(id)}});return id};exports.clearImmediate=typeof clearImmediate==="function"?clearImmediate:function(id){delete immediateIds[id]}}).call(this,require("timers").setImmediate,require("timers").clearImmediate)},{"process/browser.js":33,timers:34}]},{},[16]);
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.