UNPKG

webappengine

Version:

A web application platform that can host multiple web apps running with Node.js.

3 lines 14.3 kB
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/ (function(a){function b(){try{return z.apply(this,arguments)}catch(a){return C.e=a,C}}function c(a){if(!isFunction(a))throw new TypeError("fn must be a function");return z=a,b}function d(a){throw a}function e(a,b){if(D&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(H)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+H+"\n");a.stack=f(e)}}function f(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var f=b[d];g(f)||h(f)||!f||c.push(f)}return c.join("\n")}function g(a){var b=j(a);if(!b)return!1;var c=b[0],d=b[1];return c===F&&d>=G&&ga>=d}function h(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function i(){if(D)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=j(c);if(!d)return;return F=d[0],d[1]}}function j(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}var k={"function":!0,object:!0},l=k[typeof exports]&&exports&&!exports.nodeType&&exports,m=k[typeof self]&&self.Object&&self,n=k[typeof window]&&window&&window.Object&&window,o=k[typeof module]&&module&&!module.nodeType&&module,p=o&&o.exports===l&&l,q=l&&o&&"object"==typeof global&&global&&global.Object&&global,r=r=q||n!==(this&&this.window)&&n||m||this,s={internals:{},config:{Promise:r.Promise},helpers:{}},t=s.helpers.noop=function(){},u=s.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}(),v=s.helpers.defaultError=function(a){throw a},w=(s.helpers.isPromise=function(a){return!!a&&!isFunction(a.subscribe)&&isFunction(a.then)},s.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0});isFunction=s.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==toString.call(a)}),a}();var x=s.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};x.prototype=Error.prototype;var y=s.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};y.prototype=Error.prototype;var z,A=s.helpers.notImplemented=function(){throw new x},B=s.helpers.notSupported=function(){throw new y},C={e:{}};s.config.longStackSupport=!1;var D=!1,E=c(function(){throw new Error})();D=!!E.e&&!!E.e.stack;var F,G=i(),H="From previous event:",I=({}.hasOwnProperty,Array.prototype.slice,this.inherits=s.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),J=(s.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},s.internals.addRef=function(a,b){return new ea(function(c){return new J(b.getDisposable(),a.subscribe(c))})},s.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!O(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length}),K=J.prototype;K.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},K.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},K.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var L=s.Disposable=function(a){this.isDisposed=!1,this.action=a||t};L.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var M=L.create=function(a){return new L(a)},N=L.empty={dispose:t},O=L.isDisposable=function(a){return a&&isFunction(a.dispose)},P=(L.checkDisposed=function(a){if(a.isDisposed)throw new ObjectDisposedError},s.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null});P.prototype.getDisposable=function(){return this.current},P.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},P.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var Q=s.SerialDisposable=function(){this.isDisposed=!1,this.current=null};Q.prototype.getDisposable=function(){return this.current},Q.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},Q.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var R=s.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||w,this.disposable=new P};R.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},R.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},R.prototype.isCancelled=function(){return this.disposable.isDisposed},R.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var S=s.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),N}a.isScheduler=function(b){return b instanceof a};var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=u,a.normalize=function(a){return 0>a&&(a=0),a},a}(),T=S.normalize;S.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),N}var g=!1,h=!1,i=a.scheduleWithState(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new J;return e(d,c),f}function c(a,b,c){function d(b,e){function h(a,b){return i?g.remove(k):j=!0,f(b,d),N}var i=!1,j=!1,k=a[c](b,e,h);j||(g.add(k),i=!0)}var e=b[0],f=b[1],g=new J;return f(e,d),g}function d(a,b){return c(a,b,"scheduleWithRelativeAndState")}function e(a,b){return c(a,b,"scheduleWithAbsoluteAndState")}function f(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,f)},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,f)},a.scheduleRecursiveWithRelativeAndState=function(a,b,c){return this._scheduleRelative([a,c],b,d)},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,f)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute([a,c],b,e)}}(S.prototype),function(a){S.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},S.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof r.setInterval)throw new y;b=T(b);var d=a,e=r.setInterval(function(){d=c(d)},b);return M(function(){r.clearInterval(e)})}}(S.prototype);var U,V,W=(s.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new P;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),S.immediate=function(){function a(a,b){return b(this,a)}return new S(u,a,B,B)}(),S.currentThread=function(){function a(){for(;e.length>0;){var a=e.shift();!a.isCancelled()&&a.invoke()}}function b(b,f){var g=new R(this,b,f,this.now());if(e)e.push(g);else{e=[g];var h=c(a)();if(e=null,h===C)return d(h.e)}return g.disposable}var e,f=new S(u,b,B,B);return f.scheduleRequired=function(){return!e},f}()),X=function(){var a,b=t;if(r.setTimeout)a=r.setTimeout,b=r.clearTimeout;else{if(!r.WScript)throw new y;a=function(a,b){r.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),Y=X.setTimeout,Z=X.clearTimeout;!function(){function a(b){if(h)Y(function(){a(b)},0);else{var e=g[b];if(e){h=!0;var f=c(e)();if(V(b),h=!1,f===C)return d(f.e)}}}function b(){if(!r.postMessage||r.importScripts)return!1;var a=!1,b=r.onmessage;return r.onmessage=function(){a=!0},r.postMessage("","*"),r.onmessage=b,a}function e(b){"string"==typeof b.data&&b.data.substring(0,k.length)===k&&a(b.data.substring(k.length))}var f=1,g={},h=!1;V=function(a){delete g[a]};var i=RegExp("^"+String(toString).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),j="function"==typeof(j=q&&p&&q.setImmediate)&&!i.test(j)&&j;if(isFunction(j))U=function(b){var c=f++;return g[c]=b,j(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))U=function(b){var c=f++;return g[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var k="ms.rx.schedule"+Math.random();r.addEventListener?r.addEventListener("message",e,!1):r.attachEvent?r.attachEvent("onmessage",e):r.onmessage=e,U=function(a){var b=f++;return g[b]=a,r.postMessage(k+currentId,"*"),b}}else if(r.MessageChannel){var l=new r.MessageChannel;l.port1.onmessage=function(b){a(b.data)},U=function(a){var b=f++;return g[b]=a,l.port2.postMessage(b),b}}else U="document"in r&&"onreadystatechange"in r.document.createElement("script")?function(b){var c=r.document.createElement("script"),d=f++;return g[d]=b,c.onreadystatechange=function(){a(d),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},r.document.documentElement.appendChild(c),d}:function(b){var c=f++;return g[c]=b,Y(function(){a(c)},0),c}}();var $,_=(S.timeout=S["default"]=function(){function a(a,b){var c=this,d=new P,e=U(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new J(d,M(function(){V(e)}))}function b(a,b,c){var d=this,e=S.normalize(b),f=new P;if(0===e)return d.scheduleWithState(a,c);var g=Y(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new J(f,M(function(){Z(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new S(u,a,b,c)}(),s.Observer=function(){}),aa=_.create=function(a,b,c){return a||(a=t),b||(b=v),c||(c=t),new ca(a,b,c)},ba=s.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return I(b,a),b.prototype.next=A,b.prototype.error=A,b.prototype.completed=A,b.prototype.onNext=function(a){!this.isStopped&&this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(_),ca=s.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return I(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(ba),da=s.Observable=function(){function a(a,b){return function(c){var d=c.onError;return c.onError=function(b){e(b,a),d.call(c,b)},b.call(a,c)}}function b(b){if(s.config.longStackSupport&&D){var e=c(d)(new Error).e;this.stack=e.stack.substring(e.stack.indexOf("\n")+1),this._subscribe=a(this,b)}else this._subscribe=b}return $=b.prototype,b.isObservable=function(a){return a&&isFunction(a.subscribe)},$.subscribe=$.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:aa(a,b,c))},$.subscribeOnNext=function(a,b){return this._subscribe(aa("undefined"!=typeof b?function(c){a.call(b,c)}:a))},$.subscribeOnError=function(a,b){return this._subscribe(aa(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},$.subscribeOnCompleted=function(a,b){return this._subscribe(aa(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),ea=s.AnonymousObservable=function(a){function b(a){return a&&isFunction(a.dispose)?a:isFunction(a)?M(a):N}function e(a,e){var f=e[0],g=e[1],h=c(g.__subscribe).call(g,f);return h!==C||f.fail(C.e)?void f.setDisposable(b(h)):d(C.e)}function f(a){var b=new fa(a),c=[b,this];return W.scheduleRequired()?W.scheduleWithState(c,e):e(null,c),b}function g(b,c){this.source=c,this.__subscribe=b,a.call(this,f)}return I(g,a),g}(da),fa=(s.ObservableBase=function(a){function b(a){return a&&isFunction(a.dispose)?a:isFunction(a)?M(a):N}function e(a,e){var f=e[0],g=e[1],h=c(g.subscribeCore).call(g,f);return h!==C||f.fail(C.e)?void f.setDisposable(b(h)):d(C.e)}function f(a){var b=new fa(a),c=[b,this];return W.scheduleRequired()?W.scheduleWithState(c,e):e(null,c),b}function g(){a.call(this,f)}return I(g,a),g.prototype.subscribeCore=A,g}(da),function(a){function b(b){a.call(this),this.observer=b,this.m=new P}I(b,a);var e=b.prototype;return e.next=function(a){var b=c(this.observer.onNext).call(this.observer,a);b===C&&(this.dispose(),d(b.e))},e.error=function(a){var b=c(this.observer.onError).call(this.observer,a);this.dispose(),b===C&&d(b.e)},e.completed=function(){var a=c(this.observer.onCompleted).call(this.observer);this.dispose(),a===C&&d(a.e)},e.setDisposable=function(a){this.m.setDisposable(a)},e.getDisposable=function(){return this.m.getDisposable()},e.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(ba));da.create=function(a,b){return new ea(a,b)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?(r.Rx=s,define(function(){return s})):l&&o?p?(o.exports=s).Rx=s:l.Rx=s:r.Rx=s;var ga=i()}).call(this); //# sourceMappingURL=rx.core.map