lightstreamer-client
Version:
This package includes the resources needed to write a Lightstreamer client.
120 lines • 190 kB
JavaScript
/*
* LIGHTSTREAMER - www.lightstreamer.com
* Lightstreamer Node.js Client
* Version 7.3.2 build 1769.3
* Copyright (c) Lightstreamer Srl. All Rights Reserved.
* Contains: LightstreamerClient, Subscription, LogMessages, BufferAppender
* ConsoleAppender, FunctionAppender, RemoteAppender, SimpleLoggerProvider
* CommonJS
*/
function define(a,c,e){define.a[a]={e:c,d:e}}define.a={};define.b=function(a,c,e){for(var g=[],f=0;f<a.length;f++){var d=define.a[a[f]];if(!d)throw"All the modules must already be 'defined' Async load not supported: use a full-featured AMD loader like requirejs";d.c||define.b(d.e,d.d,a[f]);g.push(d.c)}a=c.apply(null,g);if(e)define.a[e].c=a};function oneRequire(a,c){define.b(a,c,null)};(function(){define("IllegalStateException",[],function(){function d(d){this.name="IllegalStateException";this.message=d}d.prototype={toString:function(){return["[",this.name,this.message,"]"].join("|")}};return d});
define("Environment",["IllegalStateException"],function(d){var f="undefined"!==typeof window&&"undefined"!==typeof navigator&&"undefined"!==typeof document,b="undefined"!==typeof importScripts,a="object"==typeof process&&(/node(\.exe)?$/.test(process.execPath)||process.node&&process.v8||process.versions&&process.versions.node&&process.versions.v8);if(f&&!document.getElementById)throw new d("Not supported browser");var c={isBrowserDocument:function(){return f},isBrowser:function(){return!a&&(f||b)},
isNodeJS:function(){return!f&&a},isWebWorker:function(){return!f&&!a&&b},fy:function(){return!f&&!a&&!b},browserDocumentOrDie:function(){if(!this.isBrowserDocument())throw new d("Trying to load a browser-only module on non-browser environment");}};c.isBrowserDocument=c.isBrowserDocument;c.isBrowser=c.isBrowser;c.isNodeJS=c.isNodeJS;c.isWebWorker=c.isWebWorker;c.browserDocumentOrDie=c.browserDocumentOrDie;return c});
define("Helpers",["Environment"],function(d){var f=/^\s*([\s\S]*?)\s*$/,b=RegExp(",","g"),a=RegExp("\\.","g"),c={getTimeStamp:function(){return(new Date).getTime()},randomG:function(a){return Math.round(Math.random()*(a||1E3))},trim:function(a){return a.replace(f,"$1")},getNumber:function(c,e){if(c){if(!c.replace)return c;e?(c=c.replace(a,""),c=c.replace(b,".")):c=c.replace(b,"");return new Number(c)}return 0},isArray:function(a){return a&&a.join&&"function"==typeof a.join},addEvent:function(a,b,
c){if(!d.isBrowserDocument())return!1;"undefined"!=typeof a.addEventListener?a.addEventListener(b,c,!1):"undefined"!=typeof a.attachEvent&&a.attachEvent("on"+b,c);return!0},removeEvent:function(a,b,c){if(!d.isBrowserDocument())return!1;"undefined"!=typeof a.removeEventListener?a.removeEventListener(b,c,!1):"undefined"!=typeof a.detachEvent&&a.detachEvent("on"+b,c);return!0}};c.getTimeStamp=c.getTimeStamp;c.randomG=c.randomG;c.trim=c.trim;c.getNumber=c.getNumber;c.isArray=c.isArray;c.addEvent=c.addEvent;
c.removeEvent=c.removeEvent;return c});
define("BrowserDetection",["Environment"],function(d){function f(a){var b=e;return function(){null===b&&(b=-1<p.indexOf(a));return b}}function b(a){var b=e;return function(){if(null===b){b=!0;for(var c=0;c<a.length;c++)b=b&&a[c]()}return b}}function a(a,b){var c=e,g=e;return function(e,d){null===c&&(g=(c=a())?b():null);return c?e&&g?!0===d?g<=e:!1===d?g>=e:g==e:!0:!1}}function c(a){var b=e;return function(){if(null===b){var c=a.exec(p);if(c&&2<=c.length)return c[1]}return null}}function g(a){return function(){return!a()}}
var e=d.isBrowser()?null:!1,p=d.isBrowser()?navigator.userAgent.toLowerCase():null,k=e;d={isProbablyRekonq:f("rekonq"),isProbablyAWebkit:f("webkit"),isProbablyPlaystation:f("playstation 3"),isProbablyChrome:a(f("chrome/"),c(RegExp("chrome/([0-9]+)","g"))),isProbablyAKhtml:function(){null===k&&(k=document.childNodes&&!document.all&&!navigator.WC&&!navigator.CC);return k},isProbablyKonqueror:a(f("konqueror"),c(RegExp("konqueror/([0-9.]+)","g"))),isProbablyIE:function(b,g){return a(f("msie"),c(RegExp("msie\\s([0-9]+)[.;]",
"g")))(b,g)||a(f("rv:11.0"),function(){return"11"})(b,g)?!0:!1},xr:f("edge"),isProbablyFX:a(f("firefox"),c(/firefox\/(\d+\.?\d*)/)),isProbablyOldOpera:a(function(){return"undefined"!=typeof opera},function(){if(opera.version){var a=opera.version(),a=a.replace(RegExp("[^0-9.]+","g"),"");return parseInt(a)}return 7})};d.isProbablyAndroidBrowser=b([f("android"),d.isProbablyAWebkit,g(d.isProbablyChrome)]);d.isProbablyOperaMobile=b([d.isProbablyOldOpera,f("opera mobi")]);d.isProbablyApple=a(b([f("safari"),
function(a){var b=e;return function(){if(null===b){b=!1;for(var c=0;c<a.length;c++)b=b||a[c]()}return b}}([f("ipad"),f("iphone"),f("ipod"),b([g(d.isProbablyAndroidBrowser),g(d.isProbablyChrome),g(d.isProbablyRekonq)])])]),c(/version\/(\d+\.?\d*)/));d.isProbablyRekonq=d.isProbablyRekonq;d.isProbablyChrome=d.isProbablyChrome;d.isProbablyAWebkit=d.isProbablyAWebkit;d.isProbablyPlaystation=d.isProbablyPlaystation;d.isProbablyAndroidBrowser=d.isProbablyAndroidBrowser;d.isProbablyOperaMobile=d.isProbablyOperaMobile;
d.isProbablyApple=d.isProbablyApple;d.isProbablyAKhtml=d.isProbablyAKhtml;d.isProbablyKonqueror=d.isProbablyKonqueror;d.isProbablyIE=d.isProbablyIE;d.isProbablyEdge=d.xr;d.isProbablyFX=d.isProbablyFX;d.isProbablyOldOpera=d.isProbablyOldOpera;return d});
define("List",[],function(){function d(){this.data=[]}d.prototype={add:function(d){this.data.push(d)},remove:function(d){d=this.find(d);if(0>d)return!1;this.data.splice(d,1);return!0},contains:function(d){return 0<=this.find(d)},find:function(d){for(var b=0;b<this.data.length;b++)if(this.data[b]===d)return b;return-1},forEach:function(d){for(var b=0;b<this.data.length;b++)d(this.data[b])},asArray:function(){return[].concat(this.data)},clean:function(){this.data=[]}};d.prototype.add=d.prototype.add;
d.prototype.remove=d.prototype.remove;d.prototype.forEach=d.prototype.forEach;d.prototype.asArray=d.prototype.asArray;d.prototype.clean=d.prototype.clean;return d});
define("EnvironmentStatus",["Helpers","BrowserDetection","Environment","List"],function(d,f,b,a){function c(a,b,c,e,d){return function(){a[b]||(a[c]=!0,e.forEach(function(a){try{if(a[d])a[d]();else a()}catch(b){}}),"preunloading"!=b&&e.clean(),a[b]=!0,a[c]=!1)}}function g(a,b){setTimeout(function(){if(a[b])a[b]();else a()},0)}function e(a,b,c,e){setTimeout(function(){c?e?a.apply(c,e):a.apply(c):e?a.apply(null,e):a()},b)}function p(){m=!0}var k=new a,h=new a,l=new a,m=!1,r={zh:"onloadDone",rs:"onloadInprogress",
gi:"unloaded",Do:"unloading",Bs:"preunloading"};a={};for(var n in r)a[r[n]]=n;n={zh:!1,rs:!1,gi:!1,Do:!1,Bs:!1,isLoaded:function(){return this.zh},isUnloaded:function(){return this.gi},isUnloading:function(){return this.Do},addOnloadHandler:function(a){this.hy()?h.add(a):g(a,"onloadEvent")},addUnloadHandler:function(a){this.iy()?k.add(a):g(a,"unloadEvent")},addBeforeUnloadHandler:function(a){l.add(a);this.Bs&&g(a,"preUnloadEvent")},removeOnloadHandler:function(a){h.remove(a)},removeUnloadHandler:function(a){k.remove(a)},
removeBeforeUnloadHandler:function(a){l.remove(a)},hy:function(){return!(this.zh||this.rs)},iy:function(){return!(this.gi||this.Do)},Tu:function(){d.addEvent(window,"unload",this.ov);d.addEvent(window,"beforeunload",this.Vu);if(document&&"undefined"!=typeof document.readyState){if("COMPLETE"==document.readyState.toUpperCase()){this.Bi();return}e(this.bq,1E3,this)}else if(this.vr()){this.Bi();return}if(!d.addEvent(window,"load",this.fk))this.Bi();else if(f.isProbablyOldOpera()){var a=!1;f.isProbablyOldOpera(9,
!1)&&(a=!0,d.addEvent(document,"DOMContentLoaded",p));e(this.aq,1E3,this,[a])}},Bi:function(){e(this.fk,0)},bq:function(){this.zh||("COMPLETE"==document.readyState.toUpperCase()?this.fk():e(this.bq,1E3,this))},aq:function(a){this.zh||(m||!a&&this.vr()?this.fk():e(this.aq,1E3,this,[a]))},vr:function(){return"undefined"!=typeof document.getElementsByTagName&&"undefined"!=typeof document.getElementById&&(null!=document.getElementsByTagName("body")[0]||null!=document.body)}};n.fk=c(n,a.onloadDone,a.onloadInprogress,
h,"onloadEvent");n.ov=c(n,a.unloaded,a.unloading,k,"unloadEvent");n.Vu=c(n,a.preunloading,a.preunloading,l,"preUnloadEvent");b.isBrowserDocument()?n.Tu():n.Bi();n.addOnloadHandler=n.addOnloadHandler;n.addUnloadHandler=n.addUnloadHandler;n.addBeforeUnloadHandler=n.addBeforeUnloadHandler;n.removeOnloadHandler=n.removeOnloadHandler;n.removeUnloadHandler=n.removeUnloadHandler;n.removeBeforeUnloadHandler=n.removeBeforeUnloadHandler;n.isLoaded=n.isLoaded;n.isUnloaded=n.isUnloaded;n.isUnloading=n.isUnloading;
return n});
define("Promise",[],function(){return Promise});define("Global",["EnvironmentStatus","Environment","Promise"],function(d,f){var b={Nt:d,toString:function(){return"[Lightstreamer "+this.library+" client version "+this.version+" build "+this.build+"]"},qa:function(a,c,b,e){a=(e||"_")+a;this[a]||(this[a]={});this[a][c]=b;return"Lightstreamer."+a+"."+c},sj:function(a,c,b){a=(b||"_")+a;return this[a]&&this[a][c]},Vq:function(a,c,b){a=(b||"_")+a;return this[a]?this[a][c]:null},Ii:function(a,c,b){a=(b||"_")+a;if(this[a]&&this[a][c]){delete this[a][c];
for(var e in this[a])return;delete this[a]}},iv:function(a,c){var b=(c||"_")+a;this[b]&&delete this[b]},Ej:{},Iu:function(a,c){var b=this.Ej;b[a]||(b[a]=[]);b[a].push(c)},mA:function(a,c){var b=this.Ej[a];if(b){for(var e=0;e<b.length;e++)b[e]==c&&b.splice(e,1);0==b.length&&delete b[a]}},qx:function(a){return this.Ej[a]&&(a=this.Ej[a])&&0<a.length?a[0]:null}};f.isBrowserDocument()&&(window.OpenAjax&&OpenAjax.hub&&OpenAjax.hub.registerLibrary("Lightstreamer","http://www.lightstreamer.com/",b.version),
window.Lightstreamer=b);b.library="nodejs";b.version="7.3.2";b.build="1769.3";return b});define("Executor",["Helpers","EnvironmentStatus","Environment"],function(d,f,b){function a(){}function c(a,b){return a.time===b.time?a.yn-b.yn:a.time-b.time}function g(){x=!1;p()}function e(){if(n)clearInterval(n);else if(b.isBrowserDocument()&&"undefined"!=typeof postMessage){q=function(){window.postMessage("Lightstreamer.run",u)};var c=function(a){("Lightstreamer.run"==a.data&&"*"==u||a.origin==u)&&g()};d.addEvent(window,"message",c);x||(x=!0,q());0==x&&(d.removeEvent(window,"message",c),q=a)}else b.isNodeJS()&&
"undefined"!=typeof process&&process.nextTick&&(q=function(){process.nextTick(g)});n=setInterval(p,50)}function p(){if(f.gi)clearInterval(n);else{var a=l;l=d.getTimeStamp();l<a&&(l=a);if(0<h.length)for(k&&(h.sort(c),k=!1);0<h.length&&h[0].time<=l&&!f.gi;)a=h.shift(),a.mf&&(v.executeTask(a),a.step&&r.push(a));for(0>=h.length&&(t=0);0<r.length;)a=r.shift(),a.step&&(a.yn=t++,v.addPackedTimedTask(a,a.step,!0));l>=m&&(m=l+108E5,h=[].concat(h))}}var k=!1,h=[],l=d.getTimeStamp(),m=l+108E5,r=[],n=null,t=
0,u=!b.isBrowserDocument()||"http:"!=document.location.protocol&&"https:"!=document.location.protocol?"*":document.location.protocol+"//"+document.location.hostname+(document.location.port?":"+document.location.port:""),q=a,x=!1,v={toString:function(){return["[","Executor",50,h.length,"]"].join("|")},getQueueLength:function(){return h.length},packTask:function(a,b,c){return{mf:a,context:b||null,Yb:c||null,yn:t++}},addPackedTimedTask:function(a,b,c){a.step=c?b:null;a.time=l+parseInt(b);if(isNaN(a.time))try{throw Error();
}catch(e){throw a="Executor error for time: "+b,e.stack&&(a+=" "+e.stack),a;}h.push(a);k=!0},addRepetitiveTask:function(a,b,c,e){return this.addTimedTask(a,b,c,e,!0)},stopRepetitiveTask:function(a){a&&(a.mf=null,a.step=null)},addTimedTask:function(a,b,c,e,d){a=this.packTask(a,c,e);this.addPackedTimedTask(a,b,d);0!=b||x||(x=!0,q());return a},modifyTaskParam:function(a,b,c){a.Yb[b]=c},modifyAllTaskParams:function(a,b){a.Yb=b},delayTask:function(a,b){a.time+=b;k=!0},executeTask:function(a,b){try{var c=
b||a.Yb;a.context?c?a.mf.apply(a.context,c):a.mf.apply(a.context):c?a.mf.apply(null,c):a.mf()}catch(e){}}};b.isWebWorker()?setTimeout(e,1):e();v.getQueueLength=v.getQueueLength;v.packTask=v.packTask;v.addPackedTimedTask=v.addPackedTimedTask;v.addRepetitiveTask=v.addRepetitiveTask;v.stopRepetitiveTask=v.stopRepetitiveTask;v.addTimedTask=v.addTimedTask;v.modifyTaskParam=v.modifyTaskParam;v.modifyAllTaskParams=v.modifyAllTaskParams;v.delayTask=v.delayTask;v.executeTask=v.executeTask;return v});
define("LoggerProxy",["Helpers"],function(d){function f(a){this.co(a)}function b(){return!1}var a={error:b,warn:b,info:b,debug:b,fatal:b,isDebugEnabled:b,isInfoEnabled:b,isWarnEnabled:b,isErrorEnabled:b,isFatalEnabled:b};f.prototype={co:function(b){this.Ra=b||a},logFatal:function(a){this.ay()&&(a+=this.qe(arguments,1),this.fatal(a))},fatal:function(a,b){this.Ra.fatal(a,b)},ay:function(){return!this.Ra.isFatalEnabled||this.Ra.isFatalEnabled()},logError:function(a){this.ur()&&(a+=this.qe(arguments,
1),this.error(a))},logErrorExc:function(a,b){this.ur()&&(b+=this.qe(arguments,2),this.error(b,a))},error:function(a,b){this.Ra.error(a,b)},ur:function(){return!this.Ra.isErrorEnabled||this.Ra.isErrorEnabled()},logWarn:function(a){this.uy()&&(a+=this.qe(arguments,1),this.warn(a))},warn:function(a,b){this.Ra.warn(a,b)},uy:function(){return!this.Ra.isWarnEnabled||this.Ra.isWarnEnabled()},logInfo:function(a){this.isInfoLogEnabled()&&(a+=this.qe(arguments,1),this.info(a))},info:function(a,b){this.Ra.info(a,
b)},isInfoLogEnabled:function(){return!this.Ra.isInfoEnabled||this.Ra.isInfoEnabled()},logDebug:function(a){this.isDebugLogEnabled()&&(a+=this.qe(arguments,1),this.debug(a))},debug:function(a,b){this.Ra.debug(a,b)},isDebugLogEnabled:function(){return!this.Ra.isDebugEnabled||this.Ra.isDebugEnabled()},qe:function(a,b){for(var e=" {",f=b?b:0;f<a.length;f++)try{var k=a[f];null===k?e+="NULL":0>k.length?e+="*":null!=k.charAt?e+=k:k.message?(e+=k.message,k.stack&&(e+="\n"+k.stack+"\n")):k[0]==k?e+=k:d.isArray(k)?
(e+="(",e+=this.qe(k),e+=")"):e+=k;e+=" "}catch(h){e+="missing-parameter "}return e+"}"}};f.prototype.debug=f.prototype.debug;f.prototype.isDebugLogEnabled=f.prototype.isDebugLogEnabled;f.prototype.logDebug=f.prototype.logDebug;f.prototype.info=f.prototype.info;f.prototype.isInfoLogEnabled=f.prototype.isInfoLogEnabled;f.prototype.logInfo=f.prototype.logInfo;f.prototype.warn=f.prototype.warn;f.prototype.isWarnEnabled=f.prototype.isWarnEnabled;f.prototype.logWarn=f.prototype.logWarn;f.prototype.error=
f.prototype.error;f.prototype.isErrorEnabled=f.prototype.isErrorEnabled;f.prototype.logError=f.prototype.logError;f.prototype.logErrorExc=f.prototype.logErrorExc;f.prototype.fatal=f.prototype.fatal;f.prototype.isFatalEnabled=f.prototype.isFatalEnabled;f.prototype.logFatal=f.prototype.logFatal;return f});
define("IllegalArgumentException",[],function(){function d(d){this.name="IllegalArgumentException";this.message=d}d.prototype={toString:function(){return["[",this.name,this.message,"]"].join("|")}};return d});
define("LoggerManager",["LoggerProxy","IllegalArgumentException"],function(d,f){var b={},a=null,c={setLoggerProvider:function(c){if(c&&!c.getLogger)throw new f("The given object is not a LoggerProvider");a=c;for(var d in b)a?b[d].co(a.getLogger(d)):b[d].co(null)},getLoggerProxy:function(c){b[c]||(b[c]=a?new d(a.getLogger(c)):new d);return b[c]},resolve:function(a){return a}};c.setLoggerProvider=c.setLoggerProvider;c.getLoggerProxy=c.getLoggerProxy;c.resolve=c.resolve;return c});
define("lscAe",["Environment"],function(d){return{Se:1E3,Zo:200,du:1E4,Tt:1,ni:0,tC:2,Po:3,Yo:4,Oo:5,fc:"N",Pt:200,Xo:"MAIN",oi:"wbridge",li:"fbridge",au:1,$t:2,Rk:"1769.3",wg:!d.isBrowserDocument()||"http:"!=document.location.protocol&&"https:"!=document.location.protocol?"file:":document.location.protocol,eb:"lightstreamer.stream",Re:"lightstreamer.protocol",gc:"lightstreamer.session",$o:"lightstreamer.requests",bp:"lightstreamer.subscriptions",Xt:"lightstreamer.messages",Pk:"lightstreamer.actions",
Eb:"lightstreamer.sharing",sC:"lightstreamer.crosstab",Vo:"lightstreamer.flash",wC:"lightstreamer.stats",Yd:"Lightstreamer_",Vk:"lightstreamer",Fc:"UNORDERED_MESSAGES",Te:{length:-1,toString:function(){return"[UNCHANGED]"}},CONNECTING:"CONNECTING",Sa:"CONNECTED:",yg:"STREAM-SENSING",Cg:"WS-STREAMING",Xd:"HTTP-STREAMING",zg:"STALLED",Zd:"WS-POLLING",ec:"HTTP-POLLING",Db:"DISCONNECTED",Bg:"DISCONNECTED:WILL-RETRY",Ag:"DISCONNECTED:TRYING-RECOVERY",pi:"WS",Pe:"HTTP",Xk:"RAW",Tk:"DISTINCT",vg:"COMMAND",
Wk:"MERGE",mi:"MASTER"}});
define("lscAj",["Environment","lscAe","Helpers"],function(d,f,b){var a=RegExp("\\.","g"),c=RegExp("-","g"),g={wr:function(){return d.isBrowser()?!1===navigator.onLine:!1},Jp:function(){try{return"undefined"!=typeof localStorage&&null!==localStorage&&localStorage.getItem&&localStorage.setItem?(localStorage.setItem("__canUseLocalStorage_test__","true"),localStorage.removeItem("__canUseLocalStorage_test__"),!0):!1}catch(a){return!1}},sc:function(){try{return document.domain}catch(a){return""}},rj:function(){if(!d.isBrowserDocument())return!0;
try{return-1<document.location.host.indexOf("[")?!0:g.sc()==document.location.hostname}catch(a){return!1}},oc:function(a){if("undefined"!=typeof a){if(!0===a||!1===a)return!0===a;if(null!=a){if("number"==typeof a||a instanceof Number)return Number(a);if(b.isArray(a)){for(var c=[],g=0;g<a.length;g++)c[g]=this.oc(a[g]);return c}if("string"==typeof a||a instanceof String)return String(a);if(-1===a.length)return f.Te;if(isNaN(a)&&"number"==typeof a)return NaN;c={};for(g in a)c[this.oc(g)]=this.oc(a[g]);
return c}}return null},ra:function(a,c){a=a||{};if(c)for(var b in c)a[b]=c[b];return a},mk:function(e){return e.replace(a,"_").replace(c,"__")},getReverse:function(a){var c={},b;for(b in a)c[a[b]]=b;return c},Ai:function(a){if(a&&!a.pop){for(var c=[],b=0;b<a.length;b++)c.push(a[b]);return c}return a},Vz:function(a){if(!a)return[];for(var c={Jx:0,next:function(){return a.charAt(this.Jx++)}},b=/^\s*Expires/i,h=[],g=c.next();g;){for(var d="",r="";g&&";"!=g&&","!=g;)r+=g,g=c.next();r=r.trim();d+=r;";"==
g&&(d+="; ",g=c.next());for(;g&&","!=g;){for(r="";g&&";"!=g&&","!=g;)r+=g,g=c.next();if(r.match(b))for(console.assert(","==g),r+=g,g=c.next();g&&";"!=g&&","!=g;)r+=g,g=c.next();r=r.trim();d+=r;";"==g&&(d+="; ",g=c.next())}h.push(d);g=c.next()}return h}};return g});
define("Inheritance",["IllegalStateException"],function(d){function f(a,b,d){if(b)return d?b.apply(a,d):b.apply(a)}var b={Ut:function(a,c,g,e){for(var f in c.prototype)if(!a.prototype[f])a.prototype[f]=c.prototype[f];else if(e){var k;a:{k=c.prototype;var h=void 0;for(h in k)if(k[f]==k[h]&&f!=h){k=h;break a}k=null}if(k){if(a.prototype[k]&&a.prototype[k]!==a.prototype[f]&&c.prototype[k]!==c.prototype[k])throw new d("Can't solve alias collision, try to minify the classes again ("+k+", "+f+")");a.prototype[k]=
a.prototype[f]}}g||(a.prototype._super_=c,a.prototype._callSuperConstructor=b._callSuperConstructor,a.prototype._callSuperMethod=b._callSuperMethod);return a},_callSuperMethod:function(a,b,d){return f(this,a.prototype._super_.prototype[b],d)},_callSuperConstructor:function(a,b){f(this,a.prototype._super_,b)}};return b.Ut});
define("Setter",["IllegalArgumentException"],function(d){function f(){}f.prototype.checkPositiveNumber=function(b,a,c){var g=new Number(b);if(isNaN(g))throw new d("The given value is not valid. Use a number");if(!c&&g!=Math.round(g))throw new d("The given value is not valid. Use an integer");if(a){if(0>b)throw new d("The given value is not valid. Use a positive number or 0");}else if(0>=b)throw new d("The given value is not valid. Use a positive number");return g};f.prototype.checkBool=function(b,
a){if(!0===b||!1===b||a&&!b)return!0===b;throw new d("The given value is not valid. Use true or false");};return f});define("lscA",["LoggerManager","lscAj","Inheritance","Setter","lscAe"],function(d,f,b,a,c){function g(a){this.V="lscA";this.parent=null;this.Dp=!1;a&&this.vv(a)}d.getLoggerProxy(c.Pk);d.getLoggerProxy(c.Eb);g.prototype={oj:function(a){return this.sg[a]},Y:function(a,c){var b=this.oj(a),g=this[b];this[b]=f.oc(c);this.parent&&this.Dp&&this.$e(a);g!=this[b]&&this.Ur(a)},H:function(a,c){var b=this.oj(a);c!=this[b]&&(this[b]=c,this.$e(a),this.Ur(a))},lg:function(a,c){this.parent=a;this.Dp=c},$e:function(a){var c=
this.oj(a);return this.parent&&this.parent.$e&&!this.parent.$e(this.V,a,f.oc(this[c]))?!1:!0},Ur:function(a){var c=this.oj(a);!this.parent||!this.parent.Wr||this.Sr&&this.Sr[c]||this.parent.Wr(a,this)},vv:function(a){var c=this.sg,b;for(b in c)this.Y(b,a[c[b]])},rm:function(a){for(var c in this.sg)a(c,this[this.sg[c]])}};b(g,a,!1,!0);return g});
define("lscC",["lscA","Inheritance","lscAj"],function(d,f,b){function a(b){this.Rg=!1;this.td=0;this.Sr=c;this.sg=g;this._callSuperConstructor(a,arguments);this.V="lscC"}var c={},g={Rg:"connectionRequested",td:"clientsCount"},g=b.getReverse(g);a.prototype={};f(a,d);return a});
define("RetryDelayCounter",["LoggerManager","lscAe"],function(d,f){function b(a){this.Om(a)}var a=d.getLoggerProxy(f.gc);b.prototype={Rs:function(c){this.Om(c);a.isDebugLogEnabled()&&a.debug("Reset currentRetryDelay: "+this.Oc)},qr:function(){9<=this.Qn&&this.Oc<this.Hj&&(this.Oc*=2,this.Oc>this.Hj&&(this.Oc=this.Hj),a.isDebugLogEnabled()&&a.debug("Increase currentRetryDelay: "+this.Oc));this.Qn++},Om:function(a){this.Qy=this.Oc=a;this.Hj=Math.max(6E4,a);this.Qn=0}};return b});
define("ConnectTimeoutCounter",["LoggerManager","lscAe"],function(d,f){function b(a){this.Nm(a)}var a=d.getLoggerProxy(f.gc);b.prototype={Ps:function(c){this.Nm(c);a.isDebugLogEnabled()&&a.debug("Reset currentConnectTimeout: "+this.pc)},Lm:function(){9<=this.Sl&&this.pc<this.Gj&&(this.pc*=2,this.pc>this.Gj&&(this.pc=this.Gj),a.isDebugLogEnabled()&&a.debug("Increase currentConnectTimeout: "+this.pc));this.Sl++},Nm:function(a){this.Py=this.pc=a;this.Gj=Math.max(6E4,a);this.Sl=0}};return b});
define("lscE","IllegalArgumentException lscAe lscA Inheritance Global Environment lscAj RetryDelayCounter ConnectTimeoutCounter".split(" "),function(d,f,b,a,c,g,e,p,k){function h(){this.Vl=4E6;this.vj=19E3;this.Ce=this.Wb=this.Df=0;this.Id=3E3;this.Bk=2E3;this.gg=4E3;this.Om(this.gg);this.Nm(this.gg);this.cj=100;this.io=!1;this.fj=null;this.eq=this.Yn=!1;this.hg=0;this.em=!1;this.jo=5E3;this.oh=this.Ak=null;this.uj=!1;this.kg=15E3;this.Li=this.Jo=!0;this.dj=2E3;this.to=4E3;this.sg=
m;this._callSuperConstructor(h,arguments);this.V="lscE"}var l={};l[f.Xd]=!0;l[f.Zd]=!0;l[f.ec]=!0;l[f.Cg]=!0;l[f.pi]=!0;l[f.Pe]=!0;var m={Vl:"contentLength",vj:"idleTimeout",Df:"keepaliveInterval",Wb:"maxBandwidth",Ce:"pollingInterval",Id:"reconnectTimeout",Bk:"stalledTimeout",gg:"retryDelay",cj:"firstRetryMaxDelay",io:"slowingEnabled",fj:"forcedTransport",Yn:"serverInstanceAddressIgnored",eq:"cookieHandlingRequired",hg:"reverseHeartbeatInterval",em:"earlyWSOpenEnabled",kg:"sessionRecoveryTimeout",
jo:"spinFixTimeout",Ak:"spinFixEnabled",Jo:"xDomainStreamingEnabled",Li:"corsXHREnabled",dj:"forceBindTimeout",to:"switchCheckTimeout",oh:"httpExtraHeaders",uj:"httpExtraHeadersOnSessionCreationOnly",Oc:"currentRetryDelay",Qy:"minRetryDelay",Hj:"maxRetryDelay",Qn:"retryAttempt",pc:"currentConnectTimeout",Py:"minConnectTimeout",Gj:"maxConnectTimeout",Sl:"connectAttempt"},m=e.getReverse(m);h.prototype={NA:function(a){this.H("contentLength",this.checkPositiveNumber(a))},Dw:function(){return this.Vl},
mt:function(a){this.H("idleTimeout",this.checkPositiveNumber(a,!0))},Yq:function(){return this.vj},ot:function(a){this.H("keepaliveInterval",this.checkPositiveNumber(a,!0))},Zq:function(){return this.Df},$A:function(a){a="unlimited"==(new String(a)).toLowerCase()?0:this.checkPositiveNumber(a,!1,!0);this.H("maxBandwidth",a)},Uw:function(){return 0>=this.Wb?"unlimited":this.Wb},pt:function(a){this.H("pollingInterval",this.checkPositiveNumber(a,!0))},er:function(){return this.Ce},fB:function(a){this.H("reconnectTimeout",
this.checkPositiveNumber(a))},ex:function(){return this.Id},rB:function(a){this.H("stalledTimeout",this.checkPositiveNumber(a))},ux:function(){return this.Bk},LA:function(){},Aw:function(){return String(this.Fm())},QA:function(){},yd:function(){return this.pc},qt:function(a){a=this.checkPositiveNumber(a);this.H("retryDelay",a);this.Rs(a);this.Ps(a)},Fm:function(){return this.gg},TA:function(a){this.H("firstRetryMaxDelay",this.checkPositiveNumber(a))},Kw:function(){return this.cj},nB:function(a){this.H("slowingEnabled",
this.checkBool(a))},my:function(){return this.io},VA:function(a){if(null!==a&&!l[a])throw new d("The given value is not valid. Use one of: HTTP-STREAMING, HTTP-POLLING, WS-STREAMING, WS-POLLING, WS, HTTP or null");this.H("forcedTransport",a)},Pw:function(){return this.fj},jB:function(a){this.H("serverInstanceAddressIgnored",this.checkBool(a))},ly:function(){return this.Yn},OA:function(a){if(a&&!g.isBrowser()&&!g.isNodeJS())throw new d("cookieHandlingRequired is only supported on Browsers");this.H("cookieHandlingRequired",
this.checkBool(a))},Tb:function(){return this.eq},SA:function(a){this.H("earlyWSOpenEnabled",this.checkBool(a))},$x:function(){return this.em},rt:function(a){this.H("reverseHeartbeatInterval",this.checkPositiveNumber(a,!0))},gr:function(){return this.hg},WA:function(a){if(a){var c="",b;for(b in a)c+=b+"\n"+a[b]+"\n";this.H("httpExtraHeaders",c)}else this.H("httpExtraHeaders",null)},Xq:function(){if(!this.oh)return this.oh;for(var a={},c=this.oh.split("\n"),b=0;b<c.length-1;b+=2)a[c[b]]=c[b+1];return a},
XA:function(a){this.H("httpExtraHeadersOnSessionCreationOnly",this.checkBool(a))},cy:function(){return this.uj},mB:function(a){this.H("sessionRecoveryTimeout",this.checkPositiveNumber(a,!0))},px:function(){return this.kg},nh:function(a){return this.oh?a?!0:!this.uj:!1},bh:function(a){return!a&&this.uj?null:this.Xq()},vB:function(a){this.H("xDomainStreamingEnabled",this.checkBool(a))},vy:function(){return this.Jo},PA:function(a){this.H("corsXHREnabled",this.checkBool(a))},Yx:function(){return this.Li},
UA:function(a){this.H("forceBindTimeout",this.checkPositiveNumber(a))},Nw:function(){return this.dj},sB:function(a){this.H("switchCheckTimeout",this.checkPositiveNumber(a))},wx:function(){return this.to},qB:function(a){this.H("spinFixTimeout",this.checkPositiveNumber(a))},tx:function(){return this.jo},pB:function(a){this.H("spinFixTimeout",null===this.zC?null:this.checkBool(a))},sx:function(){return this.Ak}};h.prototype.setContentLength=h.prototype.NA;h.prototype.getContentLength=h.prototype.Dw;
h.prototype.setIdleTimeout=h.prototype.mt;h.prototype.getIdleTimeout=h.prototype.Yq;h.prototype.setKeepaliveInterval=h.prototype.ot;h.prototype.getKeepaliveInterval=h.prototype.Zq;h.prototype.setMaxBandwidth=h.prototype.$A;h.prototype.getMaxBandwidth=h.prototype.Uw;h.prototype.setPollingInterval=h.prototype.pt;h.prototype.getPollingInterval=h.prototype.er;h.prototype.setReconnectTimeout=h.prototype.fB;h.prototype.getReconnectTimeout=h.prototype.ex;h.prototype.setStalledTimeout=h.prototype.rB;h.prototype.getStalledTimeout=
h.prototype.ux;h.prototype.setConnectTimeout=h.prototype.LA;h.prototype.getConnectTimeout=h.prototype.Aw;h.prototype.setCurrentConnectTimeout=h.prototype.QA;h.prototype.getCurrentConnectTimeout=h.prototype.yd;h.prototype.setRetryDelay=h.prototype.qt;h.prototype.getRetryDelay=h.prototype.Fm;h.prototype.setFirstRetryMaxDelay=h.prototype.TA;h.prototype.getFirstRetryMaxDelay=h.prototype.Kw;h.prototype.setSlowingEnabled=h.prototype.nB;h.prototype.isSlowingEnabled=h.prototype.my;h.prototype.setForcedTransport=
h.prototype.VA;h.prototype.getForcedTransport=h.prototype.Pw;h.prototype.setServerInstanceAddressIgnored=h.prototype.jB;h.prototype.isServerInstanceAddressIgnored=h.prototype.ly;h.prototype.setCookieHandlingRequired=h.prototype.OA;h.prototype.isCookieHandlingRequired=h.prototype.Tb;h.prototype.setEarlyWSOpenEnabled=h.prototype.SA;h.prototype.isEarlyWSOpenEnabled=h.prototype.$x;h.prototype.setReverseHeartbeatInterval=h.prototype.rt;h.prototype.getReverseHeartbeatInterval=h.prototype.gr;h.prototype.setHttpExtraHeaders=
h.prototype.WA;h.prototype.getHttpExtraHeaders=h.prototype.Xq;h.prototype.setHttpExtraHeadersOnSessionCreationOnly=h.prototype.XA;h.prototype.isHttpExtraHeadersOnSessionCreationOnly=h.prototype.cy;h.prototype.setSessionRecoveryTimeout=h.prototype.mB;h.prototype.getSessionRecoveryTimeout=h.prototype.px;h.prototype.setXDomainStreamingEnabled=h.prototype.vB;h.prototype.isXDomainStreamingEnabled=h.prototype.vy;h.prototype.setCorsXHREnabled=h.prototype.PA;h.prototype.isCorsXHREnabled=h.prototype.Yx;h.prototype.setForceBindTimeout=
h.prototype.UA;h.prototype.getForceBindTimeout=h.prototype.Nw;h.prototype.setSwitchCheckTimeout=h.prototype.sB;h.prototype.getSwitchCheckTimeout=h.prototype.wx;h.prototype.setSpinFixTimeout=h.prototype.qB;h.prototype.getSpinFixTimeout=h.prototype.tx;h.prototype.setSpinFixEnabled=h.prototype.pB;h.prototype.getSpinFixEnabled=h.prototype.sx;h.prototype.setRetryTimeout=h.prototype.qt;h.prototype.getRetryTimeout=h.prototype.Fm;h.prototype.setIdleMillis=h.prototype.mt;h.prototype.getIdleMillis=h.prototype.Yq;
h.prototype.setKeepaliveMillis=h.prototype.ot;h.prototype.getKeepaliveMillis=h.prototype.Zq;h.prototype.setPollingMillis=h.prototype.pt;h.prototype.getPollingMillis=h.prototype.er;h.prototype.setReverseHeartbeatMillis=h.prototype.rt;h.prototype.getReverseHeartbeatMillis=h.prototype.gr;a(h,b);a(h,p,!0);a(h,k,!0);return h});
define("lscAf",[],function(){return{MC:function(){var d=3,f,b=6,a="",c;c="document".toString();var g=0;f=c.length;for(var e=0;e<f;e++)g+=c.charCodeAt(e);c=parseInt(g);if(0<c)for(g=0;184>=b+d-g;g+=3)f=g,f=parseInt("2844232422362353182342452312352492633183053182412392513042362492412532492362342352342462472452423042312312313182482393182292342362492382392362383182422532332342512492422422492342402770".substring(g,d-1))-parseInt("2844232422362353182342452312352492633183053182412392513042362492412532492362342352342462472452423042312312313182482393182292342362492382392362383182422532332342512492422422492342402770".substring(f,
f+2))+350-parseInt("2844232422362353182342452312352492633183053182412392513042362492412532492362342352342462472452423042312312313182482393182292342362492382392362383182422532332342512492422422492342402770".substring(b,b+d-g)),a=unescape("%"+f.toString(16))+a,d+=3,b+=3,c+=f;return a}}});
define("ASSERT",["LoggerManager"],function(d){var f=d.getLoggerProxy("weswit.test"),b=0,a={},c={VOID:a,getFailures:function(){return b},compareArrays:function(a,b,c){if(a.length!=b.length)return this.Lb(),f.logError(d.resolve(450),a,b),!1;if(c)for(k=0;k<a.length;k++){if(a[k]!=b[k])return f.logError(d.resolve(453),a[k],b[k]),this.Lb(),!1}else{c={};for(var k=0;k<a.length;k++)c[a[k]]=1;for(k=0;k<b.length;k++)if(c[b[k]])c[b[k]]++;else return f.logError(d.resolve(451),b[k]),this.Lb(),!1;for(k in c)if(1==
c[k])return f.logError(d.resolve(452),c[k]),this.Lb(),!1}return!0},verifySuccess:function(a,b,c,d,f){return this.verify(a,b,c,d,!1,f)},verifyException:function(a,b,c){return this.verify(a,b,c,null,!0)},verifyNotNull:function(a){return null===a?(this.Lb(),f.logError(d.resolve(454),a),!1):!0},verifyValue:function(a,b,c){var k=!1;!0===c?k=a===b:c?k=c(a,b):isNaN(a)?k=a==b:(c=a&&a.charAt?a.charAt(0):null,k=b&&b.charAt?b.charAt(0):null,k="."==c||" "==c||"0"==c||"."==k||" "==k||"0"==k?String(a)==String(b):
a==b);return k?!0:(this.Lb(),f.logError(d.resolve(455),a,b),!1)},verifyDiffValue:function(a,b,c){return(c?a===b:a==b)?(this.Lb(),f.logError(d.resolve(456),a,b),!1):!0},verifyOk:function(a){return a?!0:(this.Lb(),f.logError(d.resolve(457)),!1)},verifyNotOk:function(a){return a?(this.Lb(),f.logError(d.resolve(458)),!1):!0},fail:function(){f.logError(d.resolve(459));this.Lb();return!1},Lb:function(){b++},verify:function(b,c,p,k,h,l){var m=!1,r=null,n=null;try{r=p!==a?b[c].apply(b,p):b[c]()}catch(t){m=
!0,n=t}b=h?"succes":"failure";return h!=m?(this.Lb(),f.logError(d.resolve(460),b,"for",c,p,k,n),!1):h||k===a?!0:this.verifyValue(r,k,l)}};c.getFailures=c.getFailures;c.fail=c.fail;c.verifyNotOk=c.verifyNotOk;c.verifyOk=c.verifyOk;c.verifyDiffValue=c.verifyDiffValue;c.verifyNotNull=c.verifyNotNull;c.verifyValue=c.verifyValue;c.verifyException=c.verifyException;c.verifySuccess=c.verifySuccess;c.compareArrays=c.compareArrays;return c});
define("lscq","LoggerManager lscAj lscAf Environment ASSERT lscAe".split(" "),function(d,f,b,a,c,g){var e=d.getLoggerProxy(g.Re),p="LS_cid\x3dtqGko0tg4pkpW3CAN3O4hwLri8LBSG55l\x26",k=/^[a-z][a-z0-9-]+$/,h=/^((?:[a-z][a-z.0-9-]+).(?:[a-z][a-z-]+))(?![\w.])/,l=/^((?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(?![d])/,m=/^[a-f0-9:]+$/;return{iC:function(a){a=a.toLowerCase();var c=0==a.indexOf("http://")?7:0==a.indexOf("https://")?8:-1;if(-1==
c)return"The given server address has not a valid scheme";var b=a.lastIndexOf(":"),b=b>c?b:a.length,e=this.yq(a,a.indexOf("://"));if(null!=e&&isNaN(e.substring(1)))return"The given server address has not a valid port";e=a.indexOf("/",c);e=e<b?e:b;if("["==a.charAt(c)){if(a=a.substring(c+1,a.lastIndexOf("]")),!m.test(a))return"The given server address is not a valid IPv6"}else if(a=a.substring(c,e),-1<a.indexOf(".")){if(!h.test(a)&&!l.test(a))return"The given server address is not a valid URL"}else if(!k.test(a))return"The given server address is not a valid machine name";
return!0},yq:function(a,c){var b=a.indexOf(":",c+1);if(-1>=b)return null;if(-1<a.indexOf("]")){b=a.indexOf("]:");if(-1>=b)return null;b+=1}else if(b!=a.lastIndexOf(":"))return null;var e=a.indexOf("/",c+3);return-1<e?a.substring(b,e):a.substring(b)},pv:function(a,c){var b=this.yq(a,a.indexOf("://"));if(b){var e=c.indexOf("/");c=-1>=e?c+b:c.substring(0,e)+b+c.substring(e)}c=0==a.toLowerCase().indexOf("https://")?"https://"+c:"http://"+c;"/"!=c.substr(c.length-1)&&(c+="/");return c},cx:function(b,g,
h,k,l,x,m,A,C,w,H){H=H&&a.isBrowserDocument()&&!f.rj()?"LS_domain\x3d"+f.sc()+"\x26":"";b="LS_phase\x3d"+b+"\x26"+H+(A?"LS_cause\x3d"+A+"\x26":"");l||x?(b+="LS_polling\x3dtrue\x26",A=w=0,x&&(w=Number(h.Ce),null==C||isNaN(C)||(w+=C),A=h.vj),isNaN(w)||(b+="LS_polling_millis\x3d"+w+"\x26"),isNaN(A)||(b+="LS_idle_millis\x3d"+A+"\x26")):(0<h.Df&&(b+="LS_keepalive_millis\x3d"+h.Df+"\x26"),0<h.hg&&(b+="LS_inactivity_millis\x3d"+h.hg+"\x26"),w&&(b+="LS_content_length\x3d"+h.Vl+"\x26"));if(l)return g="",0<
h.Wb&&(g+="LS_requested_max_bandwidth\x3d"+h.Wb+"\x26"),null!=k.yi&&(g+="LS_adapter_set\x3d"+encodeURIComponent(k.yi)+"\x26"),null!=k.Kk&&(g+="LS_user\x3d"+encodeURIComponent(k.Kk)+"\x26"),h="LS_op2\x3dcreate\x26"+b+p+g,m&&(h+="LS_old_session\x3d"+m+"\x26"),e.logDebug(d.resolve(6),h),null!=k.password&&(h+="LS_password\x3d"+encodeURIComponent(k.password)+"\x26"),h;c.verifyOk(g)||e.logError(d.resolve(4));k="LS_session\x3d"+g+"\x26"+b;e.logDebug(d.resolve(5),k);return k},fx:function(c,b,g,h,k,l,p){l=
l&&a.isBrowserDocument()&&!f.rj()?"LS_domain\x3d"+f.sc()+"\x26":"";c="LS_phase\x3d"+c+"\x26"+l+(h?"LS_cause\x3d"+h+"\x26":"")+"LS_polling\x3dtrue\x26";h=0;null==k||isNaN(k)||(h+=k);c+="LS_polling_millis\x3d"+h+"\x26";c+="LS_idle_millis\x3d0\x26";0<g.Wb&&(c+="LS_requested_max_bandwidth\x3d"+g.Wb+"\x26");c+="LS_session\x3d"+b+"\x26";c+="LS_recovery_from\x3d"+p+"\x26";e.logDebug(d.resolve(7),c);return c},Hw:function(a,c){var b={LS_op:"destroy",LS_session:a};c&&(b.LS_cause=c);e.logDebug(d.resolve(8));
return b},Ow:function(a,c){var b={LS_op:"force_rebind"};a&&(b.LS_cause=a);null==c||isNaN(c)||(b.LS_polling_millis=c);e.logDebug(d.resolve(9));return b},Tw:function(a,c,b){c.LS_build=b;c.LS_phase=a;return c},Bw:function(a){return{LS_op:"constrain",LS_requested_max_bandwidth:0<a.Wb?a.Wb:0}},fr:function(a,c,b){a=c||".js"==b||""==b?(a?this.wm()+"create_session":"bind_session")+b:(a?this.wm():"")+"STREAMING_IN_PROGRESS";e.logDebug(d.resolve(10),a);return a},gx:function(a){return"bind_session"+a},wm:function(){return""},
UC:function(a){p=a}}});
define("lscD","IllegalArgumentException lscA Inheritance Environment Global lscq lscAj".split(" "),function(d,f,b,a,c,g,e){function p(){this.Ph=h;this.sessionId=this.gt=this.ft=this.password=this.Kk=this.yi=null;this.sg=k;this._callSuperConstructor(p,arguments);this.V="lscD"}var k={Ph:"serverAddress",yi:"adapterSet",Kk:"user",password:"password",ft:"serverInstanceAddress",gt:"serverSocketName",sessionId:"sessionId"},k=e.getReverse(k),h=!a.isBrowser()||"http:"!=
location.protocol&&"https:"!=location.protocol?null:location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")+"/";p.prototype={st:function(a){if(null===a)a=h;else{"/"!=a.substr(a.length-1)&&(a+="/");var c=g.iC(a);if(!0!==c)throw new d(c);}this.H("serverAddress",a)},hr:function(){return this.Ph},ht:function(a){this.H("adapterSet",a)},qw:function(){return this.yi},uB:function(a){this.H("user",a)},Bx:function(){return this.Kk},bB:function(a){this.H("password",a)},nx:function(){return this.ft},
ox:function(){return this.gt},Qb:function(){return this.sessionId}};p.prototype.setServerAddress=p.prototype.st;p.prototype.getServerAddress=p.prototype.hr;p.prototype.setAdapterSet=p.prototype.ht;p.prototype.getAdapterSet=p.prototype.qw;p.prototype.setUser=p.prototype.uB;p.prototype.getUser=p.prototype.Bx;p.prototype.setPassword=p.prototype.bB;p.prototype.getServerInstanceAddress=p.prototype.nx;p.prototype.getServerSocketName=p.prototype.ox;p.prototype.getSessionId=p.prototype.Qb;b(p,f);return p});
define("lscAi",[],function(){function d(d){this.An=[];this.bound=this.Ik=!1;this.value=null;this.aj=!1;var b=this;d(function(){return b.Ez.apply(b,arguments)},function(){return b.os.apply(b,arguments)})}d.resolve=function(f){return new d(function(b){b(f)})};d.reject=function(f){return new d(function(b,a){a(f)})};d.prototype={then:function(d,b){this.Ik?this.Ys(d,b):this.An.push({xz:d,vz:b});return this},Ez:function(d){if(this.Ik||this.bound)return null;if(d&&d.then&&d.constructor===this.constructor){this.bound=
!0;var b=this;d.then(function(a){b.Ao(a,!0);return b.value},function(a){b.os(a,!1)});return d}this.Ao(d,!0);return this},Ao:function(d,b){this.value=d;for(this.aj=!b;0<this.An.length;){var a=this.An.shift();this.Ys(a.xz,a.vz)}this.Ik=!0;this.bound=!1},os:function(d){if(this.Ik||this.bound)return null;this.Ao(d,!1);return this},Ys:function(d,b){try{this.aj?b&&b.apply(null,[this.value]):d.apply(null,[this.value])}catch(a){this.aj||(this.aj=!0,this.value=a)}}};return d});
define("lscY",["Promise","lscAj","lscAi"],function(d,f){return{Tg:function(b,a){return a.Ho?a.kl?function(){try{var a=this.target[b].apply(this.target,[this.ab].concat(f.Ai(arguments)));return d.resolve(a)}catch(g){return d.reject(g)}}:function(){try{var a=this.target[b].apply(this.target,arguments);return d.resolve(a)}catch(g){return d.reject(g)}}:a.kl?function(){try{this.target[b].apply(this.target,[this.ab].concat(f.Ai(arguments)))}catch(a){}}:function(){try{this.target[b].apply(this.target,
arguments)}catch(a){}}}}});define("lscP",[],function(){function d(d,b,a){this.Ho=d;this.kl=b;this.Us=a||!1}d.ut=new d(!1,!1);d.VC=new d(!0,!1);d.vt=new d(!0,!1,2E3);d.c=new d(!1,!0);d.FA=new d(!0,!0);d.TC=new d(!0,!0,4E3);return d});
define("lscAP",["lscY","lscP","LoggerManager","lscAe"],function(d,f,b,a){function c(a){this.client=a;this.zb=!1;this.ab=-1;this.Da=null;this.sq="local"}var g=f.ut,e=f.c;f={$r:g,Ep:e,Fp:e,xs:f.vt,Le:f.FA,Qd:e,md:e,fh:e,Hq:g,Vp:g};var p=b.getLoggerProxy(a.Eb);c.methods=f;c.prototype={eB:function(a){this.target=a},kt:function(a){p.logInfo(b.resolve(11)+this.sq+" engine created: "+a);this.Da=a},me:function(){return this.Da},G:function(){this.client=null},lB:function(a){this.ab=
a},xh:function(a,c,b){("lscD"==a?this.client.Fb:"lscE"==a?this.client.sb:this.client.ka).Y(c,b)},ye:function(a){this.zb&&this.pk(a)},pk:function(a){this.ab=a;this.zb=!1;this.client.pk()},dd:function(a){this.ab=a;this.zb=!0;this.client.EA()},Rf:function(a,c){p.logInfo(b.resolve(12)+this.Da+" is dead");this.client&&(this.pk(-1),this.client.Tv(a,c))},Cl:function(){var a=this;this.xs().then(function(){},function(){a.client&&a.Rf()})},cs:function(){this.Cl();Executor.addTimedTask(this.Cl,
1E3,this)},Tf:function(a,c){this.client.DA(a,c)},onStatusChange:function(a){this.client.ol(a)},onSubscription:function(a,c,b,e,g){this.client.u.OB(a,c,b,e,g)},Vf:function(a,c,b){this.client.u.Vv(a,c,b)},onUnsubscription:function(a){this.client.u.dC(a)},onEndOfSnapshot:function(a,c){this.client.u.ve(a,c)},yh:function(a,c){this.client.u.eC(a,c)},onLostUpdates:function(a,c,b){this.client.u.we(a,c,b)},onClearSnapshot:function(a,c){this.client.u.ue(a,c)},xe:function(a){this.client.J.Ky(a)},hs:function(a,
c,b){this.client.J.Jy(a,c,b)},Sf:function(a,c,b){this.client.J.Ly(a,c,b)},gs:function(a){this.client.J.Iy(a)},js:function(a){this.client.J.Ny(a)},ping:function(){if(null===this.client)throw"net";return!0},xc:function(){this.client.xc()}};for(var k in f)c.prototype[k]=d.Tg(k,f[k]);return c});
define("lscAH",["Environment","lscAj"],function(d,f){function b(a,c,b,e,d,k){this.cB(a);this.Ie(c);this.setData(b);this.uk(e);this.Rh(d);this.Th(k)}b.gu="GET";b.ri="POST";b.prototype={toString:function(){return["[",this.Gb,this.Dg,this.rb,this.Ve,"]"].join("|")},cB:function(a){for(;a&&"/"==a.substring(a.length-1);)a=a.substring(0,a.length-1);this.Gb=a},Ie:function(a){for(;a&&"/"==a.substring(0,1);)a=a.substring(1);this.Dg=a},uk:function(a){this.Ve=a||b.ri},Rh:function(a){this.cq=a||!1},Th:function(a){this.mm=
a||null},setData:function(a){this.rb=a},Xi:function(a){this.rb?this.sv(a)||(this.rb+=a):this.setData(a)},sv:function(a){return this.rb&&-1<this.rb.indexOf(a)},getFile:function(){return this.Dg},Ad:function(){return this.Dg?this.Gb+"/"+this.Dg:this.Gb},getData:function(){return this.rb},Ax:function(){return this.rb?this.Ad()+"?"+this.rb:this.Ad()},clone:function(){return new b(this.Gb,this.Dg,this.rb,this.Ve,this.cq,this.mm)},zr:function(){return!(0==this.Gb.indexOf("http://")||0==this.Gb.indexOf("https://")||
0==this.Gb.indexOf("file:///"))},ky:function(a,c){if(!d.isBrowser())return!1;if(this.zr())return d.isWebWorker()?location.hostname==a:f.sc()==a;if(c){if(!this.Br(c))return!1;if("file:"==c)return""==a}a=a.replace(".",".");return(new RegExp("^https?://(?:[a-z][a-z0-9-]+.)*"+a+"(?:/|$|:)","i")).test(this.Gb)},Br:function(a){return d.isBrowser()&&a.indexOf(":")==a.length-1?this.zr()?location.protocol==a:0==this.Gb.indexOf(a):!1},ua:function(){if(!d.isBrowser())return!0;var a=d.isWebWorker()?location.hostname:
f.sc();return!this.ky(a,location.protocol)},ta:function(){return d.isBrowser()?!this.Br(location.protocol):!0}};b.Cu=new b("about:blank");return b});
define("lscG",[],function(){function d(d,b,a,c,g){this.request=d;this.hA=b;this.Gs=c;this.Gg=a;this.Fe=g}d.hi=1;d.Yk=2;d.Sk=3;d.od=4;d.nd=5;d.Vd=6;d.Uk=7;d.Wd=8;d.Qo=9;d.prototype={toString:function(){return["[|ControlRequest",this.Gs,this.Gg,this.Fe,this.request,"]"].join("|")},jj:function(){return this.hA},getKey:function(){return this.Gs}};return d});
define("lscc",["lscAH","lscG","lscAj"],function(d,f){function b(){}b.prototype={toString:function(){return"[Encoder]"},Ox:function(a,c,b){var e=new d;a=a.nf();e.Ie((a==f.od?"msg":a==f.nd?"send_log":a==f.Wd?"heartbeat":"control")+this.qf());e.uk(d.ri);e.Rh(c);e.Th(b);return e},encode:function(a,c,b){for(b=b?"":"\r\n";0<a.getLength();){var e=a.eh(),d=e.jj(),k=e.Gg;if(d&&d.verifySuccess())d.vh(),a.shift();else return a=e.request,k==f.od?b+this.jm(a,d,c):k==f.Vd?b+this.Ri(a,d,c):k==f.Wd?
b+this.hm(a,d,c):k==f.nd?b+this.im(a,d,c):b+this.gm(a,d,c)}return null},expand:function(a,c){var b="";if(a)for(var e in a)e!==c&&(b+=e+"\x3d"+a[e]+"\x26");return b},gf:function(a,c){var b=this.expand(a);return b+=this.expand(c)},Si:function(a,c,b){var e=this.expand(a,b),e=e+this.expand(c,b);a[b]?e+=b+"\x3d"+a[b]:c&&(e+=b+"\x3d"+c[b]);return"LS_unq\x3d"+e.length+"\x26"+e},Io:function(a){return a},qf:function(){return".js"},ym:function(){return 0},Bm:function(){return 2},gm:function(a,b,g,e){return this.gf(a,
e,g)},Ri:function(a,b,g,e){return this.gf(a,e,g)},hm:function(a,b,g,e){return this.gf(a,e,g)},im:function(a,b,g,e){return this.gf(a,e,g)},jm:function(a,b,g,e){return this.Si(a,e,"LS_message",g)}};return b});
define("lscd",["lscc","Inheritance","lscAj"],function(d,f,b){function a(){}var c=1,g={jm:"encodeMessageRequest",gm:"encodeControlRequest",Ri:"encodeDestroyRequest",hm:"encodeHeartbeatRequest",im:"encodeLogRequest"},g=b.getReverse(g);a.prototype={jm:function(c,d,k,h){h=b.ra(h,{LS_session:k});return this._callSuperMethod(a,g.encodeMessageRequest,[c,d,k,h])},gm:function(e,d,k,h){h=b.ra(h,{LS_session:k});h=b.ra(h,{LS_unique:c++});return this._callSuperMethod(a,g.encodeControlRequest,[e,d,k,
h])},Ri:function(e,d,k,h){h=b.ra(h,{LS_unique:c++});return this._callSuperMethod(a,g.encodeDestroyRequest,[e,d,k,h])},hm:function(e,d,k,h){k&&(h=b.ra(h,{LS_session:k}));h=b.ra(h,{LS_unique:c++});return this._callSuperMethod(a,g.encodeHeartbeatRequest,[e,d,k,h])},im:function(e,d,k,h){k&&(h=b.ra(h,{LS_session:k}));h=b.ra(h,{LS_unique:c++});return this._callSuperMethod(a,g.encodeLogRequest,[e,d,k,h])},expand:function(a,b){var c="";if(a)for(var g in a)c=g!==b?c+(g+"\x3d"+a[g]+"\x26"):c+(g+"\x3d"+encodeURIComponent(a[g])+
"\x26");return c},Si:function(a,b,c){a=this.expand(a,c);return a+=this.expand(b,c)}};f(a,d);return a});define("req",["Environment"],function(d){var f=d.isNodeJS()?require:null;return function(b){return f(b)}});
define("lscAI",["lscd","lscAj","req"],function(d,f,b){function a(){for(var b in{pa:!0})this.ti=b;this.V=a}function c(){return!1}function g(){return!0}var e=new d;a.Ro="LS_container\x3dlsc\x26";a.jc=function(a,b){for(var e in b)a[e]=!0===b[e]?g:!1===b[e]?c:b[e]};a.jc(a,{sa:!1,ua:!1,ta:!1,hc:!1,ic:!1,Af:!1,lc:!1});a.prototype={ea:function(){},qk:function(b,c,e,g,d,f){this.V.ic()?b.Xi("LS_eng\x3d"+f+"\x26"):b.Xi(a.Ro);return this.pa(b,c,e,g,d)},pa:function(){return!1},zd:function(){return e}};
a.Wq=function(a){var c=[],e=b("xmlhttprequest-cookie");if(e)if(null==a)e.CookieJar.save().split("\r\n").forEach(function(a){""!=a&&c.push(a)});else{a=b("url").parse(a);for(var e=e.CookieJar.findFuzzy(a.hostname,a.pathname),g=0;g<e.length;g++)e[g].secure&&"https:"!==a.protocol||e[g].httponly&&null===a.protocol.match(/^https?:$/i)||c.push(e[g])}return c};a.rp=function(a){var c=b("xmlhttprequest-cookie");if(c){var e="";a.forEach(function(a){e+="\r\n"+a});0<e.length&&(a=c.CookieJar.save(),c.CookieJar.load(a+
e))}};return a});
define("Assertions",["ASSERT","LoggerManager"],function(d,f){var b=f.getLoggerProxy("assertions");return{assert:function(a,b){a||this.fail(b)},DC:function(a,b,g){a!==b&&this.fail(g+": Expected "+a+" but found "+b)},OC:function(a,b,g){this.assert(!a||b,g)},fail:function(a){d.fail();null!=a&&b.logError(a)},verifyOk:function(a,c){d.verifyOk(a)||null!=c&&b.logError(c)},verifyNotOk:function(a,c){d.verifyNotOk(a)||null!=c&&b.logError(c)},verifyValue:function(a,c,g){d.verifyValue(a,c,null)||null!=g&&b.logError(g)},
verifyDiffValue:function(a,c,g){d.verifyDiffValue(a,c,null)||null!=g&&b.logError(g)}}});
define("lscAO",["Executor","List","Assertions"],function(d,f,b){function a(a){this.Ff=-1;this.Dh={};this.$j={};this.Eh={};this.Zj=0;this.S=a;this.Hh=new f}a.prototype={ai:function(a){this.S=a},Ww:function(a,b){this.Ff++;this.Dh[this.Ff]=b;this.$j[this.Ff]=a;this.Eh[this.Ff]=!1;this.Zj++;return this.Ff},vb:function(a){return this.Dh[a]},kh:function(a){return this.$j[a]},lC:function(a){return this.Eh[a]},jv:function(){this.lv();var a=[],g;for(g in this.Dh)a.push(g);a.sort(function(a,b){return a-
b});for(g=0;g<a.length;g++)this.Hy(a[g]);b.verifyValue(this.Zj,0,"Unexpected pending messages");this.Ff=-1;this.Dh={};this.$j={};this.Eh={};this.Zj=0},clean:function(a){delete this.Dh[a];delete this.$j[a];delete this.Eh[a];this.Zj--},Ny:function(a){this.vb(a)&&(this.Eh[a]=!0)},Uv:function(a,b,e,d){this.Hh.add({Mr:a,nk:b,listener:e,timeout:d})},lv:function(){var a=this;this.Hh.forEach(function(b){a.fireEvent("onAbort",b.listener,[b.Mr,!1])});this.Hh.clean()},Fx:function(){var a=this;this.Hh.forEach(function(b){a.fh(b.Mr,
b.nk,b.listener,b.timeout)});this.Hh.clean()},fh:function(a,b,e,d){var k=null;e&&(k=this.Ww(a,e));this.S.fh(a,b,k,d)},fireEvent:function(a,b,e){b&&b[a]&&d.addTimedTask(b[a],0,b,e)},Iy:function(a){this.fireEvent("onProcessed",this.vb(a),[this.kh(a)]);this.clean(a)},Ly:function(a){this.fireEvent("onError",this.vb(a),[this.kh(a)]);this.clean(a)},Jy:function(a,b,e){this.fireEvent("onDeny",this.vb(a),[this.kh(a),b,e]);this.clean(a)},Ky:function(a){this.fireEvent("onDiscarded",this.vb(a),[this.kh(a)]);
this.clean(a)},Hy:function(a){this.fireEvent("onAbort",this.vb(a),[this.kh(a),this.lC(a)]);this.clean(a)}};return a});define("lscAd",["lscAe"],function(d){return function(f,b){var a=b?f:[];a.Mc=[];b||(a[0]=parseInt(f[0]),a[1]=parseInt(f[1]));for(var c=2,g=f.length;c<g;c++)f[c]?-1==f[c].length?a[c]=d.Te:(b||(a[c]=f[c].toString()),a.Mc.push(c-1)):(b||(a[c]=""===f[c]?"":null),a.Mc.push(c-1));return a}});
define("lscAc",["Executor","LoggerManager","Assertions","lscAe","lscAd"],function(d,f,b,a,c){function g(a){this.Vy=0;this.pb={};this.Me={};this.pw=1;this.lb={};this.Ac={};this.hb=null;this.b=a;this.a=0}var e=f.getLoggerProxy(a.bp);g.prototype={toString:function(){return"[SubscriptionsHandler]"},ai:function(a){this.hb=a},qp:function(a){var b=++this.Vy;e.logInfo(f.resolve(13),a);a.iz(b,++this.pw,this);this.pb[b]=a;this.ts(a)},Is:function(a){if(this.hb&&this.hb.zb){var b=a.kd;
(a.Cr()||a.zf())&&b&&(this.hb.Qd(b),delete this.Me[b])}e.logInfo(f.resolve(14),a);b=a.pd;a.Dz();delete this.pb[b];return a},md:function(a,c){if(this.hb&&this.hb.zb&&a.Cd()){b.verifyOk(a.Cd(),"Inactive subscription");var g=a.pd;if(this.lb[g]){e.logDebug(f.resolve(15),a);var d=this;this.Ti(g,function(b){e.logDebug(f.resolve(16),a);d.hb.md(b,c)})}else e.logDebug(f.resolve(17),a),this.hb.md(a.kd,c)}},ts:function(a){if(this.hb&&this.hb.zb&&a.gy()){var c=a.pd;e.logDebug(f.resolve(18));var g=this.hb.Le(a.ix());
this.lb[c]?e.logDebug(f.resolve(19)+c):(b.verifyNotOk(this.lb[c],"Promise unexpected (1)"),b.verifyNotOk(this.Ac[c],"Promise unexpected (2)"));this.lb[c]=g;this.Ac[c]=0;a.Kz();e.logDebug(f.resolve(20),a);var d=this;this.Ti(c,function(b){e.logDebug(f.resolve(21),a);d.pb[c]?(a.Nz(b),d.Me[b]=c):d.hb&&d.hb.Qd(b)}