if(typeof(jqac) === 'undefined') { jqac = jQuery; } /*! Ion.Sound version 3.0.7 https://github.com/IonDen/ion.sound */ (function(l,e,n,r){l.ion=l.ion||{};if(!ion.sound){var m=function(a){a||(a="undefined");if(l.console){console.warn&&"function"===typeof console.warn?console.warn(a):console.log&&"function"===typeof console.log&&console.log(a);var g=n&&n("#debug");if(g&&g.length){var b=g.html();g.html(b+a+"
")}}},f=function(a,b){var c;b=b||{};for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b};if("function"!==typeof Audio&&"object"!==typeof Audio)e=function(){m("HTML5 Audio is not supported in this browser")}, ion.sound=e,ion.sound.play=e,ion.sound.stop=e,ion.sound.pause=e,ion.sound.preload=e,ion.sound.destroy=e,e();else{e=/iPad|iPhone|iPod/.test(e.appVersion);var q=0,c={},d={},b;!c.supported&&e?c.supported=["mp3","mp4","aac"]:c.supported||(c.supported=["mp3","ogg","mp4","aac","wav"]);ion.sound=function(a){f(a,c);c.path=c.path||"";c.volume=c.volume||1;c.preload=c.preload||!1;c.multiplay=c.multiplay||!1;c.loop=c.loop||!1;c.sprite=c.sprite||null;c.scope=c.scope||null;c.ready_callback=c.ready_callback||null; c.ended_callback=c.ended_callback||null;if(q=c.sounds.length)for(b=0;b=b?this.clear():("function"===typeof this.source.start?this.source.start(0,a,b):this.source.noteOn(0,a,b),this.playing=!0,this.paused=!1,this.time_started=(new Date).valueOf())},stop:function(){this.playing&&this.source&& ("function"===typeof this.source.stop?this.source.stop(0):this.source.noteOff(0));this.clear()},pause:function(){this.paused?this.play():this.playing&&(this.source&&this.source.stop(0),this.paused=!0)},ended:function(){this.playing=!1;this.time_ended=(new Date).valueOf();this.time_played=(this.time_ended-this.time_started)/1E3;this.time_offset+=this.time_played;if(this.time_offset>=this.end||.015>this.end-this.time_offset)this._ended(),this.clear(),this.loop&&(this.loop--,this.play())},_ended:function(){var a= {name:this.name,alias:this.alias,part:this.sprite_part,start:this.start,duration:this.end};this.ended_callback&&"function"===typeof this.ended_callback&&this.ended_callback.call(this.scope,a)},clear:function(){this.time_offset=this.time_played=0;this.playing=this.paused=!1},setVolume:function(a){this.volume=a.volume;this.gain&&(this.gain.gain.value=this.volume)}};h||(function(){var a=new Audio,b=a.canPlayType("audio/mpeg"),e=a.canPlayType("audio/ogg"),a=a.canPlayType('audio/mp4; codecs="mp4a.40.2"'), d,f;for(f=0;f=this.end&&this.playing&&(this.stop(),this._ended())},ended:function(){this.playing&&(this.stop(),this._ended())},_ended:function(){this.playing= !1;var a={name:this.name,alias:this.alias,part:this.sprite_part,start:this.start,duration:this.end};this.ended_callback&&"function"===typeof this.ended_callback&&this.ended_callback.call(this.scope,a);this.loop&&setTimeout(this.looper.bind(this),15)},looper:function(){this.loop--;this.play()},clear:function(){this.paused_time=this.played_time=this.start_time=0},setVolume:function(a){this.volume=a.volume;this.sound&&(this.sound.volume=this.volume)}})}}})(window,navigator,window.jqac||window.$); /*! jQuery Cookie Plugin v1.4.0 https://github.com/carhartl/jquery-cookie */ (function(factory){if(typeof define==='function'&&define.amd){define(['jqac'],factory);}else{factory(jqac);}}(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s);} function decode(s){return config.raw?s:decodeURIComponent(s);} function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value));} function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\');} try{s=decodeURIComponent(s.replace(pluses,' '));return config.json?JSON.parse(s):s;}catch(e){}} function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value;} var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days);} return(document.cookie=[encode(key),'=',stringifyCookieValue(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));} var result=key?undefined:{};var cookies=document.cookie?document.cookie.split('; '):[];for(var i=0,l=cookies.length;i=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(e){var o=this.useColors;if(e[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+e[0]+(o?"%c ":" ")+"+"+exports.humanize(this.diff),o){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var t=0,n=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&"%c"===e&&(n=++t)}),e.splice(n,0,r)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(e){try{null==e?exports.storage.removeItem("debug"):exports.storage.debug=e}catch(e){}}function load(){var e;try{e=exports.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}function localstorage(){try{return window.localStorage}catch(e){}}exports=module.exports=require("./debug"),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:localstorage(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},exports.enable(load()); }).call(this,require('_process')) },{"./debug":4,"_process":13}],4:[function(require,module,exports){ var prevTime;function selectColor(e){var r,t=0;for(r in e)t=(t<<5)-t+e.charCodeAt(r),t|=0;return exports.colors[Math.abs(t)%exports.colors.length]}function createDebug(e){function r(){if(r.enabled){var e=r,t=+new Date,o=t-(prevTime||t);e.diff=o,e.prev=prevTime,e.curr=t,prevTime=t;for(var s=new Array(arguments.length),n=0;n1)))/4)-S((t-1901+e)/100)+S((t-1601+e)/400)};if((p=b.hasOwnProperty)||(p=function(t){var e,r={};return(r.__proto__=null,r.__proto__={toString:1},r).toString!=j?p=function(t){var e=this.__proto__,r=t in(this.__proto__=null,this);return this.__proto__=e,r}:(e=r.constructor,p=function(t){var r=(this.constructor||e).prototype;return t in this&&!(t in r&&this[t]===r[t])}),r=null,p.call(this,t)}),g=function(t,r){var n,o,c,i=0;for(c in(n=function(){this.valueOf=0}).prototype.valueOf=0,o=new n)p.call(o,c)&&i++;return n=o=null,i?g=2==i?function(t,e){var r,n={},o="[object Function]"==j.call(t);for(r in t)o&&"prototype"==r||p.call(n,r)||!(n[r]=1)||!p.call(t,r)||e(r)}:function(t,e){var r,n,o="[object Function]"==j.call(t);for(r in t)o&&"prototype"==r||!p.call(t,r)||(n="constructor"===r)||e(r);(n||p.call(t,r="constructor"))&&e(r)}:(o=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],g=function(t,r){var n,c,i="[object Function]"==j.call(t),a=!i&&"function"!=typeof t.constructor&&e[typeof t.hasOwnProperty]&&t.hasOwnProperty||p;for(n in t)i&&"prototype"==n||!a.call(t,n)||r(n);for(c=o.length;n=o[--c];a.call(t,n)&&r(n));}),g(t,r)},!v("json-stringify")){var w={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},T=function(t,e){return("000000"+(e||0)).slice(-t)},_=function(t){for(var e='"',r=0,n=t.length,o=!C||n>10,c=o&&(C?t.split(""):t);r-1/0&&a<1/0){if(A){for(h=S(a/864e5),f=S(h/365.2425)+1970-1;A(f+1,0)<=h;f++);for(s=S((h-A(f,0))/30.42);A(f,s+1)<=h;s++);h=1+h-A(f,s),d=S((b=(a%864e5+864e5)%864e5)/36e5)%24,v=S(b/6e4)%60,C=S(b/1e3)%60,O=b%1e3}else f=a.getUTCFullYear(),s=a.getUTCMonth(),h=a.getUTCDate(),d=a.getUTCHours(),v=a.getUTCMinutes(),C=a.getUTCSeconds(),O=a.getUTCMilliseconds();a=(f<=0||f>=1e4?(f<0?"-":"+")+T(6,f<0?-f:f):T(4,f))+"-"+T(2,s+1)+"-"+T(2,h)+"T"+T(2,d)+":"+T(2,v)+":"+T(2,C)+"."+T(3,O)+"Z"}else a=null;if(r&&(a=r.call(e,t,a)),null===a)return"null";if("[object Boolean]"==(l=j.call(a)))return""+a;if("[object Number]"==l)return a>-1/0&&a<1/0?""+a:"null";if("[object String]"==l)return _(""+a);if("object"==typeof a){for(m=i.length;m--;)if(i[m]===a)throw u();if(i.push(a),w=[],x=c,c+=o,"[object Array]"==l){for(J=0,m=a.length;J0)for(o="",n>10&&(n=10);o.length=48&&o<=57||o>=97&&o<=102||o>=65&&o<=70||M();t+=m("0x"+c.slice(e,U));break;default:M()}else{if(34==o)break;for(o=c.charCodeAt(U),e=U;o>=32&&92!=o&&34!=o;)o=c.charCodeAt(++U);t+=c.slice(e,U)}if(34==c.charCodeAt(U))return U++,t;M();default:if(e=U,45==o&&(n=!0,o=c.charCodeAt(++U)),o>=48&&o<=57){for(48==o&&((o=c.charCodeAt(U+1))>=48&&o<=57)&&M(),n=!1;U=48&&o<=57);U++);if(46==c.charCodeAt(U)){for(r=++U;r=48&&o<=57);r++);r==U&&M(),U=r}if(101==(o=c.charCodeAt(U))||69==o){for(43!=(o=c.charCodeAt(++U))&&45!=o||U++,r=U;r=48&&o<=57);r++);r==U&&M(),U=r}return+c.slice(e,U)}if(n&&M(),"true"==c.slice(U,U+4))return U+=4,!0;if("false"==c.slice(U,U+5))return U+=5,!1;if("null"==c.slice(U,U+4))return U+=4,null;M()}return"$"},k=function(t){var e,r;if("$"==t&&M(),"string"==typeof t){if("@"==(C?t.charAt(0):t[0]))return t.slice(1);if("["==t){for(e=[];"]"!=(t=F());r||(r=!0))r&&(","==t?"]"==(t=F())&&M():M()),","==t&&M(),e.push(k(t));return e}if("{"==t){for(e={};"}"!=(t=F());r||(r=!0))r&&(","==t?"}"==(t=F())&&M():M()),","!=t&&"string"==typeof t&&"@"==(C?t.charAt(0):t[0])&&":"==F()||M(),e[t.slice(1)]=k(F());return e}M()}return t},D=function(t,e,r){var n=E(t,e,r);n===y?delete t[e]:t[e]=n},E=function(t,e,r){var n,o=t[e];if("object"==typeof o&&o)if("[object Array]"==j.call(o))for(n=o.length;n--;)D(o,n,r);else g(o,function(t){D(o,t,r)});return r.call(t,e,o)};r.parse=function(t,e){var r,n;return U=0,J=""+t,r=k(F()),"$"!=F()&&M(),U=J=null,e&&"[object Function]"==j.call(e)?E(((n={})[""]=r,n),"",e):r}}}return r.runInContext=c,r}if(!o||o.global!==o&&o.window!==o&&o.self!==o||(n=o),r&&!t)c(n,r);else{var i=n.JSON,a=n.JSON3,l=!1,f=c(n,n.JSON3={noConflict:function(){return l||(l=!0,n.JSON=i,n.JSON3=a,i=a=null),f}});n.JSON={parse:f.parse,stringify:f.stringify}}t&&define(function(){return f})}).call(this); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],8:[function(require,module,exports){ "use strict";var immediate=require("immediate");function INTERNAL(){}var handlers={},REJECTED=["REJECTED"],FULFILLED=["FULFILLED"],PENDING=["PENDING"];function Promise(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=PENDING,this.queue=[],this.outcome=void 0,e!==INTERNAL&&safelyResolveThenable(this,e)}function QueueItem(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function unwrap(e,t,r){immediate(function(){var n;try{n=t(r)}catch(t){return handlers.reject(e,t)}n===e?handlers.reject(e,new TypeError("Cannot resolve promise with itself")):handlers.resolve(e,n)})}function getThen(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function safelyResolveThenable(e,t){var r=!1;function n(t){r||(r=!0,handlers.reject(e,t))}function o(t){r||(r=!0,handlers.resolve(e,t))}var i=tryCatch(function(){t(o,n)});"error"===i.status&&n(i.value)}function tryCatch(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}function resolve(e){return e instanceof this?e:handlers.resolve(new this(INTERNAL),e)}function reject(e){var t=new this(INTERNAL);return handlers.reject(t,e)}function all(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var o=new Array(r),i=0,s=-1,u=new this(INTERNAL);++s1?t[o-1]:void 0,i=o>2?t[2]:void 0;for(a=r.length>3&&"function"==typeof a?(o--,a):void 0,i&&isIterateeCall(t[0],t[1],i)&&(a=o<3?void 0:a,o=1),e=Object(e);++n-1&&r%1==0&&r-1&&r%1==0&&r<=MAX_SAFE_INTEGER}function isObject(r){var e=typeof r;return!!r&&("object"==e||"function"==e)}function isObjectLike(r){return!!r&&"object"==typeof r}var assign=createAssigner(function(r,e){if(nonEnumShadows||isPrototype(e)||isArrayLike(e))copyObject(e,keys(e),r);else for(var t in e)hasOwnProperty.call(e,t)&&assignValue(r,t,e[t])});function keys(r){return isArrayLike(r)?arrayLikeKeys(r):baseKeys(r)}module.exports=assign; },{}],10:[function(require,module,exports){ (function (global){ var FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",INFINITY=1/0,funcTag="[object Function]",genTag="[object GeneratorFunction]",symbolTag="[object Symbol]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reEscapeChar=/\\(\\)?/g,reIsHostCtor=/^\[object .+?Constructor\]$/,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();function getValue(t,e){return null==t?void 0:t[e]}function isHostObject(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}var arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var t=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,splice=arrayProto.splice,Map=getNative(root,"Map"),nativeCreate=getNative(Object,"create"),symbolProto=Symbol?Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function Hash(t){var e=-1,r=t?t.length:0;for(this.clear();++e-1}function listCacheSet(t,e){var r=this.__data__,a=assocIndexOf(r,t);return a<0?r.push([t,e]):r[a][1]=e,this}function MapCache(t){var e=-1,r=t?t.length:0;for(this.clear();++e-1}function arrayIncludesWith(e,t,r){for(var a=-1,n=e?e.length:0;++a-1}function listCacheSet(e,t){var r=this.__data__,a=assocIndexOf(r,e);return a<0?r.push([e,t]):r[a][1]=t,this}function MapCache(e){var t=-1,r=e?e.length:0;for(this.clear();++t=LARGE_ARRAY_SIZE&&(o=cacheHas,s=!1,t=new SetCache(t));e:for(;++n0&&r(i)?t>1?baseFlatten(i,t-1,r,a,n):arrayPush(n,i):a||(n[n.length]=i)}return n}function baseGetAllKeys(e,t,r){var a=t(e);return isArray(e)?a:arrayPush(a,r(e))}function baseIsNative(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)||isHostObject(e)?reIsNative:reIsHostCtor).test(toSource(e))}function baseKeysIn(e){if(!isObject(e))return nativeKeysIn(e);var t=isPrototype(e),r=[];for(var a in e)("constructor"!=a||!t&&hasOwnProperty.call(e,a))&&r.push(a);return r}function basePick(e,t){return basePickBy(e=Object(e),t,function(t,r){return r in e})}function basePickBy(e,t,r){for(var a=-1,n=t.length,o={};++a-1&&e%1==0&&e-1&&e%1==0&&e<=MAX_SAFE_INTEGER}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isObjectLike(e){return!!e&&"object"==typeof e}function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&objectToString.call(e)==symbolTag}function keysIn(e){return isArrayLike(e)?arrayLikeKeys(e,!0):baseKeysIn(e)}var omit=baseRest(function(e,t){return null==e?{}:(t=arrayMap(baseFlatten(t,1),toKey),basePick(e,baseDifference(getAllKeysIn(e),t)))});function stubArray(){return[]}module.exports=omit; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],12:[function(require,module,exports){ var s=1e3,m=60*s,h=60*m,d=24*h,y=365.25*d;function parse(e){if(!((e=String(e)).length>100)){var r=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(r){var a=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*y;case"days":case"day":case"d":return a*d;case"hours":case"hour":case"hrs":case"hr":case"h":return a*h;case"minutes":case"minute":case"mins":case"min":case"m":return a*m;case"seconds":case"second":case"secs":case"sec":case"s":return a*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}function fmtShort(e){return e>=d?Math.round(e/d)+"d":e>=h?Math.round(e/h)+"h":e>=m?Math.round(e/m)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function fmtLong(e){return plural(e,d,"day")||plural(e,h,"hour")||plural(e,m,"minute")||plural(e,s,"second")||e+" ms"}function plural(s,e,r){if(!(s0)return parse(s);if("number"===r&&!1===isNaN(s))return e.long?fmtLong(s):fmtShort(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}; },{}],13:[function(require,module,exports){ var cachedSetTimeout,cachedClearTimeout,process=module.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex1)for(var r=1;r1?this._listeners[t]=s.slice(0,i).concat(s.slice(i+1)):delete this._listeners[t])}},EventTarget.prototype.dispatchEvent=function(){var t=arguments[0],e=t.type,s=1===arguments.length?[t]:Array.apply(null,arguments);if(this["on"+e]&&this["on"+e].apply(this,s),e in this._listeners)for(var i=this._listeners[e],n=0;n=3e3&&t<=4999}"production"!==process.env.NODE_ENV&&(debug=require("debug")("sockjs-client:main")),inherits(SockJS,EventTarget),SockJS.prototype.close=function(t,e){if(t&&!userSetCode(t))throw new Error("InvalidAccessError: Invalid code");if(e&&e.length>123)throw new SyntaxError("reason argument has an invalid length");if(this.readyState!==SockJS.CLOSING&&this.readyState!==SockJS.CLOSED){this._close(t||1e3,e||"Normal closure",!0)}},SockJS.prototype.send=function(t){if("string"!=typeof t&&(t=""+t),this.readyState===SockJS.CONNECTING)throw new Error("InvalidStateError: The connection has not been established yet");this.readyState===SockJS.OPEN&&this._transport.send(escape.quote(t))},SockJS.version=require("./version"),SockJS.CONNECTING=0,SockJS.OPEN=1,SockJS.CLOSING=2,SockJS.CLOSED=3,SockJS.prototype._receiveInfo=function(t,e){if(debug("_receiveInfo",e),this._ir=null,t){this._rto=this.countRTO(e),this._transUrl=t.base_url?t.base_url:this.url,t=objectUtils.extend(t,this._urlInfo),debug("info",t);var r=transports.filterToEnabled(this._transportsWhitelist,t);this._transports=r.main,debug(this._transports.length+" enabled transports"),this._connect()}else this._close(1002,"Cannot connect to server")},SockJS.prototype._connect=function(){for(var t=this._transports.shift();t;t=this._transports.shift()){if(debug("attempt",t.transportName),t.needBody&&(!global.document.body||void 0!==global.document.readyState&&"complete"!==global.document.readyState&&"interactive"!==global.document.readyState))return debug("waiting for body"),this._transports.unshift(t),void eventUtils.attachEvent("load",this._connect.bind(this));var e=this._rto*t.roundTrips||5e3;this._transportTimeoutId=setTimeout(this._transportTimeout.bind(this),e),debug("using timeout",e);var r=urlUtils.addPath(this._transUrl,"/"+this._server+"/"+this._generateSessionId()),s=this._transportOptions[t.transportName];debug("transport url",r);var o=new t(r,this._transUrl,s);return o.on("message",this._transportMessage.bind(this)),o.once("close",this._transportClose.bind(this)),o.transportName=t.transportName,void(this._transport=o)}this._close(2e3,"All transports failed",!1)},SockJS.prototype._transportTimeout=function(){debug("_transportTimeout"),this.readyState===SockJS.CONNECTING&&this._transportClose(2007,"Transport timed out")},SockJS.prototype._transportMessage=function(t){debug("_transportMessage",t);var e,r=this,s=t.slice(0,1),o=t.slice(1);switch(s){case"o":return void this._open();case"h":return this.dispatchEvent(new Event("heartbeat")),void debug("heartbeat",this.transport)}if(o)try{e=JSON3.parse(o)}catch(t){debug("bad json",o)}if(void 0!==e)switch(s){case"a":Array.isArray(e)&&e.forEach(function(t){debug("message",r.transport,t),r.dispatchEvent(new TransportMessageEvent(t))});break;case"m":debug("message",this.transport,e),this.dispatchEvent(new TransportMessageEvent(e));break;case"c":Array.isArray(e)&&2===e.length&&this._close(e[0],e[1],!0)}else debug("empty payload",o)},SockJS.prototype._transportClose=function(t,e){debug("_transportClose",this.transport,t,e),this._transport&&(this._transport.removeAllListeners(),this._transport=null,this.transport=null),userSetCode(t)||2e3===t||this.readyState!==SockJS.CONNECTING?this._close(t,e):this._connect()},SockJS.prototype._open=function(){debug("_open",this._transport.transportName,this.readyState),this.readyState===SockJS.CONNECTING?(this._transportTimeoutId&&(clearTimeout(this._transportTimeoutId),this._transportTimeoutId=null),this.readyState=SockJS.OPEN,this.transport=this._transport.transportName,this.dispatchEvent(new Event("open")),debug("connected",this.transport)):this._close(1006,"Server lost session")},SockJS.prototype._close=function(t,e,r){debug("_close",this.transport,t,e,r,this.readyState);var s=!1;if(this._ir&&(s=!0,this._ir.close(),this._ir=null),this._transport&&(this._transport.close(),this._transport=null,this.transport=null),this.readyState===SockJS.CLOSED)throw new Error("InvalidStateError: SockJS has already been closed");this.readyState=SockJS.CLOSING,setTimeout(function(){this.readyState=SockJS.CLOSED,s&&this.dispatchEvent(new Event("error"));var o=new CloseEvent("close");o.wasClean=r||!1,o.code=t||1e3,o.reason=e,this.dispatchEvent(o),this.onmessage=this.onclose=this.onerror=null,debug("disconnected")}.bind(this),0)},SockJS.prototype.countRTO=function(t){return t>100?4*t:300+t},module.exports=function(t){return transports=transport(t),require("./iframe-bootstrap")(SockJS,t),SockJS}; }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./event/close":17,"./event/event":19,"./event/eventtarget":20,"./event/trans-message":21,"./iframe-bootstrap":23,"./info-receiver":27,"./location":28,"./shims":30,"./utils/browser":59,"./utils/escape":60,"./utils/event":61,"./utils/log":63,"./utils/object":64,"./utils/random":65,"./utils/transport":66,"./utils/url":67,"./version":68,"_process":13,"debug":3,"inherits":6,"json3":7,"url-parse":69}],30:[function(require,module,exports){ "use strict";var defineProperty,ArrayPrototype=Array.prototype,ObjectPrototype=Object.prototype,FunctionPrototype=Function.prototype,StringPrototype=String.prototype,array_slice=ArrayPrototype.slice,_toString=ObjectPrototype.toString,isFunction=function(t){return"[object Function]"===ObjectPrototype.toString.call(t)},isArray=function(t){return"[object Array]"===_toString.call(t)},isString=function(t){return"[object String]"===_toString.call(t)},supportsDescriptors=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(t){return!1}}();defineProperty=supportsDescriptors?function(t,r,e,n){!n&&r in t||Object.defineProperty(t,r,{configurable:!0,enumerable:!1,writable:!0,value:e})}:function(t,r,e,n){!n&&r in t||(t[r]=e)};var defineProperties=function(t,r,e){for(var n in r)ObjectPrototype.hasOwnProperty.call(r,n)&&defineProperty(t,n,r[n],e)},toObject=function(t){if(null==t)throw new TypeError("can't convert "+t+" to object");return Object(t)};function toInteger(t){var r=+t;return r!=r?r=0:0!==r&&r!==1/0&&r!==-1/0&&(r=(r>0||-1)*Math.floor(Math.abs(r))),r}function ToUint32(t){return t>>>0}function Empty(){}defineProperties(FunctionPrototype,{bind:function(t){var r=this;if(!isFunction(r))throw new TypeError("Function.prototype.bind called on incompatible "+r);for(var e=array_slice.call(arguments,1),n=Math.max(0,r.length-e.length),i=[],o=0;o>>0;if(!isFunction(t))throw new TypeError;for(;++i>>0;if(!e)return-1;var n=0;for(arguments.length>1&&(n=toInteger(arguments[1])),n=n>=0?n:Math.max(0,e+n);n1?function(){var t=void 0===/()??/.exec("")[1];StringPrototype.split=function(r,e){var n=this;if(void 0===r&&0===e)return[];if("[object RegExp]"!==_toString.call(r))return string_split.call(this,r,e);var i,o,s,p,c=[],l=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),a=0;for(r=new RegExp(r.source,l+"g"),n+="",t||(i=new RegExp("^"+r.source+"$(?!\\s)",l)),e=void 0===e?-1>>>0:ToUint32(e);(o=r.exec(n))&&!((s=o.index+o[0].length)>a&&(c.push(n.slice(a,o.index)),!t&&o.length>1&&o[0].replace(i,function(){for(var t=1;t1&&o.index=e));)r.lastIndex===o.index&&r.lastIndex++;return a===n.length?!p&&r.test("")||c.push(""):c.push(n.slice(a)),c.length>e?c.slice(0,e):c}}():"0".split(void 0,0).length&&(StringPrototype.split=function(t,r){return void 0===t&&0===r?[]:string_split.call(this,t,r)});var string_substr=StringPrototype.substr,hasNegativeSubstrBug="".substr&&"b"!=="0b".substr(-1);defineProperties(StringPrototype,{substr:function(t,r){return string_substr.call(this,t<0&&(t=this.length+t)<0?0:t,r)}},hasNegativeSubstrBug); },{}],31:[function(require,module,exports){ "use strict";module.exports=[require("./transport/websocket"),require("./transport/xhr-streaming"),require("./transport/xdr-streaming"),require("./transport/eventsource"),require("./transport/lib/iframe-wrap")(require("./transport/eventsource")),require("./transport/htmlfile"),require("./transport/lib/iframe-wrap")(require("./transport/htmlfile")),require("./transport/xhr-polling"),require("./transport/xdr-polling"),require("./transport/lib/iframe-wrap")(require("./transport/xhr-polling")),require("./transport/jsonp-polling")]; },{"./transport/eventsource":35,"./transport/htmlfile":36,"./transport/jsonp-polling":38,"./transport/lib/iframe-wrap":41,"./transport/websocket":53,"./transport/xdr-polling":54,"./transport/xdr-streaming":55,"./transport/xhr-polling":56,"./transport/xhr-streaming":57}],32:[function(require,module,exports){ (function (process,global){ "use strict";var EventEmitter=require("events").EventEmitter,inherits=require("inherits"),utils=require("../../utils/event"),urlUtils=require("../../utils/url"),XHR=global.XMLHttpRequest,debug=function(){};function AbstractXHRObject(t,e,r,i){debug(t,e);var s=this;EventEmitter.call(this),setTimeout(function(){s._start(t,e,r,i)},0)}"production"!==process.env.NODE_ENV&&(debug=require("debug")("sockjs-client:browser:xhr")),inherits(AbstractXHRObject,EventEmitter),AbstractXHRObject.prototype._start=function(t,e,r,i){var s=this;try{this.xhr=new XHR}catch(t){}if(!this.xhr)return debug("no xhr"),this.emit("finish",0,"no xhr support"),void this._cleanup();e=urlUtils.addQuery(e,"t="+ +new Date),this.unloadRef=utils.unloadAdd(function(){debug("unload cleanup"),s._cleanup(!0)});try{this.xhr.open(t,e,!0),this.timeout&&"timeout"in this.xhr&&(this.xhr.timeout=this.timeout,this.xhr.ontimeout=function(){debug("xhr timeout"),s.emit("finish",0,""),s._cleanup(!1)})}catch(t){return debug("exception",t),this.emit("finish",0,""),void this._cleanup(!1)}if(i&&i.noCredentials||!AbstractXHRObject.supportsCORS||(debug("withCredentials"),this.xhr.withCredentials="true"),i&&i.headers)for(var n in i.headers)this.xhr.setRequestHeader(n,i.headers[n]);this.xhr.onreadystatechange=function(){if(s.xhr){var t,e,r=s.xhr;switch(debug("readyState",r.readyState),r.readyState){case 3:try{e=r.status,t=r.responseText}catch(t){}debug("status",e),1223===e&&(e=204),200===e&&t&&t.length>0&&(debug("chunk"),s.emit("chunk",e,t));break;case 4:e=r.status,debug("status",e),1223===e&&(e=204),12005!==e&&12029!==e||(e=0),debug("finish",e,r.responseText),s.emit("finish",e,r.responseText),s._cleanup(!1)}}};try{s.xhr.send(r)}catch(t){s.emit("finish",0,""),s._cleanup(!1)}},AbstractXHRObject.prototype._cleanup=function(t){if(debug("cleanup"),this.xhr){if(this.removeAllListeners(),utils.unloadDel(this.unloadRef),this.xhr.onreadystatechange=function(){},this.xhr.ontimeout&&(this.xhr.ontimeout=null),t)try{this.xhr.abort()}catch(t){}this.unloadRef=this.xhr=null}},AbstractXHRObject.prototype.close=function(){debug("close"),this._cleanup(!0)},AbstractXHRObject.enabled=!!XHR;var axo=["Active"].concat("Object").join("X");!AbstractXHRObject.enabled&&axo in global&&(debug("overriding xmlhttprequest"),XHR=function(){try{return new global[axo]("Microsoft.XMLHTTP")}catch(t){return null}},AbstractXHRObject.enabled=!!new XHR);var cors=!1;try{cors="withCredentials"in new XHR}catch(t){}AbstractXHRObject.supportsCORS=cors,module.exports=AbstractXHRObject; }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../utils/event":61,"../../utils/url":67,"_process":13,"debug":3,"events":18,"inherits":6}],33:[function(require,module,exports){ (function (global){ module.exports=global.EventSource; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],34:[function(require,module,exports){ (function (global){ "use strict";var Driver=global.WebSocket||global.MozWebSocket;module.exports=Driver?function(e){return new Driver(e)}:void 0; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],35:[function(require,module,exports){ "use strict";var inherits=require("inherits"),AjaxBasedTransport=require("./lib/ajax-based"),EventSourceReceiver=require("./receiver/eventsource"),XHRCorsObject=require("./sender/xhr-cors"),EventSourceDriver=require("eventsource");function EventSourceTransport(e){if(!EventSourceTransport.enabled())throw new Error("Transport created when disabled");AjaxBasedTransport.call(this,e,"/eventsource",EventSourceReceiver,XHRCorsObject)}inherits(EventSourceTransport,AjaxBasedTransport),EventSourceTransport.enabled=function(){return!!EventSourceDriver},EventSourceTransport.transportName="eventsource",EventSourceTransport.roundTrips=2,module.exports=EventSourceTransport; },{"./lib/ajax-based":39,"./receiver/eventsource":44,"./sender/xhr-cors":50,"eventsource":33,"inherits":6}],36:[function(require,module,exports){ "use strict";var inherits=require("inherits"),HtmlfileReceiver=require("./receiver/htmlfile"),XHRLocalObject=require("./sender/xhr-local"),AjaxBasedTransport=require("./lib/ajax-based");function HtmlFileTransport(e){if(!HtmlfileReceiver.enabled)throw new Error("Transport created when disabled");AjaxBasedTransport.call(this,e,"/htmlfile",HtmlfileReceiver,XHRLocalObject)}inherits(HtmlFileTransport,AjaxBasedTransport),HtmlFileTransport.enabled=function(e){return HtmlfileReceiver.enabled&&e.sameOrigin},HtmlFileTransport.transportName="htmlfile",HtmlFileTransport.roundTrips=2,module.exports=HtmlFileTransport; },{"./lib/ajax-based":39,"./receiver/htmlfile":45,"./sender/xhr-local":52,"inherits":6}],37:[function(require,module,exports){ (function (process){ "use strict";var inherits=require("inherits"),JSON3=require("json3"),EventEmitter=require("events").EventEmitter,version=require("../version"),urlUtils=require("../utils/url"),iframeUtils=require("../utils/iframe"),eventUtils=require("../utils/event"),random=require("../utils/random"),debug=function(){};function IframeTransport(e,t,r){if(!IframeTransport.enabled())throw new Error("Transport created when disabled");EventEmitter.call(this);var s=this;this.origin=urlUtils.getOrigin(r),this.baseUrl=r,this.transUrl=t,this.transport=e,this.windowId=random.string(8);var i=urlUtils.addPath(r,"/iframe.html")+"#"+this.windowId;debug(e,t,i),this.iframeObj=iframeUtils.createIframe(i,function(e){debug("err callback"),s.emit("close",1006,"Unable to load an iframe ("+e+")"),s.close()}),this.onmessageCallback=this._message.bind(this),eventUtils.attachEvent("message",this.onmessageCallback)}"production"!==process.env.NODE_ENV&&(debug=require("debug")("sockjs-client:transport:iframe")),inherits(IframeTransport,EventEmitter),IframeTransport.prototype.close=function(){if(debug("close"),this.removeAllListeners(),this.iframeObj){eventUtils.detachEvent("message",this.onmessageCallback);try{this.postMessage("c")}catch(e){}this.iframeObj.cleanup(),this.iframeObj=null,this.onmessageCallback=this.iframeObj=null}},IframeTransport.prototype._message=function(e){if(debug("message",e.data),urlUtils.isOriginEqual(e.origin,this.origin)){var t;try{t=JSON3.parse(e.data)}catch(t){return void debug("bad json",e.data)}if(t.windowId===this.windowId)switch(t.type){case"s":this.iframeObj.loaded(),this.postMessage("s",JSON3.stringify([version,this.transport,this.transUrl,this.baseUrl]));break;case"t":this.emit("message",t.data);break;case"c":var r;try{r=JSON3.parse(t.data)}catch(e){return void debug("bad json",t.data)}this.emit("close",r[0],r[1]),this.close()}else debug("mismatched window id",t.windowId,this.windowId)}else debug("not same origin",e.origin,this.origin)},IframeTransport.prototype.postMessage=function(e,t){debug("postMessage",e,t),this.iframeObj.post(JSON3.stringify({windowId:this.windowId,type:e,data:t||""}),this.origin)},IframeTransport.prototype.send=function(e){debug("send",e),this.postMessage("m",e)},IframeTransport.enabled=function(){return iframeUtils.iframeEnabled},IframeTransport.transportName="iframe",IframeTransport.roundTrips=2,module.exports=IframeTransport; }).call(this,require('_process')) },{"../utils/event":61,"../utils/iframe":62,"../utils/random":65,"../utils/url":67,"../version":68,"_process":13,"debug":3,"events":18,"inherits":6,"json3":7}],38:[function(require,module,exports){ (function (global){ "use strict";var inherits=require("inherits"),SenderReceiver=require("./lib/sender-receiver"),JsonpReceiver=require("./receiver/jsonp"),jsonpSender=require("./sender/jsonp");function JsonPTransport(e){if(!JsonPTransport.enabled())throw new Error("Transport created when disabled");SenderReceiver.call(this,e,"/jsonp",jsonpSender,JsonpReceiver)}inherits(JsonPTransport,SenderReceiver),JsonPTransport.enabled=function(){return!!global.document},JsonPTransport.transportName="jsonp-polling",JsonPTransport.roundTrips=1,JsonPTransport.needBody=!0,module.exports=JsonPTransport; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./lib/sender-receiver":43,"./receiver/jsonp":46,"./sender/jsonp":48,"inherits":6}],39:[function(require,module,exports){ (function (process){ "use strict";var inherits=require("inherits"),urlUtils=require("../../utils/url"),SenderReceiver=require("./sender-receiver"),debug=function(){};function createAjaxSender(e){return function(r,n,t){debug("create ajax sender",r,n);var i={};"string"==typeof n&&(i.headers={"Content-type":"text/plain"});var s=urlUtils.addPath(r,"/xhr_send"),a=new e("POST",s,n,i);return a.once("finish",function(e){if(debug("finish",e),a=null,200!==e&&204!==e)return t(new Error("http status "+e));t()}),function(){debug("abort"),a.close(),a=null;var e=new Error("Aborted");e.code=1e3,t(e)}}}function AjaxBasedTransport(e,r,n,t){SenderReceiver.call(this,e,r,createAjaxSender(t),n,t)}"production"!==process.env.NODE_ENV&&(debug=require("debug")("sockjs-client:ajax-based")),inherits(AjaxBasedTransport,SenderReceiver),module.exports=AjaxBasedTransport; }).call(this,require('_process')) },{"../../utils/url":67,"./sender-receiver":43,"_process":13,"debug":3,"inherits":6}],40:[function(require,module,exports){ (function (process){ "use strict";var inherits=require("inherits"),EventEmitter=require("events").EventEmitter,debug=function(){};function BufferedSender(e,t){debug(e),EventEmitter.call(this),this.sendBuffer=[],this.sender=t,this.url=e}"production"!==process.env.NODE_ENV&&(debug=require("debug")("sockjs-client:buffered-sender")),inherits(BufferedSender,EventEmitter),BufferedSender.prototype.send=function(e){debug("send",e),this.sendBuffer.push(e),this.sendStop||this.sendSchedule()},BufferedSender.prototype.sendScheduleWait=function(){debug("sendScheduleWait");var e,t=this;this.sendStop=function(){debug("sendStop"),t.sendStop=null,clearTimeout(e)},e=setTimeout(function(){debug("timeout"),t.sendStop=null,t.sendSchedule()},25)},BufferedSender.prototype.sendSchedule=function(){debug("sendSchedule",this.sendBuffer.length);var e=this;if(this.sendBuffer.length>0){var t="["+this.sendBuffer.join(",")+"]";this.sendStop=this.sender(this.url,t,function(t){e.sendStop=null,t?(debug("error",t),e.emit("close",t.code||1006,"Sending error: "+t),e.close()):e.sendScheduleWait()}),this.sendBuffer=[]}},BufferedSender.prototype._cleanup=function(){debug("_cleanup"),this.removeAllListeners()},BufferedSender.prototype.close=function(){debug("close"),this._cleanup(),this.sendStop&&(this.sendStop(),this.sendStop=null)},module.exports=BufferedSender; }).call(this,require('_process')) },{"_process":13,"debug":3,"events":18,"inherits":6}],41:[function(require,module,exports){ (function (global){ "use strict";var inherits=require("inherits"),IframeTransport=require("../iframe"),objectUtils=require("../../utils/object");module.exports=function(r){function e(e,t){IframeTransport.call(this,r.transportName,e,t)}return inherits(e,IframeTransport),e.enabled=function(e,t){if(!global.document)return!1;var n=objectUtils.extend({},t);return n.sameOrigin=!0,r.enabled(n)&&IframeTransport.enabled()},e.transportName="iframe-"+r.transportName,e.needBody=!0,e.roundTrips=IframeTransport.roundTrips+r.roundTrips-1,e.facadeTransport=r,e}; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../utils/object":64,"../iframe":37,"inherits":6}],42:[function(require,module,exports){ (function (process){ "use strict";var inherits=require("inherits"),EventEmitter=require("events").EventEmitter,debug=function(){};function Polling(e,i,t){debug(i),EventEmitter.call(this),this.Receiver=e,this.receiveUrl=i,this.AjaxObject=t,this._scheduleReceiver()}"production"!==process.env.NODE_ENV&&(debug=require("debug")("sockjs-client:polling")),inherits(Polling,EventEmitter),Polling.prototype._scheduleReceiver=function(){debug("_scheduleReceiver");var e=this,i=this.poll=new this.Receiver(this.receiveUrl,this.AjaxObject);i.on("message",function(i){debug("message",i),e.emit("message",i)}),i.once("close",function(t,l){debug("close",t,l,e.pollIsClosing),e.poll=i=null,e.pollIsClosing||("network"===l?e._scheduleReceiver():(e.emit("close",t||1006,l),e.removeAllListeners()))})},Polling.prototype.abort=function(){debug("abort"),this.removeAllListeners(),this.pollIsClosing=!0,this.poll&&this.poll.abort()},module.exports=Polling; }).call(this,require('_process')) },{"_process":13,"debug":3,"events":18,"inherits":6}],43:[function(require,module,exports){ (function (process){ "use strict";var inherits=require("inherits"),urlUtils=require("../../utils/url"),BufferedSender=require("./buffered-sender"),Polling=require("./polling"),debug=function(){};function SenderReceiver(e,l,r,i,s){var o=urlUtils.addPath(e,l);debug(o);var n=this;BufferedSender.call(this,e,r),this.poll=new Polling(i,o,s),this.poll.on("message",function(e){debug("poll message",e),n.emit("message",e)}),this.poll.once("close",function(e,l){debug("poll close",e,l),n.poll=null,n.emit("close",e,l),n.close()})}"production"!==process.env.NODE_ENV&&(debug=require("debug")("sockjs-client:sender-receiver")),inherits(SenderReceiver,BufferedSender),SenderReceiver.prototype.close=function(){BufferedSender.prototype.close.call(this),debug("close"),this.removeAllListeners(),this.poll&&(this.poll.abort(),this.poll=null)},module.exports=SenderReceiver; }).call(this,require('_process')) },{"../../utils/url":67,"./buffered-sender":40,"./polling":42,"_process":13,"debug":3,"inherits":6}],44:[function(require,module,exports){ (function (process){ "use strict";var inherits=require("inherits"),EventEmitter=require("events").EventEmitter,EventSourceDriver=require("eventsource"),debug=function(){};function EventSourceReceiver(e){debug(e),EventEmitter.call(this);var t=this,r=this.es=new EventSourceDriver(e);r.onmessage=function(e){debug("message",e.data),t.emit("message",decodeURI(e.data))},r.onerror=function(e){debug("error",r.readyState,e);var n=2!==r.readyState?"network":"permanent";t._cleanup(),t._close(n)}}"production"!==process.env.NODE_ENV&&(debug=require("debug")("sockjs-client:receiver:eventsource")),inherits(EventSourceReceiver,EventEmitter),EventSourceReceiver.prototype.abort=function(){debug("abort"),this._cleanup(),this._close("user")},EventSourceReceiver.prototype._cleanup=function(){debug("cleanup");var e=this.es;e&&(e.onmessage=e.onerror=null,e.close(),this.es=null)},EventSourceReceiver.prototype._close=function(e){debug("close",e);var t=this;setTimeout(function(){t.emit("close",null,e),t.removeAllListeners()},200)},module.exports=EventSourceReceiver; }).call(this,require('_process')) },{"_process":13,"debug":3,"events":18,"eventsource":33,"inherits":6}],45:[function(require,module,exports){ (function (process,global){ "use strict";var inherits=require("inherits"),iframeUtils=require("../../utils/iframe"),urlUtils=require("../../utils/url"),EventEmitter=require("events").EventEmitter,random=require("../../utils/random"),debug=function(){};function HtmlfileReceiver(e){debug(e),EventEmitter.call(this);var i=this;iframeUtils.polluteGlobalNamespace(),this.id="a"+random.string(6),e=urlUtils.addQuery(e,"c="+decodeURIComponent(iframeUtils.WPrefix+"."+this.id)),debug("using htmlfile",HtmlfileReceiver.htmlfileEnabled);var t=HtmlfileReceiver.htmlfileEnabled?iframeUtils.createHtmlfile:iframeUtils.createIframe;global[iframeUtils.WPrefix][this.id]={start:function(){debug("start"),i.iframeObj.loaded()},message:function(e){debug("message",e),i.emit("message",e)},stop:function(){debug("stop"),i._cleanup(),i._close("network")}},this.iframeObj=t(e,function(){debug("callback"),i._cleanup(),i._close("permanent")})}"production"!==process.env.NODE_ENV&&(debug=require("debug")("sockjs-client:receiver:htmlfile")),inherits(HtmlfileReceiver,EventEmitter),HtmlfileReceiver.prototype.abort=function(){debug("abort"),this._cleanup(),this._close("user")},HtmlfileReceiver.prototype._cleanup=function(){debug("_cleanup"),this.iframeObj&&(this.iframeObj.cleanup(),this.iframeObj=null),delete global[iframeUtils.WPrefix][this.id]},HtmlfileReceiver.prototype._close=function(e){debug("_close",e),this.emit("close",null,e),this.removeAllListeners()},HtmlfileReceiver.htmlfileEnabled=!1;var axo=["Active"].concat("Object").join("X");if(axo in global)try{HtmlfileReceiver.htmlfileEnabled=!!new global[axo]("htmlfile")}catch(e){}HtmlfileReceiver.enabled=HtmlfileReceiver.htmlfileEnabled||iframeUtils.iframeEnabled,module.exports=HtmlfileReceiver; }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../utils/iframe":62,"../../utils/random":65,"../../utils/url":67,"_process":13,"debug":3,"events":18,"inherits":6}],46:[function(require,module,exports){ (function (process,global){ "use strict";var utils=require("../../utils/iframe"),random=require("../../utils/random"),browser=require("../../utils/browser"),urlUtils=require("../../utils/url"),inherits=require("inherits"),EventEmitter=require("events").EventEmitter,debug=function(){};function JsonpReceiver(e){debug(e);var t=this;EventEmitter.call(this),utils.polluteGlobalNamespace(),this.id="a"+random.string(6);var r=urlUtils.addQuery(e,"c="+encodeURIComponent(utils.WPrefix+"."+this.id));global[utils.WPrefix][this.id]=this._callback.bind(this),this._createScript(r),this.timeoutId=setTimeout(function(){debug("timeout"),t._abort(new Error("JSONP script loaded abnormally (timeout)"))},JsonpReceiver.timeout)}"production"!==process.env.NODE_ENV&&(debug=require("debug")("sockjs-client:receiver:jsonp")),inherits(JsonpReceiver,EventEmitter),JsonpReceiver.prototype.abort=function(){if(debug("abort"),global[utils.WPrefix][this.id]){var e=new Error("JSONP user aborted read");e.code=1e3,this._abort(e)}},JsonpReceiver.timeout=35e3,JsonpReceiver.scriptErrorTimeout=1e3,JsonpReceiver.prototype._callback=function(e){debug("_callback",e),this._cleanup(),this.aborting||(e&&(debug("message",e),this.emit("message",e)),this.emit("close",null,"network"),this.removeAllListeners())},JsonpReceiver.prototype._abort=function(e){debug("_abort",e),this._cleanup(),this.aborting=!0,this.emit("close",e.code,e.message),this.removeAllListeners()},JsonpReceiver.prototype._cleanup=function(){if(debug("_cleanup"),clearTimeout(this.timeoutId),this.script2&&(this.script2.parentNode.removeChild(this.script2),this.script2=null),this.script){var e=this.script;e.parentNode.removeChild(e),e.onreadystatechange=e.onerror=e.onload=e.onclick=null,this.script=null}delete global[utils.WPrefix][this.id]},JsonpReceiver.prototype._scriptError=function(){debug("_scriptError");var e=this;this.errorTimer||(this.errorTimer=setTimeout(function(){e.loadedOkay||e._abort(new Error("JSONP script loaded abnormally (onerror)"))},JsonpReceiver.scriptErrorTimeout))},JsonpReceiver.prototype._createScript=function(e){debug("_createScript",e);var t,r=this,i=this.script=global.document.createElement("script");if(i.id="a"+random.string(8),i.src=e,i.type="text/javascript",i.charset="UTF-8",i.onerror=this._scriptError.bind(this),i.onload=function(){debug("onload"),r._abort(new Error("JSONP script loaded abnormally (onload)"))},i.onreadystatechange=function(){if(debug("onreadystatechange",i.readyState),/loaded|closed/.test(i.readyState)){if(i&&i.htmlFor&&i.onclick){r.loadedOkay=!0;try{i.onclick()}catch(e){}}i&&r._abort(new Error("JSONP script loaded abnormally (onreadystatechange)"))}},void 0===i.async&&global.document.attachEvent)if(browser.isOpera())(t=this.script2=global.document.createElement("script")).text="try{var a = document.getElementById('"+i.id+"'); if(a)a.onerror();}catch(x){};",i.async=t.async=!1;else{try{i.htmlFor=i.id,i.event="onclick"}catch(e){}i.async=!0}void 0!==i.async&&(i.async=!0);var o=global.document.getElementsByTagName("head")[0];o.insertBefore(i,o.firstChild),t&&o.insertBefore(t,o.firstChild)},module.exports=JsonpReceiver; }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../utils/browser":59,"../../utils/iframe":62,"../../utils/random":65,"../../utils/url":67,"_process":13,"debug":3,"events":18,"inherits":6}],47:[function(require,module,exports){ (function (process){ "use strict";var inherits=require("inherits"),EventEmitter=require("events").EventEmitter,debug=function(){};function XhrReceiver(e,i){debug(e),EventEmitter.call(this);var t=this;this.bufferPosition=0,this.xo=new i("POST",e,null),this.xo.on("chunk",this._chunkHandler.bind(this)),this.xo.once("finish",function(e,i){debug("finish",e,i),t._chunkHandler(e,i),t.xo=null;var r=200===e?"network":"permanent";debug("close",r),t.emit("close",null,r),t._cleanup()})}"production"!==process.env.NODE_ENV&&(debug=require("debug")("sockjs-client:receiver:xhr")),inherits(XhrReceiver,EventEmitter),XhrReceiver.prototype._chunkHandler=function(e,i){if(debug("_chunkHandler",e),200===e&&i)for(var t=-1;;this.bufferPosition+=t+1){var r=i.slice(this.bufferPosition);if(-1===(t=r.indexOf("\n")))break;var n=r.slice(0,t);n&&(debug("message",n),this.emit("message",n))}},XhrReceiver.prototype._cleanup=function(){debug("_cleanup"),this.removeAllListeners()},XhrReceiver.prototype.abort=function(){debug("abort"),this.xo&&(this.xo.close(),debug("close"),this.emit("close",null,"user"),this.xo=null),this._cleanup()},module.exports=XhrReceiver; }).call(this,require('_process')) },{"_process":13,"debug":3,"events":18,"inherits":6}],48:[function(require,module,exports){ (function (process,global){ "use strict";var form,area,random=require("../../utils/random"),urlUtils=require("../../utils/url"),debug=function(){};function createIframe(e){debug("createIframe",e);try{return global.document.createElement('
'+lang[293]+'
'); a(".arrowchat_embed_close").click(function () { closeEmbed(); }); alreadyLoaded = 1; } scrollPosition = a(document).scrollTop(); pushCancelAll(); clearTimeout(Z); cancelJSONP(); a("#arrowchat_mobiletab").hide(); a("#arrowchat_mobiletab_new").hide(); a(".arrowchat_mobiletab_new_count").html('0') a(".arrowchat_embed").show("slide", { direction: "down"}, 250, function() { a('body,html').addClass('arrowchat_noScroll'); }); } function closeEmbed() { pushSubscribe(); loadBuddyList(); if (c_push_engine != 1) { receiveCore(); } a('body,html').removeClass('arrowchat_noScroll'); a("#arrowchat_mobiletab").show(); a(document).scrollTop(scrollPosition); a(".arrowchat_embed").hide("slide", { direction: "down"}, 250); } function displayWelcome() { if (c_first_time_message_on == 1) { $body.append('
' + c_first_time_message_header + '' + c_first_time_message_content + '
'); setTimeout(function () { a("#arrowchat_welcome").hide("slow"); }, 10000); } } function receiveAnnouncement(h) { if (h.read == 0 && h.data != "") { a("#arrowchat_announcement").remove(); $body.append('
'+h.data+'
'+lang[28]+'
'); a("#arrowchat_announcement .arrowchat_announce_close").click(function () { a("#arrowchat_announcement").remove(); a.post(c_ac_path + "includes/json/send/send_settings.php", { announce: 1 }, function () {}); }); } else { a("#arrowchat_announcement").remove(); } } function pushSubscribe() { if (c_push_engine == 1) { push_uid = push.subscribe(c_push_encrypt + "_u"+u_id); push_arrowchat = push.subscribe(c_push_encrypt + "_arrowchat"); push_arrowchat.on('data', function (data) { pushReceive(data); }); push_uid.on('data', function (data) { pushReceive(data); }); } } function pushCancelAll() { if (c_push_engine == 1) { push_uid.unsubscribe(); } } function pushReceive(data) { if ("announcement" in data) { receiveAnnouncement(data.announcement); } if ("messages" in data) { receiveMessage(data.messages.id, data.messages.from, data.messages.message, data.messages.sent, data.messages.self, data.messages.old); data.messages.self != 1 && u_sounds == 1 && playNewMessageSound(); addToCount(1); } } function stripslashes(str) { str=str.replace(/\\'/g,'\''); str=str.replace(/\\"/g,'"'); str=str.replace(/\\0/g,'\0'); str=str.replace(/\\\\/g,'\\'); return str; } function receiveMessage(id, from, message, sent, self, old) { if (from != u_id && typeof(uc_name[from]) != "undefined") { message = stripslashes(message); a(".arrowchat_notify_avatar").html(''); a(".arrowchat_notify_username").html(uc_name[from]); a(".arrowchat_notify_msg").html(message); clearTimeout(message_timeout); a(".arrowchat_notify_box").show("slide", { direction: "up"}, 250); message_timeout = setTimeout(function () { a(".arrowchat_notify_box").hide("slide", { direction: "up"}, 250); }, 5000); a(".arrowchat_notify_box").unbind('click'); a(".arrowchat_notify_box").click(function() { clearTimeout(message_timeout); a(".arrowchat_notify_box").hide(); if (c_mobile_action == 1) showEmbed(''); else window.open(c_ac_path + 'public/mobile/#chatwith-' + from, 'mobiletab', '_blank'); }); } } function addToCount(number) { var count = parseInt(a(".arrowchat_mobiletab_new_count").html()) + number; var fontSize = parseInt(a('#arrowchat_mobiletab').css('font-size'), 10); a(".arrowchat_mobiletab_new_count").html(count); a("#arrowchat_mobiletab_new").show(); } function loadBuddyList() { clearTimeout(Z); a.ajax({ url: c_ac_path + "includes/json/receive/receive_buddylist.php?mobile=1", cache: false, type: "get", dataType: "json", success: function (b) { buildBuddyList(b); } }); if (typeof c_list_heart_beat != "undefined") { var BLHT = c_list_heart_beat * 1000; } else { var BLHT = 60000; } Z = setTimeout(function () { loadBuddyList() }, BLHT) } function cancelJSONP() { if (typeof CHA != "undefined") { clearTimeout(CHA); } if (typeof xOptions != "undefined") { xOptions.abort(); } } function receiveCore() { cancelJSONP(); var url = c_ac_path + "includes/json/receive/receive_core.php?hash=" + u_hash_id + "&init=" + acsi + "&room=0"; xOptions = a.ajax({ url: url, dataType: "jsonp", success: function (b) { var new_messages = 0; if (b && b != null) { a.each(b, function (e, l) { if (e == "messages") { a.each(l, function (f, h) { if (acsi != 1) receiveMessage(h.id, h.from, h.message, h.sent, h.self, 1); new_messages++; }); u_sounds == 1 && acsi != 1 && playNewMessageSound(); } if (e == "announcements") { a.each(l, function (f, h) { receiveAnnouncement(h); }); } }); } acsi++; if (new_messages > 0) { addToCount(new_messages); } } }); var CHT = c_heart_beat * 1000 * 3; if (c_push_engine != 1) { CHA = setTimeout(function () { receiveCore() }, CHT); } } function buildBuddyList(b) { var onlineNumber = 0; b && a.each(b, function (i, e) { if (i == "buddylist") { a.each(e, function (l, f) { if (f.s == "available" || f.s == "away" || f.s == "busy") onlineNumber++; uc_status[f.id] = f.s; uc_name[f.id] = f.n; uc_avatar[f.id] = f.a; uc_link[f.id] = f.l }); a("#arrowchat_mobiletab_count").html(onlineNumber); } }) } var Z, CHA, message_timeout, push_room = {}, push_uid, alreadyLoaded = 0, scrollPosition = 0, push_arrowchat, acsi = 1; arguments.callee.chatWith = function (b) { if (c_mobile_action == 1) { alreadyLoaded = 0; showEmbed('#chatwith-' + b); } else window.open(c_ac_path + 'public/mobile/#chatwith-' + b, 'mobiletab', '_blank'); }; arguments.callee.getUser = function (b, c) { a.ajax({ url: c_ac_path + "includes/json/receive/receive_user.php", data: { userid: b }, type: "post", cache: false, dataType: "json", success: function (o) { if (o) { window[c](o); } else { window[c](0); } } }); }; arguments.callee.sendMessage = function (b, c) { c != "" && a.post(c_ac_path + "includes/json/send/send_message.php", { to: b, message: c }, function (d) { if (d) { if (!a.isNumeric(d)) { a.each(d, function (i, q) { if (i == "error") { a.each(q, function (l, f) { alert(f.m); }); } }); } else { alreadyLoaded = 0; showEmbed('#chatwith-' + b); } } }) }; arguments.callee.chatroom = function (b) { if (c_mobile_action == 1) { alreadyLoaded = 0; showEmbed('#room-' + b); } else window.open(c_ac_path + 'public/mobile/', 'mobiletab', '_blank'); }; arguments.callee.videoWith = function (b) { if (c_video_select == 4) { var win = window.open('https://meet.jit.si/' + b, 'audiovideochat', "status=no,toolbar=no,menubar=no,directories=no,resizable=no,location=no,scrollbars=no,width="+c_video_width+",height="+c_video_height+""); } else if (c_video_select == 1) { var win = window.open('https://meet.jit.si/' + b, 'audiovideochat', "status=no,toolbar=no,menubar=no,directories=no,resizable=no,location=no,scrollbars=no,width="+c_video_width+",height="+c_video_height+""); } else { var win = window.open(c_ac_path + 'public/video/?rid=' + b, 'audiovideochat', "status=no,toolbar=no,menubar=no,directories=no,resizable=no,location=no,scrollbars=no,width="+c_video_width+",height="+c_video_height+""); } win.focus(); }; arguments.callee.logout = function () { pushCancelAll(); clearTimeout(Z); cancelJSONP(); u_id = ""; a("#arrowchat_mobiletab").remove(); a(".arrowchat_notify_box").remove(); a(".arrowchat_embed").remove(); a('body,html').removeClass('arrowchat_noScroll'); }; arguments.callee.runarrowchat = runarrowchat; } })(jqac); jqac(document).ready(function () { if (u_id != "" && c_disable_arrowchat != 1 && c_chat_maintenance != 1) { jqac.arrowchat(); jqac.arrowchat.runarrowchat() } });