webxoss-client/socket.io.min.js

3 lines
71 KiB
JavaScript
Raw Normal View History

2016-10-23 07:28:51 +02:00
(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.io=e()}})(function(){var e,t,r;return function n(e,t,r){function i(s,a){if(!t[s]){if(!e[s]){var c=typeof require=="function"&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var u=t[s]={exports:{}};e[s][0].call(u.exports,function(t){var r=e[s][1][t];return i(r?r:t)},u,u.exports,n,e,t,r)}return t[s].exports}var o=typeof require=="function"&&require;for(var s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,r){t.exports=e("./lib/")},{"./lib/":2}],2:[function(e,t,r){t.exports=e("./socket");t.exports.parser=e("engine.io-parser")},{"./socket":3,"engine.io-parser":19}],3:[function(e,t,r){(function(r){var n=e("./transports");var i=e("component-emitter");var o=e("debug")("engine.io-client:socket");var s=e("indexof");var a=e("engine.io-parser");var c=e("parseuri");var f=e("parsejson");var u=e("parseqs");t.exports=l;function p(){}function l(e,t){if(!(this instanceof l))return new l(e,t);t=t||{};if(e&&"object"==typeof e){t=e;e=null}if(e){e=c(e);t.hostname=e.host;t.secure=e.protocol=="https"||e.protocol=="wss";t.port=e.port;if(e.query)t.query=e.query}else if(t.host){t.hostname=c(t.host).host}this.secure=null!=t.secure?t.secure:r.location&&"https:"==location.protocol;if(t.hostname&&!t.port){t.port=this.secure?"443":"80"}this.agent=t.agent||false;this.hostname=t.hostname||(r.location?location.hostname:"localhost");this.port=t.port||(r.location&&location.port?location.port:this.secure?443:80);this.query=t.query||{};if("string"==typeof this.query)this.query=u.decode(this.query);this.upgrade=false!==t.upgrade;this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/";this.forceJSONP=!!t.forceJSONP;this.jsonp=false!==t.jsonp;this.forceBase64=!!t.forceBase64;this.enablesXDR=!!t.enablesXDR;this.timestampParam=t.timestampParam||"t";this.timestampRequests=t.timestampRequests;this.transports=t.transports||["polling","websocket"];this.readyState="";this.writeBuffer=[];this.policyPort=t.policyPort||843;this.rememberUpgrade=t.rememberUpgrade||false;this.binaryType=null;this.onlyBinaryUpgrades=t.onlyBinaryUpgrades;this.perMessageDeflate=false!==t.perMessageDeflate?t.perMessageDeflate||{}:false;if(true===this.perMessageDeflate)this.perMessageDeflate={};if(this.perMessageDeflate&&null==this.perMessageDeflate.threshold){this.perMessageDeflate.threshold=1024}this.pfx=t.pfx||null;this.key=t.key||null;this.passphrase=t.passphrase||null;this.cert=t.cert||null;this.ca=t.ca||null;this.ciphers=t.ciphers||null;this.rejectUnauthorized=t.rejectUnauthorized===undefined?null:t.rejectUnauthorized;var n=typeof r=="object"&&r;if(n.global===n){if(t.extraHeaders&&Object.keys(t.extraHeaders).length>0){this.extraHeaders=t.extraHeaders}}this.open()}l.priorWebsocketSuccess=false;i(l.prototype);l.protocol=a.protocol;l.Socket=l;l.Transport=e("./transport");l.transports=e("./transports");l.parser=e("engine.io-parser");l.prototype.createTransport=function(e){o('creating transport "%s"',e);var t=h(this.query);t.EIO=a.protocol;t.transport=e;if(this.id)t.sid=this.id;var r=new n[e]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:t,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized,perMessageDeflate:this.perMessageDeflate,extraHeaders:this.extraHeaders});return r};function h(e){var t={};for(var r in e){if(e.hasOwnProperty(r)){t[r]=e[r]}}return t}l.prototype.open=function(){var e;if(this.rememberUpgrade&&l.priorWebsocketSuccess&&this.transports.index
return e}},{ms:25}],19:[function(e,t,r){(function(t){var n=e("./keys");var i=e("has-binary");var o=e("arraybuffer.slice");var s=e("base64-arraybuffer");var a=e("after");var c=e("utf8");var f=navigator.userAgent.match(/Android/i);var u=/PhantomJS/i.test(navigator.userAgent);var p=f||u;r.protocol=3;var l=r.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var h=n(l);var d={type:"error",data:"parser error"};var y=e("blob");r.encodePacket=function(e,r,n,i){if("function"==typeof r){i=r;r=false}if("function"==typeof n){i=n;n=null}var o=e.data===undefined?undefined:e.data.buffer||e.data;if(t.ArrayBuffer&&o instanceof ArrayBuffer){return v(e,r,i)}else if(y&&o instanceof t.Blob){return b(e,r,i)}if(o&&o.base64){return g(e,i)}var s=l[e.type];if(undefined!==e.data){s+=n?c.encode(String(e.data)):String(e.data)}return i(""+s)};function g(e,t){var n="b"+r.packets[e.type]+e.data.data;return t(n)}function v(e,t,n){if(!t){return r.encodeBase64Packet(e,n)}var i=e.data;var o=new Uint8Array(i);var s=new Uint8Array(1+i.byteLength);s[0]=l[e.type];for(var a=0;a<o.length;a++){s[a+1]=o[a]}return n(s.buffer)}function m(e,t,n){if(!t){return r.encodeBase64Packet(e,n)}var i=new FileReader;i.onload=function(){e.data=i.result;r.encodePacket(e,t,true,n)};return i.readAsArrayBuffer(e.data)}function b(e,t,n){if(!t){return r.encodeBase64Packet(e,n)}if(p){return m(e,t,n)}var i=new Uint8Array(1);i[0]=l[e.type];var o=new y([i.buffer,e.data]);return n(o)}r.encodeBase64Packet=function(e,n){var i="b"+r.packets[e.type];if(y&&e.data instanceof t.Blob){var o=new FileReader;o.onload=function(){var e=o.result.split(",")[1];n(i+e)};return o.readAsDataURL(e.data)}var s;try{s=String.fromCharCode.apply(null,new Uint8Array(e.data))}catch(a){var c=new Uint8Array(e.data);var f=new Array(c.length);for(var u=0;u<c.length;u++){f[u]=c[u]}s=String.fromCharCode.apply(null,f)}i+=t.btoa(s);return n(i)};r.decodePacket=function(e,t,n){if(typeof e=="string"||e===undefined){if(e.charAt(0)=="b"){return r.decodeBase64Packet(e.substr(1),t)}if(n){try{e=c.decode(e)}catch(i){return d}}var s=e.charAt(0);if(Number(s)!=s||!h[s]){return d}if(e.length>1){return{type:h[s],data:e.substring(1)}}else{return{type:h[s]}}}var a=new Uint8Array(e);var s=a[0];var f=o(e,1);if(y&&t==="blob"){f=new y([f])}return{type:h[s],data:f}};r.decodeBase64Packet=function(e,r){var n=h[e.charAt(0)];if(!t.ArrayBuffer){return{type:n,data:{base64:true,data:e.substr(1)}}}var i=s.decode(e.substr(1));if(r==="blob"&&y){i=new y([i])}return{type:n,data:i}};r.encodePayload=function(e,t,n){if(typeof t=="function"){n=t;t=null}var o=i(e);if(t&&o){if(y&&!p){return r.encodePayloadAsBlob(e,n)}return r.encodePayloadAsArrayBuffer(e,n)}if(!e.length){return n("0:")}function s(e){return e.length+":"+e}function a(e,n){r.encodePacket(e,!o?false:t,true,function(e){n(null,s(e))})}w(e,a,function(e,t){return n(t.join(""))})};function w(e,t,r){var n=new Array(e.length);var i=a(e.length,r);var o=function(e,r,i){t(r,function(t,r){n[e]=r;i(t,n)})};for(var s=0;s<e.length;s++){o(s,e[s],i)}}r.decodePayload=function(e,t,n){if(typeof e!="string"){return r.decodePayloadAsBinary(e,t,n)}if(typeof t==="function"){n=t;t=null}var i;if(e==""){return n(d,0,1)}var o="",s,a;for(var c=0,f=e.length;c<f;c++){var u=e.charAt(c);if(":"!=u){o+=u}else{if(""==o||o!=(s=Number(o))){return n(d,0,1)}a=e.substr(c+1,s);if(o!=a.length){return n(d,0,1)}if(a.length){i=r.decodePacket(a,t,true);if(d.type==i.type&&d.data==i.data){return n(d,0,1)}var p=n(i,c+s,f);if(false===p)return}c+=s;o=""}}if(o!=""){return n(d,0,1)}};r.encodePayloadAsArrayBuffer=function(e,t){if(!e.length){return t(new ArrayBuffer(0))}function n(e,t){r.encodePacket(e,true,true,function(e){return t(null,e)})}w(e,n,function(e,r){var n=r.reduce(function(e,t){var r;if(typeof t==="string"){r=t.length}else{r=t.byteLength}return e+r.toString().length+r+2},0);var i=new Uint8Array(n);var o=0;r.forEach(function(e){var t=typeof e==="string";var r=e;if(t){var n=new Uint8Array(e.length);for(var s=0;s<e.length;s++){n[s]=e.charCodeAt(s)}r=n.buffer}if(t){i[o++]=0}else{i[o++]=1}var a=r.byteLength.toString();for(var s=
},{dup:15}],50:[function(t,r,n){(function(t){(function(){var i=typeof e==="function"&&e.amd;var o={"function":true,object:true};var s=o[typeof n]&&n&&!n.nodeType&&n;var a=o[typeof window]&&window||this,c=s&&o[typeof r]&&r&&!r.nodeType&&typeof t=="object"&&t;if(c&&(c["global"]===c||c["window"]===c||c["self"]===c)){a=c}function f(e,t){e||(e=a["Object"]());t||(t=a["Object"]());var r=e["Number"]||a["Number"],n=e["String"]||a["String"],i=e["Object"]||a["Object"],s=e["Date"]||a["Date"],c=e["SyntaxError"]||a["SyntaxError"],u=e["TypeError"]||a["TypeError"],p=e["Math"]||a["Math"],l=e["JSON"]||a["JSON"];if(typeof l=="object"&&l){t.stringify=l.stringify;t.parse=l.parse}var h=i.prototype,d=h.toString,y,g,v;var m=new s(-0xc782b5b800cec);try{m=m.getUTCFullYear()==-109252&&m.getUTCMonth()===0&&m.getUTCDate()===1&&m.getUTCHours()==10&&m.getUTCMinutes()==37&&m.getUTCSeconds()==6&&m.getUTCMilliseconds()==708}catch(b){}function w(e){if(w[e]!==v){return w[e]}var i;if(e=="bug-string-char-index"){i="a"[0]!="a"}else if(e=="json"){i=w("json-stringify")&&w("json-parse")}else{var o,a='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if(e=="json-stringify"){var c=t.stringify,f=typeof c=="function"&&m;if(f){(o=function(){return 1}).toJSON=o;try{f=c(0)==="0"&&c(new r)==="0"&&c(new n)=='""'&&c(d)===v&&c(v)===v&&c()===v&&c(o)==="1"&&c([o])=="[1]"&&c([v])=="[null]"&&c(null)=="null"&&c([v,d,null])=="[null,null,null]"&&c({a:[o,true,false,null,"\x00\b\n\f\r "]})==a&&c(null,o)==="1"&&c([1,2],null,1)=="[\n 1,\n 2\n]"&&c(new s(-864e13))=='"-271821-04-20T00:00:00.000Z"'&&c(new s(864e13))=='"+275760-09-13T00:00:00.000Z"'&&c(new s(-621987552e5))=='"-000001-01-01T00:00:00.000Z"'&&c(new s(-1))=='"1969-12-31T23:59:59.999Z"'}catch(u){f=false}}i=f}if(e=="json-parse"){var p=t.parse;if(typeof p=="function"){try{if(p("0")===0&&!p(false)){o=p(a);var l=o["a"].length==5&&o["a"][0]===1;if(l){try{l=!p('" "')}catch(u){}if(l){try{l=p("01")!==1}catch(u){}}if(l){try{l=p("1.")!==1}catch(u){}}}}}catch(u){l=false}}i=l}}return w[e]=!!i}if(!w("json")){var k="[object Function]",x="[object Date]",A="[object Number]",B="[object String]",C="[object Array]",S="[object Boolean]";var E=w("bug-string-char-index");if(!m){var _=p.floor;var T=[0,31,59,90,120,151,181,212,243,273,304,334];var O=function(e,t){return T[t]+365*(e-1970)+_((e-1969+(t=+(t>1)))/4)-_((e-1901+t)/100)+_((e-1601+t)/400)}}if(!(y=h.hasOwnProperty)){y=function(e){var t={},r;if((t.__proto__=null,t.__proto__={toString:1},t).toString!=d){y=function(e){var t=this.__proto__,r=e in(this.__proto__=null,this);this.__proto__=t;return r}}else{r=t.constructor;y=function(e){var t=(this.constructor||r).prototype;return e in this&&!(e in t&&this[e]===t[e])}}t=null;return y.call(this,e)}}g=function(e,t){var r=0,n,i,s;(n=function(){this.valueOf=0}).prototype.valueOf=0;i=new n;for(s in i){if(y.call(i,s)){r++}}n=i=null;if(!r){i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"];g=function(e,t){var r=d.call(e)==k,n,s;var a=!r&&typeof e.constructor!="function"&&o[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e){if(!(r&&n=="prototype")&&a.call(e,n)){t(n)}}for(s=i.length;n=i[--s];a.call(e,n)&&t(n));}}else if(r==2){g=function(e,t){var r={},n=d.call(e)==k,i;for(i in e){if(!(n&&i=="prototype")&&!y.call(r,i)&&(r[i]=1)&&y.call(e,i)){t(i)}}}}else{g=function(e,t){var r=d.call(e)==k,n,i;for(n in e){if(!(r&&n=="prototype")&&y.call(e,n)&&!(i=n==="constructor")){t(n)}}if(i||y.call(e,n="constructor")){t(n)}}}return g(e,t)};if(!w("json-stringify")){var j={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"};var P="000000";var N=function(e,t){return(P+(t||0)).slice(-e)};var R="\\u00";var D=function(e){var t='"',r=0,n=e.length,i=!E||n>10;var o=i&&(E?e.split(""):e);for(;r<n;r++){var s=e.charCodeAt(r);switch(s){case 8:case 9:case 10:case 12:case 13:case 34:case 92:t+=j[s];break;default:if(s<32){t+=R+N(2,s.toString(16));break}t+=i?o[r]:e.charAt(r)}}return t+'"'};var U=function(e,t,r,n,i,o,s){var a,c,f,p,l,h,m,b,w,k,E,T,j,P,R,q;try{a=t[e]}catch(L){}if(typeof a=="object"&&a){c=d.call(a)