index.js
86.4 KB
module.exports=(()=>{var e={3363:(e,t,r)=>{"use strict";var i=r(2413).Stream,s=r(1669),n=r(7685),o=r(7404),a=r(696),h=r(6878),c=r(4546);var u=function(e,t,r){this.writable=true;r=r||{};this._stream=t.socket;this._ping=r.ping||this.DEFAULT_PING;this._retry=r.retry||this.DEFAULT_RETRY;var i=n.isSecureRequest(e)?"https:":"http:";this.url=i+"//"+e.headers.host+e.url;this.lastEventId=e.headers["last-event-id"]||"";this.readyState=a.CONNECTING;var s=new o,h=this;if(r.headers){for(var c in r.headers)s.set(c,r.headers[c])}if(!this._stream||!this._stream.writable)return;process.nextTick(function(){h._open()});this._stream.setTimeout(0);this._stream.setNoDelay(true);var u="HTTP/1.1 200 OK\r\n"+"Content-Type: text/event-stream\r\n"+"Cache-Control: no-cache, no-store\r\n"+"Connection: close\r\n"+s.toString()+"\r\n"+"retry: "+Math.floor(this._retry*1e3)+"\r\n\r\n";this._write(u);this._stream.on("drain",function(){h.emit("drain")});if(this._ping)this._pingTimer=setInterval(function(){h.ping()},this._ping*1e3);["error","end"].forEach(function(e){h._stream.on(e,function(){h.close()})})};s.inherits(u,i);u.isEventSource=function(e){if(e.method!=="GET")return false;var t=(e.headers.accept||"").split(/\s*,\s*/);return t.indexOf("text/event-stream")>=0};var f={DEFAULT_PING:10,DEFAULT_RETRY:5,_write:function(e){if(!this.writable)return false;try{return this._stream.write(e,"utf8")}catch(e){return false}},_open:function(){if(this.readyState!==a.CONNECTING)return;this.readyState=a.OPEN;var e=new c("open");e.initEvent("open",false,false);this.dispatchEvent(e)},write:function(e){return this.send(e)},end:function(e){if(e!==undefined)this.write(e);this.close()},send:function(e,t){if(this.readyState>a.OPEN)return false;e=String(e).replace(/(\r\n|\r|\n)/g,"$1data: ");t=t||{};var r="";if(t.event)r+="event: "+t.event+"\r\n";if(t.id)r+="id: "+t.id+"\r\n";r+="data: "+e+"\r\n\r\n";return this._write(r)},ping:function(){return this._write(":\r\n\r\n")},close:function(){if(this.readyState>a.OPEN)return false;this.readyState=a.CLOSED;this.writable=false;if(this._pingTimer)clearInterval(this._pingTimer);if(this._stream)this._stream.end();var e=new c("close");e.initEvent("close",false,false);this.dispatchEvent(e);return true}};for(var p in f)u.prototype[p]=f[p];for(var l in h)u.prototype[l]=h[l];e.exports=u},9173:(e,t,r)=>{"use strict";var i=r(1669),s=r(7685),n=r(696);var o=function(e,t,r,i,o){o=o||{};this._stream=t;this._driver=s.http(e,{maxLength:o.maxLength,protocols:i});var a=this;if(!this._stream||!this._stream.writable)return;if(!this._stream.readable)return this._stream.end();var h=function(){a._stream.removeListener("data",h)};this._stream.on("data",h);n.call(this,o);process.nextTick(function(){a._driver.start();a._driver.io.write(r)})};i.inherits(o,n);o.isWebSocket=function(e){return s.isWebSocket(e)};o.validateOptions=function(e,t){s.validateOptions(e,t)};o.WebSocket=o;o.Client=r(4657);o.EventSource=r(3363);e.exports=o},696:(e,t,r)=>{"use strict";var i=r(2413).Stream,s=r(1669),n=r(7685),o=r(6878),a=r(4546);var h=function(e){e=e||{};n.validateOptions(e,["headers","extensions","maxLength","ping","proxy","tls","ca"]);this.readable=this.writable=true;var t=e.headers;if(t){for(var r in t)this._driver.setHeader(r,t[r])}var i=e.extensions;if(i){[].concat(i).forEach(this._driver.addExtension,this._driver)}this._ping=e.ping;this._pingId=0;this.readyState=h.CONNECTING;this.bufferedAmount=0;this.protocol="";this.url=this._driver.url;this.version=this._driver.version;var s=this;this._driver.on("open",function(e){s._open()});this._driver.on("message",function(e){s._receiveMessage(e.data)});this._driver.on("close",function(e){s._beginClose(e.reason,e.code)});this._driver.on("error",function(e){s._emitError(e.message)});this.on("error",function(){});this._driver.messages.on("drain",function(){s.emit("drain")});if(this._ping)this._pingTimer=setInterval(function(){s._pingId+=1;s.ping(s._pingId.toString())},this._ping*1e3);this._configureStream();if(!this._proxy){this._stream.pipe(this._driver.io);this._driver.io.pipe(this._stream)}};s.inherits(h,i);h.CONNECTING=0;h.OPEN=1;h.CLOSING=2;h.CLOSED=3;h.CLOSE_TIMEOUT=3e4;var c={write:function(e){return this.send(e)},end:function(e){if(e!==undefined)this.send(e);this.close()},pause:function(){return this._driver.messages.pause()},resume:function(){return this._driver.messages.resume()},send:function(e){if(this.readyState>h.OPEN)return false;if(!(e instanceof Buffer))e=String(e);return this._driver.messages.write(e)},ping:function(e,t){if(this.readyState>h.OPEN)return false;return this._driver.ping(e,t)},close:function(e,t){if(e===undefined)e=1e3;if(t===undefined)t="";if(e!==1e3&&(e<3e3||e>4999))throw new Error("Failed to execute 'close' on WebSocket: "+"The code must be either 1000, or between 3000 and 4999. "+e+" is neither.");if(this.readyState!==h.CLOSED)this.readyState=h.CLOSING;var r=this;this._closeTimer=setTimeout(function(){r._beginClose("",1006)},h.CLOSE_TIMEOUT);this._driver.close(t,e)},_configureStream:function(){var e=this;this._stream.setTimeout(0);this._stream.setNoDelay(true);["close","end"].forEach(function(t){this._stream.on(t,function(){e._finalizeClose()})},this);this._stream.on("error",function(t){e._emitError("Network error: "+e.url+": "+t.message);e._finalizeClose()})},_open:function(){if(this.readyState!==h.CONNECTING)return;this.readyState=h.OPEN;this.protocol=this._driver.protocol||"";var e=new a("open");e.initEvent("open",false,false);this.dispatchEvent(e)},_receiveMessage:function(e){if(this.readyState>h.OPEN)return false;if(this.readable)this.emit("data",e);var t=new a("message",{data:e});t.initEvent("message",false,false);this.dispatchEvent(t)},_emitError:function(e){if(this.readyState>=h.CLOSING)return;var t=new a("error",{message:e});t.initEvent("error",false,false);this.dispatchEvent(t)},_beginClose:function(e,t){if(this.readyState===h.CLOSED)return;this.readyState=h.CLOSING;this._closeParams=[e,t];if(this._stream){this._stream.destroy();if(!this._stream.readable)this._finalizeClose()}},_finalizeClose:function(){if(this.readyState===h.CLOSED)return;this.readyState=h.CLOSED;if(this._closeTimer)clearTimeout(this._closeTimer);if(this._pingTimer)clearInterval(this._pingTimer);if(this._stream)this._stream.end();if(this.readable)this.emit("end");this.readable=this.writable=false;var e=this._closeParams?this._closeParams[0]:"",t=this._closeParams?this._closeParams[1]:1006;var r=new a("close",{code:t,reason:e});r.initEvent("close",false,false);this.dispatchEvent(r)}};for(var u in c)h.prototype[u]=c[u];for(var f in o)h.prototype[f]=o[f];e.exports=h},4546:e=>{"use strict";var t=function(e,t){this.type=e;for(var r in t)this[r]=t[r]};t.prototype.initEvent=function(e,t,r){this.type=e;this.bubbles=t;this.cancelable=r};t.prototype.stopPropagation=function(){};t.prototype.preventDefault=function(){};t.CAPTURING_PHASE=1;t.AT_TARGET=2;t.BUBBLING_PHASE=3;e.exports=t},6878:(e,t,r)=>{"use strict";var i=r(4546);var s={onopen:null,onmessage:null,onerror:null,onclose:null,addEventListener:function(e,t,r){this.on(e,t)},removeEventListener:function(e,t,r){this.removeListener(e,t)},dispatchEvent:function(e){e.target=e.currentTarget=this;e.eventPhase=i.AT_TARGET;if(this["on"+e.type])this["on"+e.type](e);this.emit(e.type,e)}};e.exports=s},4657:(e,t,r)=>{"use strict";var i=r(1669),s=r(1631),n=r(4016),o=r(8835),a=r(7685),h=r(696),c=r(4546);var u={"http:":80,"https:":443,"ws:":80,"wss:":443},f=["https:","wss:"];var p=function(e,t,r){r=r||{};this.url=e;this._driver=a.client(this.url,{maxLength:r.maxLength,protocols:t});["open","error"].forEach(function(e){this._driver.on(e,function(){g.headers=g._driver.headers;g.statusCode=g._driver.statusCode})},this);var i=r.proxy||{},c=o.parse(i.origin||this.url),p=c.port||u[c.protocol],l=f.indexOf(c.protocol)>=0,d=function(){g._onConnect()},_=r.net||{},v=r.tls||{},y=i.origin?i.tls||{}:v,g=this;_.host=y.host=c.hostname;_.port=y.port=p;v.ca=v.ca||r.ca;y.servername=y.servername||c.hostname;this._stream=l?n.connect(y,d):s.connect(_,d);if(i.origin)this._configureProxy(i,v);h.call(this,r)};i.inherits(p,h);p.prototype._onConnect=function(){var e=this._proxy||this._driver;e.start()};p.prototype._configureProxy=function(e,t){var r=o.parse(this.url),i=f.indexOf(r.protocol)>=0,s=this,a;this._proxy=this._driver.proxy(e.origin);if(e.headers){for(a in e.headers)this._proxy.setHeader(a,e.headers[a])}this._proxy.pipe(this._stream,{end:false});this._stream.pipe(this._proxy);this._proxy.on("connect",function(){if(i){var e={socket:s._stream,servername:r.hostname};for(a in t)e[a]=t[a];s._stream=n.connect(e);s._configureStream()}s._driver.io.pipe(s._stream);s._stream.pipe(s._driver.io);s._driver.start()});this._proxy.on("error",function(e){s._driver.emit("error",e)})};e.exports=p},7119:(e,t,r)=>{var i;var s=r(2357);t.m=HTTPParser;function HTTPParser(e){s.ok(e===HTTPParser.REQUEST||e===HTTPParser.RESPONSE||e===undefined);if(e===undefined){}else{this.initialize(e)}}HTTPParser.prototype.initialize=function(e,t){s.ok(e===HTTPParser.REQUEST||e===HTTPParser.RESPONSE);this.type=e;this.state=e+"_LINE";this.info={headers:[],upgrade:false};this.trailers=[];this.line="";this.isChunked=false;this.connection="";this.headerSize=0;this.body_bytes=null;this.isUserCall=false;this.hadError=false};HTTPParser.encoding="ascii";HTTPParser.maxHeaderSize=80*1024;HTTPParser.REQUEST="REQUEST";HTTPParser.RESPONSE="RESPONSE";var n=HTTPParser.kOnHeaders=1;var o=HTTPParser.kOnHeadersComplete=2;var a=HTTPParser.kOnBody=3;var h=HTTPParser.kOnMessageComplete=4;HTTPParser.prototype[n]=HTTPParser.prototype[o]=HTTPParser.prototype[a]=HTTPParser.prototype[h]=function(){};var c=true;Object.defineProperty(HTTPParser,"kOnExecute",{get:function(){c=false;return 99}});var u=i=HTTPParser.methods=["DELETE","GET","HEAD","POST","PUT","CONNECT","OPTIONS","TRACE","COPY","LOCK","MKCOL","MOVE","PROPFIND","PROPPATCH","SEARCH","UNLOCK","BIND","REBIND","UNBIND","ACL","REPORT","MKACTIVITY","CHECKOUT","MERGE","M-SEARCH","NOTIFY","SUBSCRIBE","UNSUBSCRIBE","PATCH","PURGE","MKCALENDAR","LINK","UNLINK"];var f=u.indexOf("CONNECT");HTTPParser.prototype.reinitialize=HTTPParser;HTTPParser.prototype.close=HTTPParser.prototype.pause=HTTPParser.prototype.resume=HTTPParser.prototype.free=function(){};HTTPParser.prototype._compatMode0_11=false;HTTPParser.prototype.getAsyncId=function(){return 0};var p={REQUEST_LINE:true,RESPONSE_LINE:true,HEADER:true};HTTPParser.prototype.execute=function(e,t,r){if(!(this instanceof HTTPParser)){throw new TypeError("not a HTTPParser")}t=t||0;r=typeof r==="number"?r:e.length;this.chunk=e;this.offset=t;var i=this.end=t+r;try{while(this.offset<i){if(this[this.state]()){break}}}catch(e){if(this.isUserCall){throw e}this.hadError=true;return e}this.chunk=null;r=this.offset-t;if(p[this.state]){this.headerSize+=r;if(this.headerSize>HTTPParser.maxHeaderSize){return new Error("max header size exceeded")}}return r};var l={REQUEST_LINE:true,RESPONSE_LINE:true,BODY_RAW:true};HTTPParser.prototype.finish=function(){if(this.hadError){return}if(!l[this.state]){return new Error("invalid state for EOF")}if(this.state==="BODY_RAW"){this.userCall()(this[h]())}};HTTPParser.prototype.consume=HTTPParser.prototype.unconsume=HTTPParser.prototype.getCurrentBuffer=function(){};HTTPParser.prototype.userCall=function(){this.isUserCall=true;var e=this;return function(t){e.isUserCall=false;return t}};HTTPParser.prototype.nextRequest=function(){this.userCall()(this[h]());this.reinitialize(this.type)};HTTPParser.prototype.consumeLine=function(){var e=this.end,t=this.chunk;for(var r=this.offset;r<e;r++){if(t[r]===10){var i=this.line+t.toString(HTTPParser.encoding,this.offset,r);if(i.charAt(i.length-1)==="\r"){i=i.substr(0,i.length-1)}this.line="";this.offset=r+1;return i}}this.line+=t.toString(HTTPParser.encoding,this.offset,this.end);this.offset=this.end};var d=/^([^: \t]+):[ \t]*((?:.*[^ \t])|)/;var _=/^[ \t]+(.*[^ \t])/;HTTPParser.prototype.parseHeader=function(e,t){if(e.indexOf("\r")!==-1){throw parseErrorCode("HPE_LF_EXPECTED")}var r=d.exec(e);var i=r&&r[1];if(i){t.push(i);t.push(r[2])}else{var s=_.exec(e);if(s&&t.length){if(t[t.length-1]){t[t.length-1]+=" "}t[t.length-1]+=s[1]}}};var v=/^([A-Z-]+) ([^ ]+) HTTP\/(\d)\.(\d)$/;HTTPParser.prototype.REQUEST_LINE=function(){var e=this.consumeLine();if(!e){return}var t=v.exec(e);if(t===null){throw parseErrorCode("HPE_INVALID_CONSTANT")}this.info.method=this._compatMode0_11?t[1]:u.indexOf(t[1]);if(this.info.method===-1){throw new Error("invalid request method")}this.info.url=t[2];this.info.versionMajor=+t[3];this.info.versionMinor=+t[4];this.body_bytes=0;this.state="HEADER"};var y=/^HTTP\/(\d)\.(\d) (\d{3}) ?(.*)$/;HTTPParser.prototype.RESPONSE_LINE=function(){var e=this.consumeLine();if(!e){return}var t=y.exec(e);if(t===null){throw parseErrorCode("HPE_INVALID_CONSTANT")}this.info.versionMajor=+t[1];this.info.versionMinor=+t[2];var r=this.info.statusCode=+t[3];this.info.statusMessage=t[4];if((r/100|0)===1||r===204||r===304){this.body_bytes=0}this.state="HEADER"};HTTPParser.prototype.shouldKeepAlive=function(){if(this.info.versionMajor>0&&this.info.versionMinor>0){if(this.connection.indexOf("close")!==-1){return false}}else if(this.connection.indexOf("keep-alive")===-1){return false}if(this.body_bytes!==null||this.isChunked){return true}return false};HTTPParser.prototype.HEADER=function(){var e=this.consumeLine();if(e===undefined){return}var t=this.info;if(e){this.parseHeader(e,t.headers)}else{var r=t.headers;var i=false;var s;var n=false;for(var a=0;a<r.length;a+=2){switch(r[a].toLowerCase()){case"transfer-encoding":this.isChunked=r[a+1].toLowerCase()==="chunked";break;case"content-length":s=+r[a+1];if(i){if(s!==this.body_bytes){throw parseErrorCode("HPE_UNEXPECTED_CONTENT_LENGTH")}}else{i=true;this.body_bytes=s}break;case"connection":this.connection+=r[a+1].toLowerCase();break;case"upgrade":n=true;break}}if(this.isChunked&&i){i=false;this.body_bytes=null}if(n&&this.connection.indexOf("upgrade")!=-1){t.upgrade=this.type===HTTPParser.REQUEST||t.statusCode===101}else{t.upgrade=t.method===f}if(this.isChunked&&t.upgrade){this.isChunked=false}t.shouldKeepAlive=this.shouldKeepAlive();var h;if(c){h=this.userCall()(this[o](t))}else{h=this.userCall()(this[o](t.versionMajor,t.versionMinor,t.headers,t.method,t.url,t.statusCode,t.statusMessage,t.upgrade,t.shouldKeepAlive))}if(h===2){this.nextRequest();return true}else if(this.isChunked&&!h){this.state="BODY_CHUNKHEAD"}else if(h||this.body_bytes===0){this.nextRequest();return t.upgrade}else if(this.body_bytes===null){this.state="BODY_RAW"}else{this.state="BODY_SIZED"}}};HTTPParser.prototype.BODY_CHUNKHEAD=function(){var e=this.consumeLine();if(e===undefined){return}this.body_bytes=parseInt(e,16);if(!this.body_bytes){this.state="BODY_CHUNKTRAILERS"}else{this.state="BODY_CHUNK"}};HTTPParser.prototype.BODY_CHUNK=function(){var e=Math.min(this.end-this.offset,this.body_bytes);this.userCall()(this[a](this.chunk,this.offset,e));this.offset+=e;this.body_bytes-=e;if(!this.body_bytes){this.state="BODY_CHUNKEMPTYLINE"}};HTTPParser.prototype.BODY_CHUNKEMPTYLINE=function(){var e=this.consumeLine();if(e===undefined){return}s.equal(e,"");this.state="BODY_CHUNKHEAD"};HTTPParser.prototype.BODY_CHUNKTRAILERS=function(){var e=this.consumeLine();if(e===undefined){return}if(e){this.parseHeader(e,this.trailers)}else{if(this.trailers.length){this.userCall()(this[n](this.trailers,""))}this.nextRequest()}};HTTPParser.prototype.BODY_RAW=function(){var e=this.end-this.offset;this.userCall()(this[a](this.chunk,this.offset,e));this.offset=this.end};HTTPParser.prototype.BODY_SIZED=function(){var e=Math.min(this.end-this.offset,this.body_bytes);this.userCall()(this[a](this.chunk,this.offset,e));this.offset+=e;this.body_bytes-=e;if(!this.body_bytes){this.nextRequest()}};["Headers","HeadersComplete","Body","MessageComplete"].forEach(function(e){var t=HTTPParser["kOn"+e];Object.defineProperty(HTTPParser.prototype,"on"+e,{get:function(){return this[t]},set:function(e){this._compatMode0_11=true;f="CONNECT";return this[t]=e}})});function parseErrorCode(e){var t=new Error("Parse Error");t.code=e;return t}},1867:(e,t,r)=>{var i=r(4293);var s=i.Buffer;function copyProps(e,t){for(var r in e){t[r]=e[r]}}if(s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow){e.exports=i}else{copyProps(i,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,r){return s(e,t,r)}SafeBuffer.prototype=Object.create(s.prototype);copyProps(s,SafeBuffer);SafeBuffer.from=function(e,t,r){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return s(e,t,r)};SafeBuffer.alloc=function(e,t,r){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var i=s(e);if(t!==undefined){if(typeof r==="string"){i.fill(t,r)}else{i.fill(t)}}else{i.fill(0)}return i};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return s(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return i.SlowBuffer(e)}},640:(e,t,r)=>{e.exports=r(1314)},4300:function(e,t,r){(function(){var e;e=r(2666);t.app={chunking_test:function(t,r,i,s){var n;r.setHeader("Content-Type","application/javascript; charset=UTF-8");r.writeHead(200);n=function(e){return function(e){var t;try{return r.write(e+"\n")}catch(e){t=e}}}(this);e.timeout_chain([[0,function(e){return function(){return n("h")}}(this)],[1,function(e){return function(){return n(Array(2049).join(" ")+"h")}}(this)],[5,function(e){return function(){return n("h")}}(this)],[25,function(e){return function(){return n("h")}}(this)],[125,function(e){return function(){return n("h")}}(this)],[625,function(e){return function(){return n("h")}}(this)],[3125,function(e){return function(){n("h");return r.end()}}(this)]]);return true},info:function(t,r,i){var s;s={websocket:this.options.websocket,origins:!this.options.disable_cors?["*:*"]:void 0,cookie_needed:!!this.options.jsessionid,entropy:e.random32()};if(typeof this.options.base_url==="function"){s.base_url=this.options.base_url()}else if(this.options.base_url){s.base_url=this.options.base_url}r.setHeader("Content-Type","application/json; charset=UTF-8");r.writeHead(200);return r.end(JSON.stringify(s))},info_options:function(e,t){t.statusCode=204;t.setHeader("Access-Control-Allow-Methods","OPTIONS, GET");t.setHeader("Access-Control-Max-Age",t.cache_for);return""}}}).call(this)},9351:function(e,t,r){(function(){var e,i;i=r(2666);e='<!DOCTYPE html>\n<html>\n<head>\n <meta http-equiv="X-UA-Compatible" content="IE=edge" />\n <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n <script src="{{ sockjs_url }}"><\/script>\n <script>\n document.domain = document.domain;\n SockJS.bootstrap_iframe();\n <\/script>\n</head>\n<body>\n <h2>Don\'t panic!</h2>\n <p>This is a SockJS hidden iframe. It\'s used for cross domain magic.</p>\n</body>\n</html>';t.app={iframe:function(t,r){var s,n,o,a;n={"{{ sockjs_url }}":this.options.sockjs_url};s=e;for(o in n){s=s.replace(o,n[o])}a='"'+i.md5_hex(s)+'"';if("if-none-match"in t.headers&&t.headers["if-none-match"]===a){r.statusCode=304;return""}r.setHeader("Content-Type","text/html; charset=UTF-8");r.setHeader("ETag",a);return s}}}).call(this)},1314:function(e,t,r){(function(){var e,i,s,n,o,a,h,c,u,f,p,l,d,_,v,y,g=function(e,t){for(var r in t){if(m.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},m={}.hasOwnProperty,S=function(e,t){return function(){return e.apply(t,arguments)}};o=r(8614);a=r(5747);y=r(8399);v=r(2666);d=r(9527);l=r(3709);_=r(3720);c=r(9351);f=r(9729);p=r(158);n=r(4300);u=function(){var e,t;try{e=a.readFileSync(r.ab+"package.json","utf-8")}catch(e){t=e}if(e){return JSON.parse(e).version}else{return null}};e=function(e){g(App,e);function App(){return App.__super__.constructor.apply(this,arguments)}App.prototype.welcome_screen=function(e,t){t.setHeader("content-type","text/plain; charset=UTF-8");t.writeHead(200);t.end("Welcome to SockJS!\n");return true};App.prototype.handle_404=function(e,t){t.setHeader("content-type","text/plain; charset=UTF-8");t.writeHead(404);t.end("404 Error: Page not found\n");return true};App.prototype.disabled_transport=function(e,t,r){return this.handle_404(e,t,r)};App.prototype.h_sid=function(e,t,r){var i;e.cookies=v.parseCookie(e.headers.cookie);if(typeof this.options.jsessionid==="function"){this.options.jsessionid(e,t)}else if(this.options.jsessionid&&t.setHeader){i=e.cookies["JSESSIONID"]||"dummy";t.setHeader("Set-Cookie","JSESSIONID="+i+"; path=/")}return r};App.prototype.log=function(e,t){return this.options.log(e,t)};return App}(y.GenericApp);v.objectExtend(e.prototype,c.app);v.objectExtend(e.prototype,n.app);v.objectExtend(e.prototype,d.app);v.objectExtend(e.prototype,l.app);v.objectExtend(e.prototype,_.app);v.objectExtend(e.prototype,f.app);v.objectExtend(e.prototype,p.app);h=function(e){var t,r,i,s,n;r=function(t){return function(t){return new RegExp("^"+e.prefix+t+"[/]?$")}}(this);s=function(e){return function(e){return[r("/([^/.]+)/([^/.]+)"+e),"server","session"]}}(this);t=function(e){if(e==null){e="xhr_options"}return["h_sid","xhr_cors","cache_for",e,"expose"]};i=[["GET",r(""),["welcome_screen"]],["GET",r("/iframe[0-9-.a-z_]*.html"),["iframe","cache_for","expose"]],["OPTIONS",r("/info"),t("info_options")],["GET",r("/info"),["xhr_cors","h_no_cache","info","expose"]],["OPTIONS",r("/chunking_test"),t()],["POST",r("/chunking_test"),["xhr_cors","expect_xhr","chunking_test"]]];n=[["GET",s("/jsonp"),["h_sid","h_no_cache","jsonp"]],["POST",s("/jsonp_send"),["h_sid","h_no_cache","expect_form","jsonp_send"]],["POST",s("/xhr"),["h_sid","h_no_cache","xhr_cors","xhr_poll"]],["OPTIONS",s("/xhr"),t()],["POST",s("/xhr_send"),["h_sid","h_no_cache","xhr_cors","expect_xhr","xhr_send"]],["OPTIONS",s("/xhr_send"),t()],["POST",s("/xhr_streaming"),["h_sid","h_no_cache","xhr_cors","xhr_streaming"]],["OPTIONS",s("/xhr_streaming"),t()],["GET",s("/eventsource"),["h_sid","h_no_cache","eventsource"]],["GET",s("/htmlfile"),["h_sid","h_no_cache","htmlfile"]]];if(e.websocket){i.push(["GET",r("/websocket"),["raw_websocket"]]);n.push(["GET",s("/websocket"),["sockjs_websocket"]])}else{i.push(["GET",r("/websocket"),["cache_for","disabled_transport"]]);n.push(["GET",s("/websocket"),["cache_for","disabled_transport"]])}return i.concat(n)};i=function(){function Listener(t,r){this.options=t;this.handler=S(this.handler,this);this.app=new e;this.app.options=this.options;this.app.emit=r;this.app.log("debug","SockJS v"+u()+" "+"bound to "+JSON.stringify(this.options.prefix));this.dispatcher=h(this.options);this.webjs_handler=y.generateHandler(this.app,this.dispatcher);this.path_regexp=new RegExp("^"+this.options.prefix+"([/].+|[/]?)$")}Listener.prototype.handler=function(e,t,r){if(!e.url.match(this.path_regexp)){return false}this.webjs_handler(e,t,r);return true};Listener.prototype.getHandler=function(){return function(e){return function(t,r,i){return e.handler(t,r,i)}}(this)};return Listener}();s=function(e){g(Server,e);function Server(e){this.options={prefix:"",response_limit:128*1024,websocket:true,faye_server_options:null,jsessionid:false,heartbeat_delay:25e3,disconnect_delay:5e3,log:function(e,t){return console.log(t)},sockjs_url:"https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"};if(e){v.objectExtend(this.options,e)}}Server.prototype.listener=function(e){var t;t=v.objectExtend({},this.options);if(e){v.objectExtend(t,e)}return new i(t,function(e){return function(){return e.emit.apply(e,arguments)}}(this))};Server.prototype.installHandlers=function(e,t){var r;r=this.listener(t).getHandler();v.overshadowListeners(e,"request",r);v.overshadowListeners(e,"upgrade",r);return true};Server.prototype.middleware=function(e){var t;t=this.listener(e).getHandler();t.upgrade=t;return t};return Server}(o.EventEmitter);t.createServer=function(e){return new s(e)};t.listen=function(e,r){var i;i=t.createServer(r);if(e){i.installHandlers(e)}return i}}).call(this)},9729:function(e,t,r){(function(){var e,i,s,n=function(e,t){for(var r in t){if(o.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},o={}.hasOwnProperty;s=r(2666);i=r(931);e=function(e){n(EventSourceReceiver,e);function EventSourceReceiver(){return EventSourceReceiver.__super__.constructor.apply(this,arguments)}EventSourceReceiver.prototype.protocol="eventsource";EventSourceReceiver.prototype.doSendFrame=function(e){var t;t=["data: ",s.escape_selected(e,"\r\n\0"),"\r\n\r\n"];return EventSourceReceiver.__super__.doSendFrame.call(this,t.join(""))};return EventSourceReceiver}(i.ResponseReceiver);t.app={eventsource:function(t,r){var s,n;if(!t.headers["origin"]||t.headers["origin"]==="null"){n="*"}else{n=t.headers["origin"];r.setHeader("Access-Control-Allow-Credentials","true")}r.setHeader("Content-Type","text/event-stream");r.setHeader("Access-Control-Allow-Origin",n);r.setHeader("Vary","Origin");s=t.headers["access-control-request-headers"];if(s){r.setHeader("Access-Control-Allow-Headers",s)}r.writeHead(200);r.write("\r\n");i.register(t,this,new e(t,r,this.options));return true}}}).call(this)},158:function(e,t,r){(function(){var e,i,s,n,o=function(e,t){for(var r in t){if(a.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},a={}.hasOwnProperty;n=r(2666);s=r(931);i='<!doctype html>\n<html><head>\n <meta http-equiv="X-UA-Compatible" content="IE=edge" />\n <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n</head><body><h2>Don\'t panic!</h2>\n <script>\n document.domain = document.domain;\n var c = parent.{{ callback }};\n c.start();\n function p(d) {c.message(d);};\n window.onload = function() {c.stop();};\n <\/script>';i+=Array(1024-i.length+14).join(" ");i+="\r\n\r\n";e=function(e){o(HtmlFileReceiver,e);function HtmlFileReceiver(){return HtmlFileReceiver.__super__.constructor.apply(this,arguments)}HtmlFileReceiver.prototype.protocol="htmlfile";HtmlFileReceiver.prototype.doSendFrame=function(e){return HtmlFileReceiver.__super__.doSendFrame.call(this,"<script>\np("+JSON.stringify(e)+");\n<\/script>\r\n")};return HtmlFileReceiver}(s.ResponseReceiver);t.app={htmlfile:function(t,r){var n;if(!("c"in t.query||"callback"in t.query)){throw{status:500,message:'"callback" parameter required'}}n="c"in t.query?t.query["c"]:t.query["callback"];if(/[^a-zA-Z0-9-_.]/.test(n)){throw{status:500,message:'invalid "callback" parameter'}}r.setHeader("Content-Type","text/html; charset=UTF-8");r.writeHead(200);r.write(i.replace(/{{ callback }}/g,n));s.register(t,this,new e(t,r,this.options));return true}}}).call(this)},3709:function(e,t,r){(function(){var e,i,s=function(e,t){for(var r in t){if(n.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},n={}.hasOwnProperty;i=r(931);e=function(e){s(JsonpReceiver,e);JsonpReceiver.prototype.protocol="jsonp-polling";JsonpReceiver.prototype.max_response_size=1;function JsonpReceiver(e,t,r,i){this.callback=i;JsonpReceiver.__super__.constructor.call(this,e,t,r)}JsonpReceiver.prototype.doSendFrame=function(e){return JsonpReceiver.__super__.doSendFrame.call(this,"/**/"+this.callback+"("+JSON.stringify(e)+");\r\n")};return JsonpReceiver}(i.ResponseReceiver);t.app={jsonp:function(t,r,s,n){var o;if(!("c"in t.query||"callback"in t.query)){throw{status:500,message:'"callback" parameter required'}}o="c"in t.query?t.query["c"]:t.query["callback"];if(/[^a-zA-Z0-9-_.]/.test(o)||o.length>32){throw{status:500,message:'invalid "callback" parameter'}}r.setHeader("X-Content-Type-Options","nosniff");r.setHeader("Content-Type","application/javascript; charset=UTF-8");r.writeHead(200);i.register(t,this,new e(t,r,this.options,o));return true},jsonp_send:function(e,t,r){var s,n,o,a,h,c;if(!r){throw{status:500,message:"Payload expected."}}if(typeof r==="string"){try{s=JSON.parse(r)}catch(e){c=e;throw{status:500,message:"Broken JSON encoding."}}}else{s=r.d}if(typeof s==="string"&&s){try{s=JSON.parse(s)}catch(e){c=e;throw{status:500,message:"Broken JSON encoding."}}}if(!s||s.__proto__.constructor!==Array){throw{status:500,message:"Payload expected."}}o=i.Session.bySessionId(e.session);if(o===null){throw{status:404}}for(n=0,a=s.length;n<a;n++){h=s[n];o.didMessage(h)}t.setHeader("Content-Length","2");t.setHeader("Content-Type","text/plain; charset=UTF-8");t.writeHead(200);t.end("ok");return true}}}).call(this)},9527:function(e,t,r){(function(){var e,i,s,n,o,a,h=function(e,t){for(var r in t){if(c.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},c={}.hasOwnProperty;e=r(9173);a=r(2666);o=r(931);t.app={_websocket_check:function(t,r,i){if(!e.isWebSocket(t)){throw{status:400,message:"Not a valid websocket request"}}},sockjs_websocket:function(t,r,i){var s;this._websocket_check(t,r,i);s=new e(t,r,i,null,this.options.faye_server_options);s.onopen=function(e){return function(){return o.registerNoSession(t,e,new n(s,r))}}(this);return true},raw_websocket:function(t,r,s){var n,o;this._websocket_check(t,r,s);n=t.headers["sec-websocket-version"]||"";if(["8","13"].indexOf(n)===-1){throw{status:400,message:"Only supported WebSocket protocol is RFC 6455."}}o=new e(t,r,s,null,this.options.faye_server_options);o.onopen=function(e){return function(){return new i(t,r,e,o)}}(this);return true}};n=function(e){h(WebSocketReceiver,e);WebSocketReceiver.prototype.protocol="websocket";function WebSocketReceiver(e,t){var r;this.ws=e;this.connection=t;try{this.connection.setKeepAlive(true,5e3);this.connection.setNoDelay(true)}catch(e){r=e}this.ws.addEventListener("message",function(e){return function(t){return e.didMessage(t.data)}}(this));this.heartbeat_cb=function(e){return function(){return e.heartbeat_timeout()}}(this);WebSocketReceiver.__super__.constructor.call(this,this.connection)}WebSocketReceiver.prototype.setUp=function(){WebSocketReceiver.__super__.setUp.apply(this,arguments);return this.ws.addEventListener("close",this.thingy_end_cb)};WebSocketReceiver.prototype.tearDown=function(){this.ws.removeEventListener("close",this.thingy_end_cb);return WebSocketReceiver.__super__.tearDown.apply(this,arguments)};WebSocketReceiver.prototype.didMessage=function(e){var t,r,i,s,n,o;if(this.ws&&this.session&&e.length>0){try{i=JSON.parse(e)}catch(e){o=e;return this.didClose(3e3,"Broken framing.")}if(e[0]==="["){n=[];for(t=0,r=i.length;t<r;t++){s=i[t];n.push(this.session.didMessage(s))}return n}else{return this.session.didMessage(i)}}};WebSocketReceiver.prototype.doSendFrame=function(e){var t;if(this.ws){try{this.ws.send(e);return true}catch(e){t=e}}return false};WebSocketReceiver.prototype.didClose=function(e,t){var r;if(e==null){e=1e3}if(t==null){t="Normal closure"}WebSocketReceiver.__super__.didClose.apply(this,arguments);try{this.ws.close(e,t,false)}catch(e){r=e}this.ws=null;return this.connection=null};WebSocketReceiver.prototype.heartbeat=function(){var e,t;t=this.ws.ping(null,function(){return clearTimeout(e)});if(t){return e=setTimeout(this.heartbeat_cb,1e4)}else{return WebSocketReceiver.__super__.heartbeat.apply(this,arguments)}};WebSocketReceiver.prototype.heartbeat_timeout=function(){if(this.session!=null){return this.session.close(3e3,"No response from heartbeat")}};return WebSocketReceiver}(o.GenericReceiver);s=o.Transport;i=function(e){h(RawWebsocketSessionReceiver,e);function RawWebsocketSessionReceiver(e,t,r,i){this.ws=i;this.prefix=r.options.prefix;this.readyState=s.OPEN;this.recv={connection:t,protocol:"websocket-raw"};this.connection=new o.SockJSConnection(this);this.decorateConnection(e);r.emit("connection",this.connection);this._end_cb=function(e){return function(){return e.didClose()}}(this);this.ws.addEventListener("close",this._end_cb);this._message_cb=function(e){return function(t){return e.didMessage(t)}}(this);this.ws.addEventListener("message",this._message_cb)}RawWebsocketSessionReceiver.prototype.didMessage=function(e){if(this.readyState===s.OPEN){this.connection.emit("data",e.data)}};RawWebsocketSessionReceiver.prototype.send=function(e){if(this.readyState!==s.OPEN){return false}this.ws.send(e);return true};RawWebsocketSessionReceiver.prototype.close=function(e,t){if(e==null){e=1e3}if(t==null){t="Normal closure"}if(this.readyState!==s.OPEN){return false}this.readyState=s.CLOSING;this.ws.close(e,t,false);return true};RawWebsocketSessionReceiver.prototype.didClose=function(){var e;if(!this.ws){return}this.ws.removeEventListener("message",this._message_cb);this.ws.removeEventListener("close",this._end_cb);try{this.ws.close(1e3,"Normal closure",false)}catch(t){e=t}this.ws=null;this.readyState=s.CLOSED;this.connection.emit("end");this.connection.emit("close");return this.connection=null};return RawWebsocketSessionReceiver}(o.Session)}).call(this)},3720:function(e,t,r){(function(){var e,i,s,n,o=function(e,t){for(var r in t){if(a.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},a={}.hasOwnProperty;s=r(931);n=r(2666);i=function(e){o(XhrStreamingReceiver,e);function XhrStreamingReceiver(){return XhrStreamingReceiver.__super__.constructor.apply(this,arguments)}XhrStreamingReceiver.prototype.protocol="xhr-streaming";XhrStreamingReceiver.prototype.doSendFrame=function(e){return XhrStreamingReceiver.__super__.doSendFrame.call(this,e+"\n")};return XhrStreamingReceiver}(s.ResponseReceiver);e=function(e){o(XhrPollingReceiver,e);function XhrPollingReceiver(){return XhrPollingReceiver.__super__.constructor.apply(this,arguments)}XhrPollingReceiver.prototype.protocol="xhr-polling";XhrPollingReceiver.prototype.max_response_size=1;return XhrPollingReceiver}(i);t.app={xhr_options:function(e,t){t.statusCode=204;t.setHeader("Access-Control-Allow-Methods","OPTIONS, POST");t.setHeader("Access-Control-Max-Age",t.cache_for);return""},xhr_send:function(e,t,r){var i,n,o,a,h,c;if(!r){throw{status:500,message:"Payload expected."}}try{i=JSON.parse(r)}catch(e){c=e;throw{status:500,message:"Broken JSON encoding."}}if(!i||i.__proto__.constructor!==Array){throw{status:500,message:"Payload expected."}}o=s.Session.bySessionId(e.session);if(!o){throw{status:404}}for(n=0,a=i.length;n<a;n++){h=i[n];o.didMessage(h)}t.setHeader("Content-Type","text/plain; charset=UTF-8");t.writeHead(204);t.end();return true},xhr_cors:function(e,t,r){var i,s;if(this.options.disable_cors){return r}if(!e.headers["origin"]){s="*"}else{s=e.headers["origin"];t.setHeader("Access-Control-Allow-Credentials","true")}t.setHeader("Access-Control-Allow-Origin",s);t.setHeader("Vary","Origin");i=e.headers["access-control-request-headers"];if(i){t.setHeader("Access-Control-Allow-Headers",i)}return r},xhr_poll:function(t,r,i,n){r.setHeader("Content-Type","application/javascript; charset=UTF-8");r.writeHead(200);s.register(t,this,new e(t,r,this.options));return true},xhr_streaming:function(e,t,r,n){t.setHeader("Content-Type","application/javascript; charset=UTF-8");t.writeHead(200);t.write(Array(2049).join("h")+"\n");s.register(e,this,new i(e,t,this.options));return true}}}).call(this)},931:function(e,t,r){(function(){var e,i,s,n,o,a,h,c,u,f,p,l=function(e,t){for(var r in t){if(d.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},d={}.hasOwnProperty;u=r(2413);p=r(824);f=r(2666);a=function(){function Transport(){}return Transport}();a.CONNECTING=0;a.OPEN=1;a.CLOSING=2;a.CLOSED=3;h=function(e,t){return"c"+JSON.stringify([e,t])};o=function(e){l(SockJSConnection,e);function SockJSConnection(e){this._session=e;this.id=p();this.headers={};this.prefix=this._session.prefix}SockJSConnection.prototype.toString=function(){return"<SockJSConnection "+this.id+">"};SockJSConnection.prototype.write=function(e){return this._session.send(""+e)};SockJSConnection.prototype.end=function(e){if(e){this.write(e)}this.close();return null};SockJSConnection.prototype.close=function(e,t){return this._session.close(e,t)};SockJSConnection.prototype.destroy=function(){this.end();return this.removeAllListeners()};SockJSConnection.prototype.destroySoon=function(){return this.destroy()};return SockJSConnection}(u.Stream);o.prototype.__defineGetter__("readable",function(){return this._session.readyState===a.OPEN});o.prototype.__defineGetter__("writable",function(){return this._session.readyState===a.OPEN});o.prototype.__defineGetter__("readyState",function(){return this._session.readyState});i={};n=function(){function Session(e,t){this.session_id=e;this.heartbeat_delay=t.options.heartbeat_delay;this.disconnect_delay=t.options.disconnect_delay;this.prefix=t.options.prefix;this.send_buffer=[];this.is_closing=false;this.readyState=a.CONNECTING;if(this.session_id){i[this.session_id]=this}this.timeout_cb=function(e){return function(){return e.didTimeout()}}(this);this.to_tref=setTimeout(this.timeout_cb,this.disconnect_delay);this.connection=new o(this);this.emit_open=function(e){return function(){e.emit_open=null;return t.emit("connection",e.connection)}}(this)}Session.prototype.register=function(e,t){if(this.recv){t.doSendFrame(h(2010,"Another connection still open"));t.didClose();return}if(this.to_tref){clearTimeout(this.to_tref);this.to_tref=null}if(this.readyState===a.CLOSING){this.flushToRecv(t);t.doSendFrame(this.close_frame);t.didClose();this.to_tref=setTimeout(this.timeout_cb,this.disconnect_delay);return}this.recv=t;this.recv.session=this;this.decorateConnection(e);if(this.readyState===a.CONNECTING){this.recv.doSendFrame("o");this.readyState=a.OPEN;process.nextTick(this.emit_open)}if(!this.recv){return}this.tryFlush()};Session.prototype.decorateConnection=function(e){var t,r,i,s,n,o,a,h,c,u;if(!(c=this.recv.connection)){c=this.recv.response.connection}try{a=c.remoteAddress;h=c.remotePort;t=c.address()}catch(e){u=e}if(a){this.connection.remoteAddress=a;this.connection.remotePort=h;this.connection.address=t}this.connection.url=e.url;this.connection.pathname=e.pathname;this.connection.protocol=this.recv.protocol;r={};o=["referer","x-client-ip","x-forwarded-for","x-forwarded-host","x-forwarded-port","x-cluster-client-ip","via","x-real-ip","x-forwarded-proto","x-ssl","dnt","host","user-agent","accept-language"];for(i=0,n=o.length;i<n;i++){s=o[i];if(e.headers[s]){r[s]=e.headers[s]}}if(r){return this.connection.headers=r}};Session.prototype.unregister=function(){var e;e=this.recv.delay_disconnect;this.recv.session=null;this.recv=null;if(this.to_tref){clearTimeout(this.to_tref)}if(e){return this.to_tref=setTimeout(this.timeout_cb,this.disconnect_delay)}else{return this.timeout_cb()}};Session.prototype.flushToRecv=function(e){var t,r;if(this.send_buffer.length>0){t=[this.send_buffer,[]],r=t[0],this.send_buffer=t[1];e.doSendBulk(r);return true}return false};Session.prototype.tryFlush=function(){var e;if(!this.flushToRecv(this.recv)||!this.to_tref){if(this.to_tref){clearTimeout(this.to_tref)}e=function(t){return function(){if(t.recv){t.to_tref=setTimeout(e,t.heartbeat_delay);return t.recv.heartbeat()}}}(this);this.to_tref=setTimeout(e,this.heartbeat_delay)}};Session.prototype.didTimeout=function(){if(this.to_tref){clearTimeout(this.to_tref);this.to_tref=null}if(this.readyState!==a.CONNECTING&&this.readyState!==a.OPEN&&this.readyState!==a.CLOSING){throw Error("INVALID_STATE_ERR")}if(this.recv){throw Error("RECV_STILL_THERE")}this.readyState=a.CLOSED;this.connection.emit("end");this.connection.emit("close");this.connection=null;if(this.session_id){delete i[this.session_id];return this.session_id=null}};Session.prototype.didMessage=function(e){if(this.readyState===a.OPEN){this.connection.emit("data",e)}};Session.prototype.send=function(e){if(this.readyState!==a.OPEN){return false}this.send_buffer.push(""+e);if(this.recv){this.tryFlush()}return true};Session.prototype.close=function(e,t){if(e==null){e=1e3}if(t==null){t="Normal closure"}if(this.readyState!==a.OPEN){return false}this.readyState=a.CLOSING;this.close_frame=h(e,t);if(this.recv){this.recv.doSendFrame(this.close_frame);if(this.recv){this.recv.didClose()}if(this.recv){this.unregister()}}return true};return Session}();n.bySessionId=function(e){if(!e){return null}return i[e]||null};c=function(e,t,r,i){var s;s=n.bySessionId(r);if(!s){s=new n(r,t)}s.register(e,i);return s};t.register=function(e,t,r){return c(e,t,e.session,r)};t.registerNoSession=function(e,t,r){return c(e,t,void 0,r)};e=function(){function GenericReceiver(e){this.thingy=e;this.setUp(this.thingy)}GenericReceiver.prototype.setUp=function(){this.thingy_end_cb=function(e){return function(){return e.didAbort()}}(this);this.thingy.addListener("close",this.thingy_end_cb);return this.thingy.addListener("end",this.thingy_end_cb)};GenericReceiver.prototype.tearDown=function(){this.thingy.removeListener("close",this.thingy_end_cb);this.thingy.removeListener("end",this.thingy_end_cb);return this.thingy_end_cb=null};GenericReceiver.prototype.didAbort=function(){this.delay_disconnect=false;return this.didClose()};GenericReceiver.prototype.didClose=function(){if(this.thingy){this.tearDown(this.thingy);this.thingy=null}if(this.session){return this.session.unregister()}};GenericReceiver.prototype.doSendBulk=function(e){var t,r;r=function(){var r,i,s;s=[];for(r=0,i=e.length;r<i;r++){t=e[r];s.push(f.quote(t))}return s}();return this.doSendFrame("a"+"["+r.join(",")+"]")};GenericReceiver.prototype.heartbeat=function(){return this.doSendFrame("h")};return GenericReceiver}();s=function(e){l(ResponseReceiver,e);ResponseReceiver.prototype.max_response_size=void 0;ResponseReceiver.prototype.delay_disconnect=true;function ResponseReceiver(e,t,r){var i;this.request=e;this.response=t;this.options=r;this.curr_response_size=0;try{this.request.connection.setKeepAlive(true,5e3)}catch(e){i=e}ResponseReceiver.__super__.constructor.call(this,this.request.connection);if(this.max_response_size===void 0){this.max_response_size=this.options.response_limit}}ResponseReceiver.prototype.doSendFrame=function(e){var t,r;this.curr_response_size+=e.length;t=false;try{this.response.write(e);t=true}catch(e){r=e}if(this.max_response_size&&this.curr_response_size>=this.max_response_size){this.didClose()}return t};ResponseReceiver.prototype.didClose=function(){var e;ResponseReceiver.__super__.didClose.apply(this,arguments);try{this.response.end()}catch(t){e=t}return this.response=null};return ResponseReceiver}(e);t.GenericReceiver=e;t.Transport=a;t.Session=n;t.ResponseReceiver=s;t.SockJSConnection=o}).call(this)},2666:function(e,t,r){(function(){var e,i,s,n,o;i=r(6417);t.array_intersection=e=function(e,t){var r,i,s,n;n=[];for(i=0,s=e.length;i<s;i++){r=e[i];if(t.indexOf(r)!==-1){n.push(r)}}return n};t.escape_selected=function(e,t){var r,i,s,n,o,a,h,c,u,f;a={};t="%"+t;for(s=0,o=t.length;s<o;s++){r=t[s];a[r]=escape(r)}c=new RegExp("(["+t+"])");h=e.split(c);for(i=n=0,u=h.length;0<=u?n<u:n>u;i=0<=u?++n:--n){f=h[i];if(f.length===1&&f in a){h[i]=a[f]}}return h.join("")};t.buffer_concat=function(e,t){var r;r=new Buffer(e.length+t.length);e.copy(r);t.copy(r,e.length);return r};t.md5_hex=function(e){return i.createHash("md5").update(e).digest("hex")};t.sha1_base64=function(e){return i.createHash("sha1").update(e).digest("base64")};t.timeout_chain=function(e){var r,i,s,n;e=e.slice(0);if(!e.length){return}i=e.shift(),s=i[0],n=i[1];r=function(r){return function(){n();return t.timeout_chain(e)}}(this);return setTimeout(r,s)};t.objectExtend=function(e,t){var r;for(r in t){if(t.hasOwnProperty(r)){e[r]=t[r]}}return e};t.overshadowListeners=function(e,t,r){var i,s;s=e.listeners(t).slice(0);e.removeAllListeners(t);i=function(){var e,t,i;if(r.apply(this,arguments)!==true){for(e=0,t=s.length;e<t;e++){i=s[e];i.apply(this,arguments)}return false}return true};return e.addListener(t,i)};s=/[\x00-\x1f\ud800-\udfff\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufff0-\uffff]/g;o=function(e){var t,r,i;i={};t=function(){var e,t;t=[];for(r=e=0;e<65536;r=++e){t.push(String.fromCharCode(r))}return t}();e.lastIndex=0;t.join("").replace(e,function(e){return i[e]="\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)});return i};n=o(s);t.quote=function(e){var t;t=JSON.stringify(e);s.lastIndex=0;if(!s.test(t)){return t}return t.replace(s,function(e){return n[e]})};t.parseCookie=function(e){var t,r,i,s,n,o;r={};if(e){o=e.split(";");for(i=0,s=o.length;i<s;i++){t=o[i];n=t.split("=");r[n[0].trim()]=(n[1]||"").trim()}}return r};t.random32=function(){var e,t;e=i.randomBytes(4);t=[e[0],e[1],e[2],e[3]];return t[0]+t[1]*256+t[2]*256*256+t[3]*256*256*256}}).call(this)},8399:function(e,t,r){(function(){var e,i,s,n,o,a,h,c;h=r(8835);a=r(1191);n=r(5747);o=r(8605);c=r(2666);i=function(e,t,r,i,s){var n,o,a;try{o=[];while(t.length>0){n=t.shift();r.last_fun=n;o.push(s=e[n](r,i,s,r.next_filter))}return o}catch(t){a=t;if(typeof a==="object"&&"status"in a){if(a.status===0){return}else if("handle_"+a.status in e){e["handle_"+a.status](r,i,a)}else{e["handle_error"](r,i,a)}}else{e["handle_error"](r,i,a)}return e["log_request"](r,i,true)}};s=function(e,t){var r;r={Connection:"close"};t.writeHead=function(i,s){var n,a,h;if(s==null){s={}}a=[];a.push("HTTP/"+e.httpVersion+" "+i+" "+o.STATUS_CODES[i]);c.objectExtend(r,s);for(n in r){a.push(n+": "+r[n])}a=a.concat(["",""]);try{return t.write(a.join("\r\n"))}catch(e){h=e}};return t.setHeader=function(e,t){return r[e]=t}};t.generateHandler=function(e,t){return function(r,n,o){var a,u,f,p,l,d,_,v,y,g,m,S;if(typeof n.writeHead==="undefined"){s(r,n)}c.objectExtend(r,h.parse(r.url,true));r.start_date=new Date;u=false;a=[];for(l=0,_=t.length;l<_;l++){S=t[l];y=S[0],g=S[1],f=S[2];if(g.constructor!==Array){g=[g]}v=r.pathname.match(g[0]);if(!v){continue}if(!r.method.match(new RegExp(y))){a.push(y);continue}for(p=d=1,m=g.length;1<=m?d<m:d>m;p=1<=m?++d:--d){r[g[p]]=v[p]}f=f.slice(0);f.push("log_request");r.next_filter=function(t){return i(e,f,r,n,t)};r.next_filter(o);u=true;break}if(!u){if(a.length!==0){e["handle_405"](r,n,a)}else{e["handle_404"](r,n)}e["log_request"](r,n,true)}}};t.GenericApp=e=function(){function GenericApp(){}GenericApp.prototype.handle_404=function(e,t,r){if(t.finished){return r}t.writeHead(404,{});t.end();return true};GenericApp.prototype.handle_405=function(e,t,r){t.writeHead(405,{Allow:r.join(", ")});t.end();return true};GenericApp.prototype.handle_error=function(e,t,r){if(t.finished){return r}if(typeof r==="object"&&"status"in r){t.writeHead(r.status,{});t.end(r.message||"")}else{try{t.writeHead(500,{});t.end("500 - Internal Server Error")}catch(e){r=e}this.log("error",'Exception on "'+e.method+" "+e.href+'" in filter "'+e.last_fun+'":\n'+(r.stack||r))}return true};GenericApp.prototype.log_request=function(e,t,r){var i;i=new Date-e.start_date;this.log("info",e.method+" "+e.url+" "+i+"ms "+(t.finished?t.statusCode:"(unfinished)"));return r};GenericApp.prototype.log=function(e,t){return console.log(t)};GenericApp.prototype.expose_html=function(e,t,r){if(t.finished){return r}if(!t.getHeader("Content-Type")){t.setHeader("Content-Type","text/html; charset=UTF-8")}return this.expose(e,t,r)};GenericApp.prototype.expose_json=function(e,t,r){if(t.finished){return r}if(!t.getHeader("Content-Type")){t.setHeader("Content-Type","application/json")}return this.expose(e,t,JSON.stringify(r))};GenericApp.prototype.expose=function(e,t,r){if(t.finished){return r}if(r&&!t.getHeader("Content-Type")){t.setHeader("Content-Type","text/plain")}if(r){t.setHeader("Content-Length",r.length)}t.writeHead(t.statusCode);t.end(r,"utf8");return true};GenericApp.prototype.serve_file=function(e,t,r,i){var s;s=function(e,r){if(e){t.writeHead(500);t.end("can't read file")}else{t.setHeader("Content-length",r.length);t.writeHead(t.statusCode,t.headers);t.end(r,"utf8")}return i(true)};n.readFile(r,s);throw{status:0}};GenericApp.prototype.cache_for=function(e,t,r){var i;t.cache_for=t.cache_for||365*24*60*60;t.setHeader("Cache-Control","public, max-age="+t.cache_for);i=new Date;i.setTime(i.getTime()+t.cache_for*1e3);t.setHeader("Expires",i.toGMTString());return r};GenericApp.prototype.h_no_cache=function(e,t,r){t.setHeader("Cache-Control","no-store, no-cache, no-transform, must-revalidate, max-age=0");return r};GenericApp.prototype.expect_form=function(e,t,r,i){var s;s=new Buffer(0);e.on("data",function(e){return function(e){return s=c.buffer_concat(s,new Buffer(e,"binary"))}}(this));e.on("end",function(t){return function(){var r;s=s.toString("utf-8");switch((e.headers["content-type"]||"").split(";")[0]){case"application/x-www-form-urlencoded":r=a.parse(s);break;case"text/plain":case"":r=s;break;default:t.log("error","Unsupported content-type "+e.headers["content-type"]);r=void 0}return i(r)}}(this));throw{status:0}};GenericApp.prototype.expect_xhr=function(e,t,r,i){var s;s=new Buffer(0);e.on("data",function(e){return function(e){return s=c.buffer_concat(s,new Buffer(e,"binary"))}}(this));e.on("end",function(t){return function(){var r;s=s.toString("utf-8");switch((e.headers["content-type"]||"").split(";")[0]){case"text/plain":case"T":case"application/json":case"application/xml":case"":case"text/xml":r=s;break;default:t.log("error","Unsupported content-type "+e.headers["content-type"]);r=void 0}return i(r)}}(this));throw{status:0}};return GenericApp}()}).call(this)},2707:e=>{var t=[];for(var r=0;r<256;++r){t[r]=(r+256).toString(16).substr(1)}function bytesToUuid(e,r){var i=r||0;var s=t;return[s[e[i++]],s[e[i++]],s[e[i++]],s[e[i++]],"-",s[e[i++]],s[e[i++]],"-",s[e[i++]],s[e[i++]],"-",s[e[i++]],s[e[i++]],"-",s[e[i++]],s[e[i++]],s[e[i++]],s[e[i++]],s[e[i++]],s[e[i++]]].join("")}e.exports=bytesToUuid},5859:(e,t,r)=>{var i=r(6417);e.exports=function nodeRNG(){return i.randomBytes(16)}},824:(e,t,r)=>{var i=r(5859);var s=r(2707);function v4(e,t,r){var n=t&&r||0;if(typeof e=="string"){t=e==="binary"?new Array(16):null;e=null}e=e||{};var o=e.random||(e.rng||i)();o[6]=o[6]&15|64;o[8]=o[8]&63|128;if(t){for(var a=0;a<16;++a){t[n+a]=o[a]}}return t||s(o)}e.exports=v4},7685:(e,t,r)=>{"use strict";var i=r(9127),s=r(2600),n=r(4373);var o={client:function(e,t){t=t||{};if(t.masking===undefined)t.masking=true;return new s(e,t)},server:function(e){e=e||{};if(e.requireMasking===undefined)e.requireMasking=true;return new n(e)},http:function(){return n.http.apply(n,arguments)},isSecureRequest:function(e){return n.isSecureRequest(e)},isWebSocket:function(e){return i.isWebSocket(e)},validateOptions:function(e,t){i.validateOptions(e,t)}};e.exports=o},9127:(e,t,r)=>{"use strict";var i=r(1867).Buffer,s=r(8614).EventEmitter,n=r(1669),o=r(102),a=r(7404),h=r(9635);var c=function(e,t,r){s.call(this);c.validateOptions(r||{},["maxLength","masking","requireMasking","protocols"]);this._request=e;this._reader=new h;this._options=r||{};this._maxLength=this._options.maxLength||this.MAX_LENGTH;this._headers=new a;this.__queue=[];this.readyState=0;this.url=t;this.io=new o.IO(this);this.messages=new o.Messages(this);this._bindEventListeners()};n.inherits(c,s);c.isWebSocket=function(e){var t=e.headers.connection||"",r=e.headers.upgrade||"";return e.method==="GET"&&t.toLowerCase().split(/ *, */).indexOf("upgrade")>=0&&r.toLowerCase()==="websocket"};c.validateOptions=function(e,t){for(var r in e){if(t.indexOf(r)<0)throw new Error("Unrecognized option: "+r)}};var u={MAX_LENGTH:67108863,STATES:["connecting","open","closing","closed"],_bindEventListeners:function(){var e=this;this.messages.on("error",function(){});this.on("message",function(t){var r=e.messages;if(r.readable)r.emit("data",t.data)});this.on("error",function(t){var r=e.messages;if(r.readable)r.emit("error",t)});this.on("close",function(){var t=e.messages;if(!t.readable)return;t.readable=t.writable=false;t.emit("end")})},getState:function(){return this.STATES[this.readyState]||null},addExtension:function(e){return false},setHeader:function(e,t){if(this.readyState>0)return false;this._headers.set(e,t);return true},start:function(){if(this.readyState!==0)return false;if(!c.isWebSocket(this._request))return this._failHandshake(new Error("Not a WebSocket request"));var e;try{e=this._handshakeResponse()}catch(e){return this._failHandshake(e)}this._write(e);if(this._stage!==-1)this._open();return true},_failHandshake:function(e){var t=new a;t.set("Content-Type","text/plain");t.set("Content-Length",i.byteLength(e.message,"utf8"));t=["HTTP/1.1 400 Bad Request",t.toString(),e.message];this._write(i.from(t.join("\r\n"),"utf8"));this._fail("protocol_error",e.message);return false},text:function(e){return this.frame(e)},binary:function(e){return false},ping:function(){return false},pong:function(){return false},close:function(e,t){if(this.readyState!==1)return false;this.readyState=3;this.emit("close",new c.CloseEvent(null,null));return true},_open:function(){this.readyState=1;this.__queue.forEach(function(e){this.frame.apply(this,e)},this);this.__queue=[];this.emit("open",new c.OpenEvent)},_queue:function(e){this.__queue.push(e);return true},_write:function(e){var t=this.io;if(t.readable)t.emit("data",e)},_fail:function(e,t){this.readyState=2;this.emit("error",new Error(t));this.close()}};for(var f in u)c.prototype[f]=u[f];c.ConnectEvent=function(){};c.OpenEvent=function(){};c.CloseEvent=function(e,t){this.code=e;this.reason=t};c.MessageEvent=function(e){this.data=e};c.PingEvent=function(e){this.data=e};c.PongEvent=function(e){this.data=e};e.exports=c},2600:(e,t,r)=>{"use strict";var i=r(1867).Buffer,s=r(6417),n=r(8835),o=r(1669),a=r(7282),h=r(9127),c=r(7772),u=r(7782);var f=function(e,t){this.version="hybi-"+c.VERSION;c.call(this,null,e,t);this.readyState=-1;this._key=f.generateKey();this._accept=c.generateAccept(this._key);this._http=new a("response");var r=n.parse(this.url),s=r.auth&&i.from(r.auth,"utf8").toString("base64");if(this.VALID_PROTOCOLS.indexOf(r.protocol)<0)throw new Error(this.url+" is not a valid WebSocket URL");this._pathname=(r.pathname||"/")+(r.search||"");this._headers.set("Host",r.host);this._headers.set("Upgrade","websocket");this._headers.set("Connection","Upgrade");this._headers.set("Sec-WebSocket-Key",this._key);this._headers.set("Sec-WebSocket-Version",c.VERSION);if(this._protocols.length>0)this._headers.set("Sec-WebSocket-Protocol",this._protocols.join(", "));if(s)this._headers.set("Authorization","Basic "+s)};o.inherits(f,c);f.generateKey=function(){return s.randomBytes(16).toString("base64")};var p={VALID_PROTOCOLS:["ws:","wss:"],proxy:function(e,t){return new u(this,e,t)},start:function(){if(this.readyState!==-1)return false;this._write(this._handshakeRequest());this.readyState=0;return true},parse:function(e){if(this.readyState===3)return;if(this.readyState>0)return c.prototype.parse.call(this,e);this._http.parse(e);if(!this._http.isComplete())return;this._validateHandshake();if(this.readyState===3)return;this._open();this.parse(this._http.body)},_handshakeRequest:function(){var e=this._extensions.generateOffer();if(e)this._headers.set("Sec-WebSocket-Extensions",e);var t="GET "+this._pathname+" HTTP/1.1",r=[t,this._headers.toString(),""];return i.from(r.join("\r\n"),"utf8")},_failHandshake:function(e){e="Error during WebSocket handshake: "+e;this.readyState=3;this.emit("error",new Error(e));this.emit("close",new h.CloseEvent(this.ERRORS.protocol_error,e))},_validateHandshake:function(){this.statusCode=this._http.statusCode;this.headers=this._http.headers;if(this._http.error)return this._failHandshake(this._http.error.message);if(this._http.statusCode!==101)return this._failHandshake("Unexpected response code: "+this._http.statusCode);var e=this._http.headers,t=e["upgrade"]||"",r=e["connection"]||"",i=e["sec-websocket-accept"]||"",s=e["sec-websocket-protocol"]||"";if(t==="")return this._failHandshake("'Upgrade' header is missing");if(t.toLowerCase()!=="websocket")return this._failHandshake("'Upgrade' header value is not 'WebSocket'");if(r==="")return this._failHandshake("'Connection' header is missing");if(r.toLowerCase()!=="upgrade")return this._failHandshake("'Connection' header value is not 'Upgrade'");if(i!==this._accept)return this._failHandshake("Sec-WebSocket-Accept mismatch");this.protocol=null;if(s!==""){if(this._protocols.indexOf(s)<0)return this._failHandshake("Sec-WebSocket-Protocol mismatch");else this.protocol=s}try{this._extensions.activate(this.headers["sec-websocket-extensions"])}catch(e){return this._failHandshake(e.message)}}};for(var l in p)f.prototype[l]=p[l];e.exports=f},9539:(e,t,r)=>{"use strict";var i=r(1867).Buffer,s=r(9127),n=r(1669);var o=function(e,t,r){s.apply(this,arguments);this._stage=0;this.version="hixie-75";this._headers.set("Upgrade","WebSocket");this._headers.set("Connection","Upgrade");this._headers.set("WebSocket-Origin",this._request.headers.origin);this._headers.set("WebSocket-Location",this.url)};n.inherits(o,s);var a={close:function(){if(this.readyState===3)return false;this.readyState=3;this.emit("close",new s.CloseEvent(null,null));return true},parse:function(e){if(this.readyState>1)return;this._reader.put(e);this._reader.eachByte(function(e){var t;switch(this._stage){case-1:this._body.push(e);this._sendHandshakeBody();break;case 0:this._parseLeadingByte(e);break;case 1:this._length=(e&127)+128*this._length;if(this._closing&&this._length===0){return this.close()}else if((e&128)!==128){if(this._length===0){this._stage=0}else{this._skipped=0;this._stage=2}}break;case 2:if(e===255){this._stage=0;t=i.from(this._buffer).toString("utf8",0,this._buffer.length);this.emit("message",new s.MessageEvent(t))}else{if(this._length){this._skipped+=1;if(this._skipped===this._length)this._stage=0}else{this._buffer.push(e);if(this._buffer.length>this._maxLength)return this.close()}}break}},this)},frame:function(e){if(this.readyState===0)return this._queue([e]);if(this.readyState>1)return false;if(typeof e!=="string")e=e.toString();var t=i.byteLength(e),r=i.allocUnsafe(t+2);r[0]=0;r.write(e,1);r[r.length-1]=255;this._write(r);return true},_handshakeResponse:function(){var e="HTTP/1.1 101 Web Socket Protocol Handshake",t=[e,this._headers.toString(),""];return i.from(t.join("\r\n"),"utf8")},_parseLeadingByte:function(e){if((e&128)===128){this._length=0;this._stage=1}else{delete this._length;delete this._skipped;this._buffer=[];this._stage=2}}};for(var h in a)o.prototype[h]=a[h];e.exports=o},5844:(e,t,r)=>{"use strict";var i=r(1867).Buffer,s=r(9127),n=r(9539),o=r(6417),a=r(1669);var h=function(e){return parseInt((e.match(/[0-9]/g)||[]).join(""),10)};var c=function(e){return(e.match(/ /g)||[]).length};var u=function(e,t,r){n.apply(this,arguments);this._stage=-1;this._body=[];this.version="hixie-76";this._headers.clear();this._headers.set("Upgrade","WebSocket");this._headers.set("Connection","Upgrade");this._headers.set("Sec-WebSocket-Origin",this._request.headers.origin);this._headers.set("Sec-WebSocket-Location",this.url)};a.inherits(u,n);var f={BODY_SIZE:8,start:function(){if(!n.prototype.start.call(this))return false;this._started=true;this._sendHandshakeBody();return true},close:function(){if(this.readyState===3)return false;if(this.readyState===1)this._write(i.from([255,0]));this.readyState=3;this.emit("close",new s.CloseEvent(null,null));return true},_handshakeResponse:function(){var e=this._request.headers,t=e["sec-websocket-key1"],r=e["sec-websocket-key2"];if(!t)throw new Error("Missing required header: Sec-WebSocket-Key1");if(!r)throw new Error("Missing required header: Sec-WebSocket-Key2");var s=h(t),n=c(t),o=h(r),a=c(r);if(s%n!==0||o%a!==0)throw new Error("Client sent invalid Sec-WebSocket-Key headers");this._keyValues=[s/n,o/a];var u="HTTP/1.1 101 WebSocket Protocol Handshake",e=[u,this._headers.toString(),""];return i.from(e.join("\r\n"),"binary")},_handshakeSignature:function(){if(this._body.length<this.BODY_SIZE)return null;var e=o.createHash("md5"),t=i.allocUnsafe(8+this.BODY_SIZE);t.writeUInt32BE(this._keyValues[0],0);t.writeUInt32BE(this._keyValues[1],4);i.from(this._body).copy(t,8,0,this.BODY_SIZE);e.update(t);return i.from(e.digest("binary"),"binary")},_sendHandshakeBody:function(){if(!this._started)return;var e=this._handshakeSignature();if(!e)return;this._write(e);this._stage=0;this._open();if(this._body.length>this.BODY_SIZE)this.parse(this._body.slice(this.BODY_SIZE))},_parseLeadingByte:function(e){if(e!==255)return n.prototype._parseLeadingByte.call(this,e);this._closing=true;this._length=0;this._stage=1}};for(var p in f)u.prototype[p]=f[p];e.exports=u},7404:e=>{"use strict";var t=function(){this.clear()};t.prototype.ALLOWED_DUPLICATES=["set-cookie","set-cookie2","warning","www-authenticate"];t.prototype.clear=function(){this._sent={};this._lines=[]};t.prototype.set=function(e,t){if(t===undefined)return;e=this._strip(e);t=this._strip(t);var r=e.toLowerCase();if(!this._sent.hasOwnProperty(r)||this.ALLOWED_DUPLICATES.indexOf(r)>=0){this._sent[r]=true;this._lines.push(e+": "+t+"\r\n")}};t.prototype.toString=function(){return this._lines.join("")};t.prototype._strip=function(e){return e.toString().replace(/^ */,"").replace(/ *$/,"")};e.exports=t},7772:(e,t,r)=>{"use strict";var i=r(1867).Buffer,s=r(6417),n=r(1669),o=r(6901),a=r(9127),h=r(4602),c=r(8624);var u=function(e,t,r){a.apply(this,arguments);this._extensions=new o;this._stage=0;this._masking=this._options.masking;this._protocols=this._options.protocols||[];this._requireMasking=this._options.requireMasking;this._pingCallbacks={};if(typeof this._protocols==="string")this._protocols=this._protocols.split(/ *, */);if(!this._request)return;var i=this._request.headers["sec-websocket-protocol"],s=this._protocols;if(i!==undefined){if(typeof i==="string")i=i.split(/ *, */);this.protocol=i.filter(function(e){return s.indexOf(e)>=0})[0]}this.version="hybi-"+u.VERSION};n.inherits(u,a);u.VERSION="13";u.mask=function(e,t,r){if(!t||t.length===0)return e;r=r||0;for(var i=0,s=e.length-r;i<s;i++){e[r+i]=e[r+i]^t[i%4]}return e};u.generateAccept=function(e){var t=s.createHash("sha1");t.update(e+u.GUID);return t.digest("base64")};u.GUID="258EAFA5-E914-47DA-95CA-C5AB0DC85B11";var f={FIN:128,MASK:128,RSV1:64,RSV2:32,RSV3:16,OPCODE:15,LENGTH:127,OPCODES:{continuation:0,text:1,binary:2,close:8,ping:9,pong:10},OPCODE_CODES:[0,1,2,8,9,10],MESSAGE_OPCODES:[0,1,2],OPENING_OPCODES:[1,2],ERRORS:{normal_closure:1e3,going_away:1001,protocol_error:1002,unacceptable:1003,encoding_error:1007,policy_violation:1008,too_large:1009,extension_error:1010,unexpected_condition:1011},ERROR_CODES:[1e3,1001,1002,1003,1007,1008,1009,1010,1011],DEFAULT_ERROR_CODE:1e3,MIN_RESERVED_ERROR:3e3,MAX_RESERVED_ERROR:4999,UTF8_MATCH:/^([\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})*$/,addExtension:function(e){this._extensions.add(e);return true},parse:function(e){this._reader.put(e);var t=true;while(t){switch(this._stage){case 0:t=this._reader.read(1);if(t)this._parseOpcode(t[0]);break;case 1:t=this._reader.read(1);if(t)this._parseLength(t[0]);break;case 2:t=this._reader.read(this._frame.lengthBytes);if(t)this._parseExtendedLength(t);break;case 3:t=this._reader.read(4);if(t){this._stage=4;this._frame.maskingKey=t}break;case 4:t=this._reader.read(this._frame.length);if(t){this._stage=0;this._emitFrame(t)}break;default:t=null}}},text:function(e){if(this.readyState>1)return false;return this.frame(e,"text")},binary:function(e){if(this.readyState>1)return false;return this.frame(e,"binary")},ping:function(e,t){if(this.readyState>1)return false;e=e||"";if(t)this._pingCallbacks[e]=t;return this.frame(e,"ping")},pong:function(e){if(this.readyState>1)return false;e=e||"";return this.frame(e,"pong")},close:function(e,t){e=e||"";t=t||this.ERRORS.normal_closure;if(this.readyState<=0){this.readyState=3;this.emit("close",new a.CloseEvent(t,e));return true}else if(this.readyState===1){this.readyState=2;this._extensions.close(function(){this.frame(e,"close",t)},this);return true}else{return false}},frame:function(e,t,r){if(this.readyState<=0)return this._queue([e,t,r]);if(this.readyState>2)return false;if(e instanceof Array)e=i.from(e);if(typeof e==="number")e=e.toString();var n=new c,o=typeof e==="string",a,u;n.rsv1=n.rsv2=n.rsv3=false;n.opcode=this.OPCODES[t||(o?"text":"binary")];a=o?i.from(e,"utf8"):e;if(r){u=a;a=i.allocUnsafe(2+u.length);a.writeUInt16BE(r,0);u.copy(a,2)}n.data=a;var f=function(e){var t=new h;t.final=true;t.rsv1=e.rsv1;t.rsv2=e.rsv2;t.rsv3=e.rsv3;t.opcode=e.opcode;t.masked=!!this._masking;t.length=e.data.length;t.payload=e.data;if(t.masked)t.maskingKey=s.randomBytes(4);this._sendFrame(t)};if(this.MESSAGE_OPCODES.indexOf(n.opcode)>=0)this._extensions.processOutgoingMessage(n,function(e,t){if(e)return this._fail("extension_error",e.message);f.call(this,t)},this);else f.call(this,n);return true},_sendFrame:function(e){var t=e.length,r=t<=125?2:t<=65535?4:10,s=r+(e.masked?4:0),n=i.allocUnsafe(s+t),o=e.masked?this.MASK:0;n[0]=(e.final?this.FIN:0)|(e.rsv1?this.RSV1:0)|(e.rsv2?this.RSV2:0)|(e.rsv3?this.RSV3:0)|e.opcode;if(t<=125){n[1]=o|t}else if(t<=65535){n[1]=o|126;n.writeUInt16BE(t,2)}else{n[1]=o|127;n.writeUInt32BE(Math.floor(t/4294967296),2);n.writeUInt32BE(t%4294967296,6)}e.payload.copy(n,s);if(e.masked){e.maskingKey.copy(n,r);u.mask(n,e.maskingKey,s)}this._write(n)},_handshakeResponse:function(){var e=this._request.headers["sec-websocket-key"],t=this._request.headers["sec-websocket-version"];if(t!==u.VERSION)throw new Error("Unsupported WebSocket version: "+t);if(typeof e!=="string")throw new Error("Missing handshake request header: Sec-WebSocket-Key");this._headers.set("Upgrade","websocket");this._headers.set("Connection","Upgrade");this._headers.set("Sec-WebSocket-Accept",u.generateAccept(e));if(this.protocol)this._headers.set("Sec-WebSocket-Protocol",this.protocol);var r=this._extensions.generateResponse(this._request.headers["sec-websocket-extensions"]);if(r)this._headers.set("Sec-WebSocket-Extensions",r);var s="HTTP/1.1 101 Switching Protocols",n=[s,this._headers.toString(),""];return i.from(n.join("\r\n"),"utf8")},_shutdown:function(e,t,r){delete this._frame;delete this._message;this._stage=5;var i=this.readyState===1;this.readyState=2;this._extensions.close(function(){if(i)this.frame(t,"close",e);this.readyState=3;if(r)this.emit("error",new Error(t));this.emit("close",new a.CloseEvent(e,t))},this)},_fail:function(e,t){if(this.readyState>1)return;this._shutdown(this.ERRORS[e],t,true)},_parseOpcode:function(e){var t=[this.RSV1,this.RSV2,this.RSV3].map(function(t){return(e&t)===t});var r=this._frame=new h;r.final=(e&this.FIN)===this.FIN;r.rsv1=t[0];r.rsv2=t[1];r.rsv3=t[2];r.opcode=e&this.OPCODE;this._stage=1;if(!this._extensions.validFrameRsv(r))return this._fail("protocol_error","One or more reserved bits are on: reserved1 = "+(r.rsv1?1:0)+", reserved2 = "+(r.rsv2?1:0)+", reserved3 = "+(r.rsv3?1:0));if(this.OPCODE_CODES.indexOf(r.opcode)<0)return this._fail("protocol_error","Unrecognized frame opcode: "+r.opcode);if(this.MESSAGE_OPCODES.indexOf(r.opcode)<0&&!r.final)return this._fail("protocol_error","Received fragmented control frame: opcode = "+r.opcode);if(this._message&&this.OPENING_OPCODES.indexOf(r.opcode)>=0)return this._fail("protocol_error","Received new data frame but previous continuous frame is unfinished")},_parseLength:function(e){var t=this._frame;t.masked=(e&this.MASK)===this.MASK;t.length=e&this.LENGTH;if(t.length>=0&&t.length<=125){this._stage=t.masked?3:4;if(!this._checkFrameLength())return}else{this._stage=2;t.lengthBytes=t.length===126?2:8}if(this._requireMasking&&!t.masked)return this._fail("unacceptable","Received unmasked frame but masking is required")},_parseExtendedLength:function(e){var t=this._frame;t.length=this._readUInt(e);this._stage=t.masked?3:4;if(this.MESSAGE_OPCODES.indexOf(t.opcode)<0&&t.length>125)return this._fail("protocol_error","Received control frame having too long payload: "+t.length);if(!this._checkFrameLength())return},_checkFrameLength:function(){var e=this._message?this._message.length:0;if(e+this._frame.length>this._maxLength){this._fail("too_large","WebSocket frame length too large");return false}else{return true}},_emitFrame:function(e){var t=this._frame,r=t.payload=u.mask(e,t.maskingKey),i=t.opcode,s,n,o,h,f;delete this._frame;if(i===this.OPCODES.continuation){if(!this._message)return this._fail("protocol_error","Received unexpected continuation frame");this._message.pushFrame(t)}if(i===this.OPCODES.text||i===this.OPCODES.binary){this._message=new c;this._message.pushFrame(t)}if(t.final&&this.MESSAGE_OPCODES.indexOf(i)>=0)return this._emitMessage(this._message);if(i===this.OPCODES.close){n=r.length>=2?r.readUInt16BE(0):null;o=r.length>2?this._encode(r.slice(2)):null;if(!(r.length===0)&&!(n!==null&&n>=this.MIN_RESERVED_ERROR&&n<=this.MAX_RESERVED_ERROR)&&this.ERROR_CODES.indexOf(n)<0)n=this.ERRORS.protocol_error;if(r.length>125||r.length>2&&!o)n=this.ERRORS.protocol_error;this._shutdown(n||this.DEFAULT_ERROR_CODE,o||"")}if(i===this.OPCODES.ping){this.frame(r,"pong");this.emit("ping",new a.PingEvent(r.toString()))}if(i===this.OPCODES.pong){h=this._pingCallbacks;s=this._encode(r);f=h[s];delete h[s];if(f)f();this.emit("pong",new a.PongEvent(r.toString()))}},_emitMessage:function(e){var e=this._message;e.read();delete this._message;this._extensions.processIncomingMessage(e,function(e,t){if(e)return this._fail("extension_error",e.message);var r=t.data;if(t.opcode===this.OPCODES.text)r=this._encode(r);if(r===null)return this._fail("encoding_error","Could not decode a text frame as UTF-8");else this.emit("message",new a.MessageEvent(r))},this)},_encode:function(e){try{var t=e.toString("binary",0,e.length);if(!this.UTF8_MATCH.test(t))return null}catch(e){}return e.toString("utf8",0,e.length)},_readUInt:function(e){if(e.length===2)return e.readUInt16BE(0);return e.readUInt32BE(0)*4294967296+e.readUInt32BE(4)}};for(var p in f)u.prototype[p]=f[p];e.exports=u},4602:e=>{"use strict";var t=function(){};var r={final:false,rsv1:false,rsv2:false,rsv3:false,opcode:null,masked:false,maskingKey:null,lengthBytes:1,length:0,payload:null};for(var i in r)t.prototype[i]=r[i];e.exports=t},8624:(e,t,r)=>{"use strict";var i=r(1867).Buffer;var s=function(){this.rsv1=false;this.rsv2=false;this.rsv3=false;this.opcode=null;this.length=0;this._chunks=[]};var n={read:function(){return this.data=this.data||i.concat(this._chunks,this.length)},pushFrame:function(e){this.rsv1=this.rsv1||e.rsv1;this.rsv2=this.rsv2||e.rsv2;this.rsv3=this.rsv3||e.rsv3;if(this.opcode===null)this.opcode=e.opcode;this._chunks.push(e.payload);this.length+=e.length}};for(var o in n)s.prototype[o]=n[o];e.exports=s},7782:(e,t,r)=>{"use strict";var i=r(1867).Buffer,s=r(2413).Stream,n=r(8835),o=r(1669),a=r(9127),h=r(7404),c=r(7282);var u={"ws:":80,"wss:":443};var f=function(e,t,r){this._client=e;this._http=new c("response");this._origin=typeof e.url==="object"?e.url:n.parse(e.url);this._url=typeof t==="object"?t:n.parse(t);this._options=r||{};this._state=0;this.readable=this.writable=true;this._paused=false;this._headers=new h;this._headers.set("Host",this._origin.host);this._headers.set("Connection","keep-alive");this._headers.set("Proxy-Connection","keep-alive");var s=this._url.auth&&i.from(this._url.auth,"utf8").toString("base64");if(s)this._headers.set("Proxy-Authorization","Basic "+s)};o.inherits(f,s);var p={setHeader:function(e,t){if(this._state!==0)return false;this._headers.set(e,t);return true},start:function(){if(this._state!==0)return false;this._state=1;var e=this._origin,t=e.port||u[e.protocol],r="CONNECT "+e.hostname+":"+t+" HTTP/1.1";var s=[r,this._headers.toString(),""];this.emit("data",i.from(s.join("\r\n"),"utf8"));return true},pause:function(){this._paused=true},resume:function(){this._paused=false;this.emit("drain")},write:function(e){if(!this.writable)return false;this._http.parse(e);if(!this._http.isComplete())return!this._paused;this.statusCode=this._http.statusCode;this.headers=this._http.headers;if(this.statusCode===200){this.emit("connect",new a.ConnectEvent)}else{var t="Can't establish a connection to the server at "+this._origin.href;this.emit("error",new Error(t))}this.end();return!this._paused},end:function(e){if(!this.writable)return;if(e!==undefined)this.write(e);this.readable=this.writable=false;this.emit("close");this.emit("end")},destroy:function(){this.end()}};for(var l in p)f.prototype[l]=p[l];e.exports=f},4373:(e,t,r)=>{"use strict";var i=r(1669),s=r(7282),n=r(9127),o=r(9539),a=r(5844),h=r(7772);var c=function(e){n.call(this,null,null,e);this._http=new s("request")};i.inherits(c,n);var u={EVENTS:["open","message","error","close","ping","pong"],_bindEventListeners:function(){this.messages.on("error",function(){});this.on("error",function(){})},parse:function(e){if(this._delegate)return this._delegate.parse(e);this._http.parse(e);if(!this._http.isComplete())return;this.method=this._http.method;this.url=this._http.url;this.headers=this._http.headers;this.body=this._http.body;var t=this;this._delegate=c.http(this,this._options);this._delegate.messages=this.messages;this._delegate.io=this.io;this._open();this.EVENTS.forEach(function(e){this._delegate.on(e,function(r){t.emit(e,r)})},this);this.protocol=this._delegate.protocol;this.version=this._delegate.version;this.parse(this._http.body);this.emit("connect",new n.ConnectEvent)},_open:function(){this.__queue.forEach(function(e){this._delegate[e[0]].apply(this._delegate,e[1])},this);this.__queue=[]}};["addExtension","setHeader","start","frame","text","binary","ping","close"].forEach(function(e){u[e]=function(){if(this._delegate){return this._delegate[e].apply(this._delegate,arguments)}else{this.__queue.push([e,arguments]);return true}}});for(var f in u)c.prototype[f]=u[f];c.isSecureRequest=function(e){if(e.connection&&e.connection.authorized!==undefined)return true;if(e.socket&&e.socket.secure)return true;var t=e.headers;if(!t)return false;if(t["https"]==="on")return true;if(t["x-forwarded-ssl"]==="on")return true;if(t["x-forwarded-scheme"]==="https")return true;if(t["x-forwarded-proto"]==="https")return true;return false};c.determineUrl=function(e){var t=this.isSecureRequest(e)?"wss:":"ws:";return t+"//"+e.headers.host+e.url};c.http=function(e,t){t=t||{};if(t.requireMasking===undefined)t.requireMasking=true;var r=e.headers,i=r["sec-websocket-version"],s=r["sec-websocket-key"],n=r["sec-websocket-key1"],c=r["sec-websocket-key2"],u=this.determineUrl(e);if(i||s)return new h(e,u,t);else if(n||c)return new a(e,u,t);else return new o(e,u,t)};e.exports=c},9635:(e,t,r)=>{"use strict";var i=r(1867).Buffer;var s=function(){this._queue=[];this._queueSize=0;this._offset=0};s.prototype.put=function(e){if(!e||e.length===0)return;if(!i.isBuffer(e))e=i.from(e);this._queue.push(e);this._queueSize+=e.length};s.prototype.read=function(e){if(e>this._queueSize)return null;if(e===0)return i.alloc(0);this._queueSize-=e;var t=this._queue,r=e,s=t[0],n,o;if(s.length>=e){if(s.length===e){return t.shift()}else{o=s.slice(0,e);t[0]=s.slice(e);return o}}for(var a=0,h=t.length;a<h;a++){if(r<t[a].length)break;r-=t[a].length}n=t.splice(0,a);if(r>0&&t.length>0){n.push(t[0].slice(0,r));t[0]=t[0].slice(r)}return i.concat(n,e)};s.prototype.eachByte=function(e,t){var r,i,s;while(this._queue.length>0){r=this._queue[0];i=r.length;while(this._offset<i){s=this._offset;this._offset+=1;e.call(t,r[s])}this._offset=0;this._queue.shift()}};e.exports=s},7282:(e,t,r)=>{"use strict";var i=r(7119).m,s=r(1867).Buffer;var n={request:i.REQUEST||"request",response:i.RESPONSE||"response"};var o=function(e){this._type=e;this._parser=new i(n[e]);this._complete=false;this.headers={};var t=null,r=this;this._parser.onHeaderField=function(e,r,i){t=e.toString("utf8",r,r+i).toLowerCase()};this._parser.onHeaderValue=function(e,i,s){var n=e.toString("utf8",i,i+s);if(r.headers.hasOwnProperty(t))r.headers[t]+=", "+n;else r.headers[t]=n};this._parser.onHeadersComplete=this._parser[i.kOnHeadersComplete]=function(e,t,i,s,n,a){var h=arguments[0];if(typeof h==="object"){s=h.method;n=h.url;a=h.statusCode;i=h.headers}r.method=typeof s==="number"?o.METHODS[s]:s;r.statusCode=a;r.url=n;if(!i)return;for(var c=0,u=i.length,f,p;c<u;c+=2){f=i[c].toLowerCase();p=i[c+1];if(r.headers.hasOwnProperty(f))r.headers[f]+=", "+p;else r.headers[f]=p}r._complete=true}};o.METHODS={0:"DELETE",1:"GET",2:"HEAD",3:"POST",4:"PUT",5:"CONNECT",6:"OPTIONS",7:"TRACE",8:"COPY",9:"LOCK",10:"MKCOL",11:"MOVE",12:"PROPFIND",13:"PROPPATCH",14:"SEARCH",15:"UNLOCK",16:"BIND",17:"REBIND",18:"UNBIND",19:"ACL",20:"REPORT",21:"MKACTIVITY",22:"CHECKOUT",23:"MERGE",24:"M-SEARCH",25:"NOTIFY",26:"SUBSCRIBE",27:"UNSUBSCRIBE",28:"PATCH",29:"PURGE",30:"MKCALENDAR",31:"LINK",32:"UNLINK"};var a=process.version?process.version.match(/[0-9]+/g).map(function(e){return parseInt(e,10)}):[];if(a[0]===0&&a[1]===12){o.METHODS[16]="REPORT";o.METHODS[17]="MKACTIVITY";o.METHODS[18]="CHECKOUT";o.METHODS[19]="MERGE";o.METHODS[20]="M-SEARCH";o.METHODS[21]="NOTIFY";o.METHODS[22]="SUBSCRIBE";o.METHODS[23]="UNSUBSCRIBE";o.METHODS[24]="PATCH";o.METHODS[25]="PURGE"}o.prototype.isComplete=function(){return this._complete};o.prototype.parse=function(e){var t=this._parser.execute(e,0,e.length);if(typeof t!=="number"){this.error=t;this._complete=true;return}if(this._complete)this.body=t<e.length?e.slice(t):s.alloc(0)};e.exports=o},102:(e,t,r)=>{"use strict";var i=r(2413).Stream,s=r(1669);var n=function(e){this.readable=this.writable=true;this._paused=false;this._driver=e};s.inherits(n,i);n.prototype.pause=function(){this._paused=true;this._driver.messages._paused=true};n.prototype.resume=function(){this._paused=false;this.emit("drain");var e=this._driver.messages;e._paused=false;e.emit("drain")};n.prototype.write=function(e){if(!this.writable)return false;this._driver.parse(e);return!this._paused};n.prototype.end=function(e){if(!this.writable)return;if(e!==undefined)this.write(e);this.writable=false;var t=this._driver.messages;if(t.readable){t.readable=t.writable=false;t.emit("end")}};n.prototype.destroy=function(){this.end()};var o=function(e){this.readable=this.writable=true;this._paused=false;this._driver=e};s.inherits(o,i);o.prototype.pause=function(){this._driver.io._paused=true};o.prototype.resume=function(){this._driver.io._paused=false;this._driver.io.emit("drain")};o.prototype.write=function(e){if(!this.writable)return false;if(typeof e==="string")this._driver.text(e);else this._driver.binary(e);return!this._paused};o.prototype.end=function(e){if(e!==undefined)this.write(e)};o.prototype.destroy=function(){};t.IO=n;t.Messages=o},7751:e=>{"use strict";var t=/([!#\$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+)/,r=/([^!#\$%&'\*\+\-\.\^_`\|~0-9A-Za-z])/g,i=/"((?:\\[\x00-\x7f]|[^\x00-\x08\x0a-\x1f\x7f"\\])*)"/,s=new RegExp(t.source+"(?:=(?:"+t.source+"|"+i.source+"))?"),n=new RegExp(t.source+"(?: *; *"+s.source+")*","g"),o=new RegExp("^"+n.source+"(?: *, *"+n.source+")*$"),a=/^-?(0|[1-9][0-9]*)(\.[0-9]+)?$/;var h=Object.prototype.hasOwnProperty;var c={parseHeader:function(e){var t=new u;if(e===""||e===undefined)return t;if(!o.test(e))throw new SyntaxError("Invalid Sec-WebSocket-Extensions header: "+e);var r=e.match(n);r.forEach(function(e){var r=e.match(new RegExp(s.source,"g")),i=r.shift(),n={};r.forEach(function(e){var t=e.match(s),r=t[1],i;if(t[2]!==undefined){i=t[2]}else if(t[3]!==undefined){i=t[3].replace(/\\/g,"")}else{i=true}if(a.test(i))i=parseFloat(i);if(h.call(n,r)){n[r]=[].concat(n[r]);n[r].push(i)}else{n[r]=i}},this);t.push(i,n)},this);return t},serializeParams:function(e,t){var i=[];var s=function(e,t){if(t instanceof Array){t.forEach(function(t){s(e,t)})}else if(t===true){i.push(e)}else if(typeof t==="number"){i.push(e+"="+t)}else if(r.test(t)){i.push(e+'="'+t.replace(/"/g,'\\"')+'"')}else{i.push(e+"="+t)}};for(var n in t)s(n,t[n]);return[e].concat(i).join("; ")}};var u=function(){this._byName={};this._inOrder=[]};u.prototype.push=function(e,t){if(!h.call(this._byName,e))this._byName[e]=[];this._byName[e].push(t);this._inOrder.push({name:e,params:t})};u.prototype.eachOffer=function(e,t){var r=this._inOrder;for(var i=0,s=r.length;i<s;i++)e.call(t,r[i].name,r[i].params)};u.prototype.byName=function(e){return this._byName[e]||[]};u.prototype.toArray=function(){return this._inOrder.slice()};e.exports=c},1695:(e,t,r)=>{"use strict";var i=r(2261),s=r(5790);var n=function(e){this._ext=e[0];this._session=e[1];this._functors={incoming:new i(this._session,"processIncomingMessage"),outgoing:new i(this._session,"processOutgoingMessage")}};n.prototype.pending=function(e){var t=this._functors[e];if(!t._stopped)t.pending+=1};n.prototype.incoming=function(e,t,r,i){this._exec("incoming",e,t,r,i)};n.prototype.outgoing=function(e,t,r,i){this._exec("outgoing",e,t,r,i)};n.prototype.close=function(){this._closed=this._closed||new s;this._doClose();return this._closed};n.prototype._exec=function(e,t,r,i,s){this._functors[e].call(t,r,function(e,t){if(e)e.message=this._ext.name+": "+e.message;i.call(s,e,t);this._doClose()},this)};n.prototype._doClose=function(){var e=this._functors.incoming,t=this._functors.outgoing;if(!this._closed||e.pending+t.pending!==0)return;if(this._session)this._session.close();this._session=null;this._closed.done()};e.exports=n},2261:(e,t,r)=>{"use strict";var i=r(8639);var s=function(e,t){this._session=e;this._method=t;this._queue=new i(s.QUEUE_SIZE);this._stopped=false;this.pending=0};s.QUEUE_SIZE=8;s.prototype.call=function(e,t,r,i){if(this._stopped)return;var s={error:e,message:t,callback:r,context:i,done:false},n=false,o=this;this._queue.push(s);if(s.error){s.done=true;this._stop();return this._flushQueue()}var a=function(e,t){if(!(n^(n=true)))return;if(e){o._stop();s.error=e;s.message=null}else{s.message=t}s.done=true;o._flushQueue()};try{this._session[this._method](t,a)}catch(e){a(e)}};s.prototype._stop=function(){this.pending=this._queue.length;this._stopped=true};s.prototype._flushQueue=function(){var e=this._queue,t;while(e.length>0&&e.peek().done){t=e.shift();if(t.error){this.pending=0;e.clear()}else{this.pending-=1}t.callback.call(t.context,t.error,t.message)}};e.exports=s},3277:(e,t,r)=>{"use strict";var i=r(1695),s=r(5790);var n=function(e){this._cells=e.map(function(e){return new i(e)});this._stopped={incoming:false,outgoing:false}};n.prototype.processIncomingMessage=function(e,t,r){if(this._stopped.incoming)return;this._loop("incoming",this._cells.length-1,-1,-1,e,t,r)};n.prototype.processOutgoingMessage=function(e,t,r){if(this._stopped.outgoing)return;this._loop("outgoing",0,this._cells.length,1,e,t,r)};n.prototype.close=function(e,t){this._stopped={incoming:true,outgoing:true};var r=this._cells.map(function(e){return e.close()});if(e)s.all(r).then(function(){e.call(t)})};n.prototype._loop=function(e,t,r,i,s,n,o){var a=this._cells,h=a.length,c=this;while(h--)a[h].pending(e);var u=function(t,s,h){if(t===r)return n.call(o,s,h);a[t][e](s,h,function(r,s){if(r)c._stopped[e]=true;u(t+i,r,s)})};u(t,null,s)};e.exports=n},5790:(e,t,r)=>{"use strict";var i=r(8639);var s=function(){this._complete=false;this._callbacks=new i(s.QUEUE_SIZE)};s.QUEUE_SIZE=4;s.all=function(e){var t=new s,r=e.length,i=r;if(r===0)t.done();while(i--)e[i].then(function(){r-=1;if(r===0)t.done()});return t};s.prototype.then=function(e){if(this._complete)e();else this._callbacks.push(e)};s.prototype.done=function(){this._complete=true;var e=this._callbacks,t;while(t=e.shift())t()};e.exports=s},8639:e=>{"use strict";var t=function(e){this._bufferSize=e;this.clear()};t.prototype.clear=function(){this._buffer=new Array(this._bufferSize);this._ringOffset=0;this._ringSize=this._bufferSize;this._head=0;this._tail=0;this.length=0};t.prototype.push=function(e){var t=false,r=false;if(this._ringSize<this._bufferSize){t=this._tail===0}else if(this._ringOffset===this._ringSize){t=true;r=this._tail===0}if(t){this._tail=this._bufferSize;this._buffer=this._buffer.concat(new Array(this._bufferSize));this._bufferSize=this._buffer.length;if(r)this._ringSize=this._bufferSize}this._buffer[this._tail]=e;this.length+=1;if(this._tail<this._ringSize)this._ringOffset+=1;this._tail=(this._tail+1)%this._bufferSize};t.prototype.peek=function(){if(this.length===0)return void 0;return this._buffer[this._head]};t.prototype.shift=function(){if(this.length===0)return void 0;var e=this._buffer[this._head];this._buffer[this._head]=void 0;this.length-=1;this._ringOffset-=1;if(this._ringOffset===0&&this.length>0){this._head=this._ringSize;this._ringOffset=this.length;this._ringSize=this._bufferSize}else{this._head=(this._head+1)%this._ringSize}return e};e.exports=t},6901:(e,t,r)=>{"use strict";var i=r(7751),s=r(3277);var n=function(){this._rsv1=this._rsv2=this._rsv3=null;this._byName={};this._inOrder=[];this._sessions=[];this._index={}};n.MESSAGE_OPCODES=[1,2];var o={add:function(e){if(typeof e.name!=="string")throw new TypeError("extension.name must be a string");if(e.type!=="permessage")throw new TypeError('extension.type must be "permessage"');if(typeof e.rsv1!=="boolean")throw new TypeError("extension.rsv1 must be true or false");if(typeof e.rsv2!=="boolean")throw new TypeError("extension.rsv2 must be true or false");if(typeof e.rsv3!=="boolean")throw new TypeError("extension.rsv3 must be true or false");if(this._byName.hasOwnProperty(e.name))throw new TypeError('An extension with name "'+e.name+'" is already registered');this._byName[e.name]=e;this._inOrder.push(e)},generateOffer:function(){var e=[],t=[],r={};this._inOrder.forEach(function(s){var n=s.createClientSession();if(!n)return;var o=[s,n];e.push(o);r[s.name]=o;var a=n.generateOffer();a=a?[].concat(a):[];a.forEach(function(e){t.push(i.serializeParams(s.name,e))},this)},this);this._sessions=e;this._index=r;return t.length>0?t.join(", "):null},activate:function(e){var t=i.parseHeader(e),r=[];t.eachOffer(function(e,t){var s=this._index[e];if(!s)throw new Error('Server sent an extension response for unknown extension "'+e+'"');var n=s[0],o=s[1],a=this._reserved(n);if(a)throw new Error("Server sent two extension responses that use the RSV"+a[0]+' bit: "'+a[1]+'" and "'+n.name+'"');if(o.activate(t)!==true)throw new Error("Server sent unacceptable extension parameters: "+i.serializeParams(e,t));this._reserve(n);r.push(s)},this);this._sessions=r;this._pipeline=new s(r)},generateResponse:function(e){var t=[],r=[],n=i.parseHeader(e);this._inOrder.forEach(function(e){var s=n.byName(e.name);if(s.length===0||this._reserved(e))return;var o=e.createServerSession(s);if(!o)return;this._reserve(e);t.push([e,o]);r.push(i.serializeParams(e.name,o.generateResponse()))},this);this._sessions=t;this._pipeline=new s(t);return r.length>0?r.join(", "):null},validFrameRsv:function(e){var t={rsv1:false,rsv2:false,rsv3:false},r;if(n.MESSAGE_OPCODES.indexOf(e.opcode)>=0){for(var i=0,s=this._sessions.length;i<s;i++){r=this._sessions[i][0];t.rsv1=t.rsv1||r.rsv1;t.rsv2=t.rsv2||r.rsv2;t.rsv3=t.rsv3||r.rsv3}}return(t.rsv1||!e.rsv1)&&(t.rsv2||!e.rsv2)&&(t.rsv3||!e.rsv3)},processIncomingMessage:function(e,t,r){this._pipeline.processIncomingMessage(e,t,r)},processOutgoingMessage:function(e,t,r){this._pipeline.processOutgoingMessage(e,t,r)},close:function(e,t){if(!this._pipeline)return e.call(t);this._pipeline.close(e,t)},_reserve:function(e){this._rsv1=this._rsv1||e.rsv1&&e.name;this._rsv2=this._rsv2||e.rsv2&&e.name;this._rsv3=this._rsv3||e.rsv3&&e.name},_reserved:function(e){if(this._rsv1&&e.rsv1)return[1,this._rsv1];if(this._rsv2&&e.rsv2)return[2,this._rsv2];if(this._rsv3&&e.rsv3)return[3,this._rsv3];return false}};for(var a in o)n.prototype[a]=o[a];e.exports=n},2357:e=>{"use strict";e.exports=require("assert")},4293:e=>{"use strict";e.exports=require("buffer")},6417:e=>{"use strict";e.exports=require("crypto")},8614:e=>{"use strict";e.exports=require("events")},5747:e=>{"use strict";e.exports=require("fs")},8605:e=>{"use strict";e.exports=require("http")},1631:e=>{"use strict";e.exports=require("net")},1191:e=>{"use strict";e.exports=require("querystring")},2413:e=>{"use strict";e.exports=require("stream")},4016:e=>{"use strict";e.exports=require("tls")},8835:e=>{"use strict";e.exports=require("url")},1669:e=>{"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(r){if(t[r]){return t[r].exports}var i=t[r]={exports:{}};var s=true;try{e[r].call(i.exports,i,i.exports,__nccwpck_require__);s=false}finally{if(s)delete t[r]}return i.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(640)})();