Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zone.js

Package Overview
Dependencies
Maintainers
3
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zone.js - npm Package Compare versions

Comparing version 0.8.19 to 0.8.20

dist/zone-patch-user-media.js

12

dist/fake-async-test.js

@@ -164,3 +164,3 @@ /**

this.name = 'fakeAsyncTestZone for ' + namePrefix;
// in case user can't access the construction of FakyAsyncTestSpec
// in case user can't access the construction of FakeAsyncTestSpec
// user can also define macroTaskOptions by define a global variable.

@@ -307,7 +307,7 @@ if (!this.macroTaskOptions) {

// arguments
var addtionalArgs = void 0;
var additionalArgs = void 0;
if (args) {
var callbackIndex = task.data.callbackIndex;
var callbackIndex = task.data.cbIdx;
if (typeof args.length === 'number' && args.length > callbackIndex + 1) {
addtionalArgs = Array.prototype.slice.call(args, callbackIndex + 1);
additionalArgs = Array.prototype.slice.call(args, callbackIndex + 1);
}

@@ -317,3 +317,3 @@ }

func: task.invoke,
args: addtionalArgs,
args: additionalArgs,
target: task.data && task.data.target

@@ -356,3 +356,3 @@ });

else {
// not periodic, use setTimout to simulate
// not periodic, use setTimeout to simulate
task.data['handleId'] = this._setTimeout(task.invoke, delay, callbackArgs);

@@ -359,0 +359,0 @@ }

@@ -25,5 +25,5 @@ /**

}
api.patchEventTarget(global, [global['MediaQueryList'].prototype], { addEventListenerFnName: 'addListener', removeEventListenerFnName: 'removeListener' });
api.patchEventTarget(global, [global['MediaQueryList'].prototype], { add: 'addListener', rm: 'removeListener' });
});
})));

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";Zone.__load_patch("mediaQuery",function(e,t,n){e.MediaQueryList&&n.patchEventTarget(e,[e.MediaQueryList.prototype],{addEventListenerFnName:"addListener",removeEventListenerFnName:"removeListener"})})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";Zone.__load_patch("mediaQuery",function(e,t,i){e.MediaQueryList&&i.patchEventTarget(e,[e.MediaQueryList.prototype],{add:"addListener",rm:"removeListener"})})});

@@ -31,8 +31,8 @@ /**

// RTCPeerConnection extends EventTarget, so we must clear the symbol
// to allow pathc RTCPeerConnection.prototype.addEventListener again
// to allow patch RTCPeerConnection.prototype.addEventListener again
RTCPeerConnection.prototype[addSymbol] = null;
RTCPeerConnection.prototype[removeSymbol] = null;
api.patchEventTarget(global, [RTCPeerConnection.prototype], { useGlobalCallback: false });
api.patchEventTarget(global, [RTCPeerConnection.prototype], { useG: false });
});
})));

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";Zone.__load_patch("RTCPeerConnection",function(e,t,o){var n=e.RTCPeerConnection;if(n){var p=o.symbol("addEventListener"),r=o.symbol("removeEventListener");n.prototype.addEventListener=n.prototype[p],n.prototype.removeEventListener=n.prototype[r],n.prototype[p]=null,n.prototype[r]=null,o.patchEventTarget(e,[n.prototype],{useGlobalCallback:!1})}})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";Zone.__load_patch("RTCPeerConnection",function(e,t,o){var n=e.RTCPeerConnection;if(n){var p=o.symbol("addEventListener"),r=o.symbol("removeEventListener");n.prototype.addEventListener=n.prototype[p],n.prototype.removeEventListener=n.prototype[r],n.prototype[p]=null,n.prototype[r]=null,o.patchEventTarget(e,[n.prototype],{useG:!1})}})});

@@ -51,3 +51,3 @@ /**

* If the current zone does not have a key, the request is delegated to the parent zone. Use
* [ZoneSpec.properties] to configure the set of properties asseciated with the current zone.
* [ZoneSpec.properties] to configure the set of properties associated with the current zone.
*

@@ -210,8 +210,8 @@ * @param {!string} key The key to retrieve.

* Allows interception of the callback invocation.
*
*
* @type {
* undefined|?function(ZoneDelegate, Zone, Zone, Function, Object, Array, string): *
* undefined|?function(ZoneDelegate, Zone, Zone, Function, Object, Array, string): *
* }
*/
ZoneSpec.prototype.onInvoke;
ZoneSpec.prototype.onInvoke;

@@ -222,3 +222,3 @@ /**

* @type {
* undefined|?function(ZoneDelegate, Zone, Zone, Object): boolean
* undefined|?function(ZoneDelegate, Zone, Zone, Object): boolean
* }

@@ -232,3 +232,3 @@ */

* @type {
* undefined|?function(ZoneDelegate, Zone, Zone, Task): Task
* undefined|?function(ZoneDelegate, Zone, Zone, Task): Task
* }

@@ -245,3 +245,3 @@ */

*/
ZoneSpec.prototype.onInvokeTask;
ZoneSpec.prototype.onInvokeTask;

@@ -252,6 +252,6 @@ /**

* @type {
* undefined|?function(ZoneDelegate, Zone, Zone, Task): *
* undefined|?function(ZoneDelegate, Zone, Zone, Task): *
* }
*/
ZoneSpec.prototype.onCancelTask;
ZoneSpec.prototype.onCancelTask;
/**

@@ -284,3 +284,3 @@ * Notifies of changes to the task queue empty status.

* @param {string=} source the argument passed into the `wrap` method.
* @returns {!Function}
* @returns {!Function}
*/

@@ -326,3 +326,3 @@ ZoneDelegate.prototype.intercept = function(targetZone, callback, source) {};

* @param {!Zone} targetZone The [Zone] which originally received the request.
* @param {!HasTaskState} hasTaskState
* @param {!HasTaskState} hasTaskState
*/

@@ -450,2 +450,2 @@ ZoneDelegate.prototype.hasTask = function(targetZone, hasTaskState) {};

*/
Error.prototype.originalStack;
Error.prototype.originalStack;

@@ -21,3 +21,3 @@ /**

*/
Zone.__load_patch('bluebird', function (global, Zone, api) {
Zone.__load_patch('bluebird', function (global, Zone) {
// TODO: @JiaLiPassion, we can automatically patch bluebird

@@ -24,0 +24,0 @@ // if global.Promise = Bluebird, but sometimes in nodejs,

@@ -1,1 +0,1 @@

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n():"function"==typeof define&&define.amd?define(n):n()}(this,function(){"use strict";Zone.__load_patch("bluebird",function(e,n,t){var o="bluebird";n[n.__symbol__(o)]=function(e){e.setScheduler(function(e){n.current.scheduleMicroTask(o,e)})}})});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n():"function"==typeof define&&define.amd?define(n):n()}(this,function(){"use strict";Zone.__load_patch("bluebird",function(e,n){var t="bluebird";n[n.__symbol__(t)]=function(e){e.setScheduler(function(e){n.current.scheduleMicroTask(t,e)})}})});

@@ -174,3 +174,3 @@ /**

}
return value.apply(this, [error, structuredStackTrace]);
return value.call(this, error, structuredStackTrace);
};

@@ -201,3 +201,3 @@ }

// This check makes sure that we don't filter frames on name only (must have
// linenumber)
// line number)
if (/:\d+:\d+/.test(frame)) {

@@ -268,3 +268,3 @@ // Get rid of the path so that we don't accidentally find function name in path.

childDetectZone.runGuarded(function () {
var fakeTransitionTo = function (toState, fromState1, fromState2) { };
var fakeTransitionTo = function () { };
childDetectZone.scheduleEventTask(blacklistedStackFramesSymbol, function () {

@@ -271,0 +271,0 @@ childDetectZone.scheduleMacroTask(blacklistedStackFramesSymbol, function () {

@@ -1,1 +0,1 @@

!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";Zone.__load_patch("Error",function(r,t,e){function n(){var r=this,t=o.apply(this,arguments),i=t.originalStack=t.stack;if(n[f]&&i){for(var s=i.split("\n"),k=e.currentZoneFrame(),p=0;s[p]!==a&&s[p]!==c&&p<s.length;)p++;for(;p<s.length&&k;p++){var l=s[p];if(l.trim())switch(u[l]){case 0:s.splice(p,1),p--;break;case 1:k=k.parent?k.parent:null,s.splice(p,1),p--;break;default:s[p]+=" ["+k.zone.name+"]"}}try{t.stack=t.zoneAwareStack=s.join("\n")}catch(d){}}return this instanceof o&&this.constructor!=o?(Object.keys(t).concat("stack","message").forEach(function(e){var n=t[e];if(void 0!==n)try{r[e]=n}catch(a){}}),this):t}var a,c,i=e.symbol("blacklistedStackFrames"),o=r[e.symbol("Error")]=r.Error,u={};r.Error=n;var f="stackRewrite";n.prototype=o.prototype,n[i]=u,n[f]=!1;var s=["stackTraceLimit","captureStackTrace","prepareStackTrace"],k=Object.keys(o);k&&k.forEach(function(r){0===s.filter(function(t){return t===r}).length&&Object.defineProperty(n,r,{get:function(){return o[r]},set:function(t){o[r]=t}})}),o.hasOwnProperty("stackTraceLimit")&&(o.stackTraceLimit=Math.max(o.stackTraceLimit,15),Object.defineProperty(n,"stackTraceLimit",{get:function(){return o.stackTraceLimit},set:function(r){return o.stackTraceLimit=r}})),o.hasOwnProperty("captureStackTrace")&&Object.defineProperty(n,"captureStackTrace",{value:function(r,t){o.captureStackTrace(r,t)}});var p="zoneCaptureStackTrace";Object.defineProperty(n,"prepareStackTrace",{get:function(){return o.prepareStackTrace},set:function(r){return r&&"function"==typeof r?o.prepareStackTrace=function(t,e){if(e)for(var n=0;n<e.length;n++){var a=e[n];if(a.getFunctionName()===p){e.splice(n,1);break}}return r.apply(this,[t,e])}:o.prepareStackTrace=r}});var l="ZoneAwareError",d="Error.",T="",h="runGuarded",v="runTask",m="run",y="(",S="@",b=t.current.fork({name:"detect",onHandleError:function(r,t,e,i){if(i.originalStack&&Error===n)for(var o=i.originalStack.split(/\n/),s=!1,k=!1,p=!1;o.length;){var b=o.shift();if(/:\d+:\d+/.test(b)){var E=b.split(y)[0].split(S)[0],g=1;if(E.indexOf(l)!==-1&&(a=b,c=b.replace(d,T),u[c]=0),E.indexOf(h)!==-1?k=!0:E.indexOf(v)!==-1?p=!0:E.indexOf(m)!==-1?s=!0:g=0,u[b]=g,s&&k&&p){n[f]=!0;break}}}return!1}}),E=b.fork({name:"child",onScheduleTask:function(r,t,e,n){return r.scheduleTask(e,n)},onInvokeTask:function(r,t,e,n,a,c){return r.invokeTask(e,n,a,c)},onCancelTask:function(r,t,e,n){return r.cancelTask(e,n)},onInvoke:function(r,t,e,n,a,c,i){return r.invoke(e,n,a,c,i)}}),g=Error.stackTraceLimit;Error.stackTraceLimit=100,E.run(function(){E.runGuarded(function(){var r=function(r,t,e){};E.scheduleEventTask(i,function(){E.scheduleMacroTask(i,function(){E.scheduleMicroTask(i,function(){throw new n(n,o)},null,function(t){t._transitionTo=r,t.invoke()})},null,function(t){t._transitionTo=r,t.invoke()},function(){})},null,function(t){t._transitionTo=r,t.invoke()},function(){})})}),Error.stackTraceLimit=g})});
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";Zone.__load_patch("Error",function(r,t,e){function n(){var r=this,t=o.apply(this,arguments),i=t.originalStack=t.stack;if(n[f]&&i){for(var s=i.split("\n"),k=e.currentZoneFrame(),l=0;s[l]!==a&&s[l]!==c&&l<s.length;)l++;for(;l<s.length&&k;l++){var p=s[l];if(p.trim())switch(u[p]){case 0:s.splice(l,1),l--;break;case 1:k=k.parent?k.parent:null,s.splice(l,1),l--;break;default:s[l]+=" ["+k.zone.name+"]"}}try{t.stack=t.zoneAwareStack=s.join("\n")}catch(d){}}return this instanceof o&&this.constructor!=o?(Object.keys(t).concat("stack","message").forEach(function(e){var n=t[e];if(void 0!==n)try{r[e]=n}catch(a){}}),this):t}var a,c,i=e.symbol("blacklistedStackFrames"),o=r[e.symbol("Error")]=r.Error,u={};r.Error=n;var f="stackRewrite";n.prototype=o.prototype,n[i]=u,n[f]=!1;var s=["stackTraceLimit","captureStackTrace","prepareStackTrace"],k=Object.keys(o);k&&k.forEach(function(r){0===s.filter(function(t){return t===r}).length&&Object.defineProperty(n,r,{get:function(){return o[r]},set:function(t){o[r]=t}})}),o.hasOwnProperty("stackTraceLimit")&&(o.stackTraceLimit=Math.max(o.stackTraceLimit,15),Object.defineProperty(n,"stackTraceLimit",{get:function(){return o.stackTraceLimit},set:function(r){return o.stackTraceLimit=r}})),o.hasOwnProperty("captureStackTrace")&&Object.defineProperty(n,"captureStackTrace",{value:function(r,t){o.captureStackTrace(r,t)}});var l="zoneCaptureStackTrace";Object.defineProperty(n,"prepareStackTrace",{get:function(){return o.prepareStackTrace},set:function(r){return r&&"function"==typeof r?o.prepareStackTrace=function(t,e){if(e)for(var n=0;n<e.length;n++){var a=e[n];if(a.getFunctionName()===l){e.splice(n,1);break}}return r.call(this,t,e)}:o.prepareStackTrace=r}});var p="ZoneAwareError",d="Error.",T="",h="runGuarded",v="runTask",m="run",y="(",S="@",b=t.current.fork({name:"detect",onHandleError:function(r,t,e,i){if(i.originalStack&&Error===n)for(var o=i.originalStack.split(/\n/),s=!1,k=!1,l=!1;o.length;){var b=o.shift();if(/:\d+:\d+/.test(b)){var E=b.split(y)[0].split(S)[0],g=1;if(E.indexOf(p)!==-1&&(a=b,c=b.replace(d,T),u[c]=0),E.indexOf(h)!==-1?k=!0:E.indexOf(v)!==-1?l=!0:E.indexOf(m)!==-1?s=!0:g=0,u[b]=g,s&&k&&l){n[f]=!0;break}}}return!1}}),E=b.fork({name:"child",onScheduleTask:function(r,t,e,n){return r.scheduleTask(e,n)},onInvokeTask:function(r,t,e,n,a,c){return r.invokeTask(e,n,a,c)},onCancelTask:function(r,t,e,n){return r.cancelTask(e,n)},onInvoke:function(r,t,e,n,a,c,i){return r.invoke(e,n,a,c,i)}}),g=Error.stackTraceLimit;Error.stackTraceLimit=100,E.run(function(){E.runGuarded(function(){var r=function(){};E.scheduleEventTask(i,function(){E.scheduleMacroTask(i,function(){E.scheduleMicroTask(i,function(){throw new n(n,o)},null,function(t){t._transitionTo=r,t.invoke()})},null,function(t){t._transitionTo=r,t.invoke()},function(){})},null,function(t){t._transitionTo=r,t.invoke()},function(){})})}),Error.stackTraceLimit=g})});

@@ -26,3 +26,3 @@ /**

var FUNCTION_1 = 'function';
var nativeExec_1 = api.patchMethod(global.cordova, 'exec', function (delegate) { return function (self, args) {
var nativeExec_1 = api.patchMethod(global.cordova, 'exec', function () { return function (self, args) {
if (args.length > 0 && typeof args[0] === FUNCTION_1) {

@@ -38,3 +38,3 @@ args[0] = Zone.current.wrap(args[0], SUCCESS_SOURCE_1);

});
Zone.__load_patch('cordova.FileReader', function (global, Zone, api) {
Zone.__load_patch('cordova.FileReader', function (global, Zone) {
if (global.cordova && typeof global['FileReader'] !== 'undefined') {

@@ -41,0 +41,0 @@ document.addEventListener('deviceReady', function () {

@@ -1,1 +0,1 @@

!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o():"function"==typeof define&&define.amd?define(o):o()}(this,function(){"use strict";Zone.__load_patch("cordova",function(e,o,r){if(e.cordova)var t="cordova.exec.success",n="cordova.exec.error",a="function",c=r.patchMethod(e.cordova,"exec",function(e){return function(e,r){return r.length>0&&typeof r[0]===a&&(r[0]=o.current.wrap(r[0],t)),r.length>1&&typeof r[1]===a&&(r[1]=o.current.wrap(r[1],n)),c.apply(e,r)}})}),Zone.__load_patch("cordova.FileReader",function(e,o,r){e.cordova&&"undefined"!=typeof e.FileReader&&document.addEventListener("deviceReady",function(){var r=e.FileReader;["abort","error","load","loadstart","loadend","progress"].forEach(function(e){var t=o.__symbol__("ON_PROPERTY"+e);Object.defineProperty(r.prototype,t,{configurable:!0,get:function(){return this._realReader&&this._realReader[t]}})})})})});
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o():"function"==typeof define&&define.amd?define(o):o()}(this,function(){"use strict";Zone.__load_patch("cordova",function(e,o,r){if(e.cordova)var t="cordova.exec.success",n="cordova.exec.error",a="function",c=r.patchMethod(e.cordova,"exec",function(){return function(e,r){return r.length>0&&typeof r[0]===a&&(r[0]=o.current.wrap(r[0],t)),r.length>1&&typeof r[1]===a&&(r[1]=o.current.wrap(r[1],n)),c.apply(e,r)}})}),Zone.__load_patch("cordova.FileReader",function(e,o){e.cordova&&"undefined"!=typeof e.FileReader&&document.addEventListener("deviceReady",function(){var r=e.FileReader;["abort","error","load","loadstart","loadend","progress"].forEach(function(e){var t=o.__symbol__("ON_PROPERTY"+e);Object.defineProperty(r.prototype,t,{configurable:!0,get:function(){return this._realReader&&this._realReader[t]}})})})})});

@@ -22,20 +22,24 @@ /**

Zone.__load_patch('electron', function (global, Zone, api) {
var FUNCTION = 'function';
var _a = require('electron'), desktopCapturer = _a.desktopCapturer, shell = _a.shell, CallbackRegistry = _a.CallbackRegistry;
function patchArguments(target, name, source) {
return api.patchMethod(target, name, function (delegate) { return function (self, args) {
return delegate && delegate.apply(self, api.bindArguments(args, source));
}; });
}
var _a = require('electron'), desktopCapturer = _a.desktopCapturer, shell = _a.shell, CallbacksRegistry = _a.CallbacksRegistry;
// patch api in renderer process directly
// desktopCapturer
if (desktopCapturer) {
api.patchArguments(desktopCapturer, 'getSources', 'electron.desktopCapturer.getSources');
patchArguments(desktopCapturer, 'getSources', 'electron.desktopCapturer.getSources');
}
// shell
if (shell) {
api.patchArguments(shell, 'openExternal', 'electron.shell.openExternal');
patchArguments(shell, 'openExternal', 'electron.shell.openExternal');
}
// patch api in main process through CallbackRegistry
if (!CallbackRegistry) {
if (!CallbacksRegistry) {
return;
}
api.patchArguments(CallbackRegistry.prototype, 'add', 'CallbackRegistry.add');
patchArguments(CallbacksRegistry.prototype, 'add', 'CallbackRegistry.add');
});
})));

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";Zone.__load_patch("electron",function(e,t,n){var o=require("electron"),r=o.desktopCapturer,c=o.shell,a=o.CallbackRegistry;r&&n.patchArguments(r,"getSources","electron.desktopCapturer.getSources"),c&&n.patchArguments(c,"openExternal","electron.shell.openExternal"),a&&n.patchArguments(a.prototype,"add","CallbackRegistry.add")})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";Zone.__load_patch("electron",function(e,t,n){function o(e,t,o){return n.patchMethod(e,t,function(e){return function(t,r){return e&&e.apply(t,n.bindArguments(r,o))}})}var r=require("electron"),c=r.desktopCapturer,u=r.shell,i=r.CallbacksRegistry;c&&o(c,"getSources","electron.desktopCapturer.getSources"),u&&o(u,"openExternal","electron.shell.openExternal"),i&&o(i.prototype,"add","CallbackRegistry.add")})});

@@ -21,10 +21,8 @@ /**

*/
Zone.__load_patch('rxjs', function (global, Zone, api) {
Zone.__load_patch('rxjs', function (global, Zone) {
var symbol = Zone.__symbol__;
var subscribeSource = 'rxjs.subscribe';
var nextSource = 'rxjs.Subscriber.next';
var errorSource = 'rxjs.Subscriber.error';
var completeSource = 'rxjs.Subscriber.complete';
var unsubscribeSource = 'rxjs.Subscriber.unsubscribe';
var teardownSource = 'rxjs.Subscriber.teardownLogic';
var ObjectDefineProperties = Object.defineProperties;
var empty = {

@@ -56,3 +54,3 @@ closed: true,

var subscribe = ObservablePrototype[symbolSubscribe] = ObservablePrototype.subscribe;
Object.defineProperties(rxjs_Observable.Observable.prototype, {
ObjectDefineProperties(rxjs_Observable.Observable.prototype, {
_zone: { value: null, writable: true, configurable: true },

@@ -108,3 +106,3 @@ _zoneSource: { value: null, writable: true, configurable: true },

rxjs_Subscription.Subscription.prototype.unsubscribe;
Object.defineProperties(rxjs_Subscription.Subscription.prototype, {
ObjectDefineProperties(rxjs_Subscription.Subscription.prototype, {
_zone: { value: null, writable: true, configurable: true },

@@ -311,3 +309,2 @@ _zoneUnsubscribe: { value: null, writable: true, configurable: true },

var scheduleSymbol = symbol('scheduleSymbol');
var flushSymbol = symbol('flushSymbol');
var zoneSymbol = symbol('zone');

@@ -335,3 +332,3 @@ if (asap$$1[scheduleSymbol]) {

};
return schedule.apply(this, [patchedWork, delay, state]);
return schedule.call(this, patchedWork, delay, state);
};

@@ -338,0 +335,0 @@ };

@@ -1,1 +0,1 @@

!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("rxjs/add/observable/bindCallback"),require("rxjs/add/observable/bindNodeCallback"),require("rxjs/add/observable/defer"),require("rxjs/add/observable/forkJoin"),require("rxjs/add/observable/fromEventPattern"),require("rxjs/add/operator/multicast"),require("rxjs/Observable"),require("rxjs/scheduler/asap"),require("rxjs/Subscriber"),require("rxjs/Subscription"),require("rxjs/symbol/rxSubscriber")):"function"==typeof define&&define.amd?define(["rxjs/add/observable/bindCallback","rxjs/add/observable/bindNodeCallback","rxjs/add/observable/defer","rxjs/add/observable/forkJoin","rxjs/add/observable/fromEventPattern","rxjs/add/operator/multicast","rxjs/Observable","rxjs/scheduler/asap","rxjs/Subscriber","rxjs/Subscription","rxjs/symbol/rxSubscriber"],e):e(null,null,null,null,null,null,r.Rx,r.Rx.Scheduler,r.Rx,r.Rx,r.Rx.Symbol)}(this,function(r,e,t,n,i,u,o,s,b,c,a){"use strict";Zone.__load_patch("rxjs",function(r,e,t){function n(r,e,t){if(r){if(r instanceof b.Subscriber)return r;if(r[a.rxSubscriber])return r[a.rxSubscriber]()}return r||e||t?new b.Subscriber(r,e,t):new b.Subscriber(p)}var i=e.__symbol__,u="rxjs.Subscriber.next",l="rxjs.Subscriber.error",f="rxjs.Subscriber.complete",p={closed:!0,next:function(r){},error:function(r){throw r},complete:function(){}},v=function(){var r=o.Observable.prototype,t=i("subscribe"),u=i("_subscribe"),s=r[u]=r._subscribe,b=r[t]=r.subscribe;Object.defineProperties(o.Observable.prototype,{_zone:{value:null,writable:!0,configurable:!0},_zoneSource:{value:null,writable:!0,configurable:!0},_zoneSubscribe:{value:null,writable:!0,configurable:!0},source:{configurable:!0,get:function(){return this._zoneSource},set:function(r){this._zone=e.current,this._zoneSource=r}},_subscribe:{configurable:!0,get:function(){if(this._zoneSubscribe)return this._zoneSubscribe;if(this.constructor===o.Observable)return s;var r=Object.getPrototypeOf(this);return r&&r._subscribe},set:function(r){this._zone=e.current,this._zoneSubscribe=r}},subscribe:{writable:!0,configurable:!0,value:function(r,t,i){var u=this._zone;return u&&u!==e.current?u.run(b,this,[n(r,t,i)]):b.call(this,r,t,i)}}})},d=function(){var r=i("unsubscribe"),t=c.Subscription.prototype[r]=c.Subscription.prototype.unsubscribe;Object.defineProperties(c.Subscription.prototype,{_zone:{value:null,writable:!0,configurable:!0},_zoneUnsubscribe:{value:null,writable:!0,configurable:!0},_unsubscribe:{get:function(){if(this._zoneUnsubscribe)return this._zoneUnsubscribe;var r=Object.getPrototypeOf(this);return r&&r._unsubscribe},set:function(r){this._zone=e.current,this._zoneUnsubscribe=r}},unsubscribe:{writable:!0,configurable:!0,value:function(){var r=this._zone;r&&r!==e.current?r.run(t,this):t.apply(this)}}})},h=function(){var r=b.Subscriber.prototype.next,t=b.Subscriber.prototype.error,n=b.Subscriber.prototype.complete;Object.defineProperty(b.Subscriber.prototype,"destination",{configurable:!0,get:function(){return this._zoneDestination},set:function(r){this._zone=e.current,this._zoneDestination=r}}),b.Subscriber.prototype.next=function(){var t=e.current,n=this._zone;return n&&n!==t?n.run(r,this,arguments,u):r.apply(this,arguments)},b.Subscriber.prototype.error=function(){var r=e.current,n=this._zone;return n&&n!==r?n.run(t,this,arguments,l):t.apply(this,arguments)},b.Subscriber.prototype.complete=function(){var r=e.current,t=this._zone;return t&&t!==r?t.run(n,this,arguments,f):n.apply(this,arguments)}},y=function(r){r._zone=e.current},x=function(r,e){var t=i(e);if(!r[t]){var n=r[t]=r[e];n&&(r[e]=function(){var r=n.apply(this,arguments);return function(){var e=r.apply(this,arguments);return y(e),e}})}},_=function(r,e){var t=i(e);if(!r[t]){var n=r[t]=r[e];n&&(r[e]=function(){var r=n.apply(this,arguments);return y(r),r})}},S=function(r,t){var n=i(t);if(!r[n]){var u=r[n]=r[t];u&&(r[t]=function(){for(var r=e.current,t=Array.prototype.slice.call(arguments),n=function(n){var i=t[n];"function"==typeof i&&(t[n]=function(){var t=Array.prototype.slice.call(arguments),n=e.current;return r&&n&&r!==n?r.run(i,this,t):i.apply(this,t)})},i=0;i<t.length;i++)n(i);var o=u.apply(this,t);return y(o),o})}},j=function(){var r=o.Observable.prototype,t="multicast",n=i(t);if(!r[n]){var u=r[n]=r[t];u&&(r[t]=function(){var r=e.current,t=Array.prototype.slice.call(arguments),n=t.length>0?t[0]:void 0;if("function"!=typeof n){var i=n;n=function(){return i}}t[0]=function(){var t;return t=r&&r!==e.current?r.run(n,this,arguments):n.apply(this,arguments),t&&r&&(t._zone=r),t};var o=u.apply(this,t);return y(o),o})}},z=function(r){if(r){var t=i("scheduleSymbol"),n=(i("flushSymbol"),i("zone"));if(!r[t]){var u=r[t]=r.schedule;r.schedule=function(){var r=Array.prototype.slice.call(arguments),t=r.length>0?r[0]:void 0,i=r.length>1?r[1]:0,o=(r.length>2?r[2]:void 0)||{};o[n]=e.current;var s=function(){var r=Array.prototype.slice.call(arguments),i=r.length>0?r[0]:void 0,u=i&&i[n];return u&&u!==e.current?u.runGuarded(t,this,arguments):t.apply(this,arguments)};return u.apply(this,[s,i,o])}}}};v(),d(),h(),x(o.Observable,"bindCallback"),x(o.Observable,"bindNodeCallback"),_(o.Observable,"defer"),_(o.Observable,"forkJoin"),S(o.Observable,"fromEventPattern"),j(),z(s.asap)})});
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("rxjs/add/observable/bindCallback"),require("rxjs/add/observable/bindNodeCallback"),require("rxjs/add/observable/defer"),require("rxjs/add/observable/forkJoin"),require("rxjs/add/observable/fromEventPattern"),require("rxjs/add/operator/multicast"),require("rxjs/Observable"),require("rxjs/scheduler/asap"),require("rxjs/Subscriber"),require("rxjs/Subscription"),require("rxjs/symbol/rxSubscriber")):"function"==typeof define&&define.amd?define(["rxjs/add/observable/bindCallback","rxjs/add/observable/bindNodeCallback","rxjs/add/observable/defer","rxjs/add/observable/forkJoin","rxjs/add/observable/fromEventPattern","rxjs/add/operator/multicast","rxjs/Observable","rxjs/scheduler/asap","rxjs/Subscriber","rxjs/Subscription","rxjs/symbol/rxSubscriber"],e):e(null,null,null,null,null,null,r.Rx,r.Rx.Scheduler,r.Rx,r.Rx,r.Rx.Symbol)}(this,function(r,e,t,n,i,u,o,s,b,c,a){"use strict";Zone.__load_patch("rxjs",function(r,e){function t(r,e,t){if(r){if(r instanceof b.Subscriber)return r;if(r[a.rxSubscriber])return r[a.rxSubscriber]()}return r||e||t?new b.Subscriber(r,e,t):new b.Subscriber(p)}var n=e.__symbol__,i="rxjs.Subscriber.next",u="rxjs.Subscriber.error",l="rxjs.Subscriber.complete",f=Object.defineProperties,p={closed:!0,next:function(r){},error:function(r){throw r},complete:function(){}},v=function(){var r=o.Observable.prototype,i=n("subscribe"),u=n("_subscribe"),s=r[u]=r._subscribe,b=r[i]=r.subscribe;f(o.Observable.prototype,{_zone:{value:null,writable:!0,configurable:!0},_zoneSource:{value:null,writable:!0,configurable:!0},_zoneSubscribe:{value:null,writable:!0,configurable:!0},source:{configurable:!0,get:function(){return this._zoneSource},set:function(r){this._zone=e.current,this._zoneSource=r}},_subscribe:{configurable:!0,get:function(){if(this._zoneSubscribe)return this._zoneSubscribe;if(this.constructor===o.Observable)return s;var r=Object.getPrototypeOf(this);return r&&r._subscribe},set:function(r){this._zone=e.current,this._zoneSubscribe=r}},subscribe:{writable:!0,configurable:!0,value:function(r,n,i){var u=this._zone;return u&&u!==e.current?u.run(b,this,[t(r,n,i)]):b.call(this,r,n,i)}}})},d=function(){var r=n("unsubscribe"),t=c.Subscription.prototype[r]=c.Subscription.prototype.unsubscribe;f(c.Subscription.prototype,{_zone:{value:null,writable:!0,configurable:!0},_zoneUnsubscribe:{value:null,writable:!0,configurable:!0},_unsubscribe:{get:function(){if(this._zoneUnsubscribe)return this._zoneUnsubscribe;var r=Object.getPrototypeOf(this);return r&&r._unsubscribe},set:function(r){this._zone=e.current,this._zoneUnsubscribe=r}},unsubscribe:{writable:!0,configurable:!0,value:function(){var r=this._zone;r&&r!==e.current?r.run(t,this):t.apply(this)}}})},h=function(){var r=b.Subscriber.prototype.next,t=b.Subscriber.prototype.error,n=b.Subscriber.prototype.complete;Object.defineProperty(b.Subscriber.prototype,"destination",{configurable:!0,get:function(){return this._zoneDestination},set:function(r){this._zone=e.current,this._zoneDestination=r}}),b.Subscriber.prototype.next=function(){var t=e.current,n=this._zone;return n&&n!==t?n.run(r,this,arguments,i):r.apply(this,arguments)},b.Subscriber.prototype.error=function(){var r=e.current,n=this._zone;return n&&n!==r?n.run(t,this,arguments,u):t.apply(this,arguments)},b.Subscriber.prototype.complete=function(){var r=e.current,t=this._zone;return t&&t!==r?t.run(n,this,arguments,l):n.apply(this,arguments)}},y=function(r){r._zone=e.current},x=function(r,e){var t=n(e);if(!r[t]){var i=r[t]=r[e];i&&(r[e]=function(){var r=i.apply(this,arguments);return function(){var e=r.apply(this,arguments);return y(e),e}})}},_=function(r,e){var t=n(e);if(!r[t]){var i=r[t]=r[e];i&&(r[e]=function(){var r=i.apply(this,arguments);return y(r),r})}},S=function(r,t){var i=n(t);if(!r[i]){var u=r[i]=r[t];u&&(r[t]=function(){for(var r=e.current,t=Array.prototype.slice.call(arguments),n=function(n){var i=t[n];"function"==typeof i&&(t[n]=function(){var t=Array.prototype.slice.call(arguments),n=e.current;return r&&n&&r!==n?r.run(i,this,t):i.apply(this,t)})},i=0;i<t.length;i++)n(i);var o=u.apply(this,t);return y(o),o})}},j=function(){var r=o.Observable.prototype,t="multicast",i=n(t);if(!r[i]){var u=r[i]=r[t];u&&(r[t]=function(){var r=e.current,t=Array.prototype.slice.call(arguments),n=t.length>0?t[0]:void 0;if("function"!=typeof n){var i=n;n=function(){return i}}t[0]=function(){var t;return t=r&&r!==e.current?r.run(n,this,arguments):n.apply(this,arguments),t&&r&&(t._zone=r),t};var o=u.apply(this,t);return y(o),o})}},z=function(r){if(r){var t=n("scheduleSymbol"),i=n("zone");if(!r[t]){var u=r[t]=r.schedule;r.schedule=function(){var r=Array.prototype.slice.call(arguments),t=r.length>0?r[0]:void 0,n=r.length>1?r[1]:0,o=(r.length>2?r[2]:void 0)||{};o[i]=e.current;var s=function(){var r=Array.prototype.slice.call(arguments),n=r.length>0?r[0]:void 0,u=n&&n[i];return u&&u!==e.current?u.runGuarded(t,this,arguments):t.apply(this,arguments)};return u.call(this,s,n,o)}}}};v(),d(),h(),x(o.Observable,"bindCallback"),x(o.Observable,"bindNodeCallback"),_(o.Observable,"defer"),_(o.Observable,"forkJoin"),S(o.Observable,"fromEventPattern"),j(),z(s.asap)})});

@@ -661,3 +661,3 @@ /**

this.name = 'fakeAsyncTestZone for ' + namePrefix;
// in case user can't access the construction of FakyAsyncTestSpec
// in case user can't access the construction of FakeAsyncTestSpec
// user can also define macroTaskOptions by define a global variable.

@@ -804,7 +804,7 @@ if (!this.macroTaskOptions) {

// arguments
var addtionalArgs = void 0;
var additionalArgs = void 0;
if (args) {
var callbackIndex = task.data.callbackIndex;
var callbackIndex = task.data.cbIdx;
if (typeof args.length === 'number' && args.length > callbackIndex + 1) {
addtionalArgs = Array.prototype.slice.call(args, callbackIndex + 1);
additionalArgs = Array.prototype.slice.call(args, callbackIndex + 1);
}

@@ -814,3 +814,3 @@ }

func: task.invoke,
args: addtionalArgs,
args: additionalArgs,
target: task.data && task.data.target

@@ -853,3 +853,3 @@ });

else {
// not periodic, use setTimout to simulate
// not periodic, use setTimeout to simulate
task.data['handleId'] = this._setTimeout(task.invoke, delay, callbackArgs);

@@ -856,0 +856,0 @@ }

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";function e(e,t){for(var n=e.length-1;n>=0;n--)typeof e[n]===L&&(e[n]=Zone.current.wrap(e[n],t+"_"+n));return e}function t(t,n){return function(){var r=Array.prototype.slice.call(arguments),o=e(r,n?n:t.name);return t.apply(this,o)}}function n(t,n,r){return c(t,n,function(t,n,o){return function(n,o){return t&&t.apply(n,e(o,r))}})}function r(t,n){for(var r=t.constructor.name,a=function(a){var i=n[a],s=t[i];if(s){var c=Object.getOwnPropertyDescriptor(t,i);if(!o(c))return"continue";t[i]=function(t){var n=function(){return t.apply(this,e(arguments,r+"."+i))};return l(n,t),n}(s)}},i=0;i<n.length;i++)a(i)}function o(e){return!e||e.writable!==!1&&(typeof e.get!==L||typeof e.set!==M)}function a(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);if(!r&&n){var o=Object.getOwnPropertyDescriptor(n,t);o&&(r={enumerable:!0,configurable:!0})}if(r&&r.configurable){delete r.writable,delete r.value;var a=r.get,i=r.set,s=t.substr(2),c=N[s];c||(c=N[s]=j("ON_PROPERTY"+s)),r.set=function(t){var n=this;if(n||e!==C||(n=C),n){var r=n[c];r&&n.removeEventListener(s,A),i&&i.apply(n,R),"function"==typeof t?(n[c]=t,n.addEventListener(s,A,!1)):n[c]=null}},r.get=function(){var n=this;if(n||e!==C||(n=C),!n)return null;var o=n[c];if(o)return o;if(a){var i=a&&a.apply(this);if(i)return r.set.apply(this,[i]),typeof n[I]===L&&n.removeAttribute(t),i}return null},Object.defineProperty(e,t,r)}}function i(e,t,n){if(t)for(var r=0;r<t.length;r++)a(e,"on"+t[r],n);else{var o=[];for(var i in e)"on"==i.substr(0,2)&&o.push(i);for(var s=0;s<o.length;s++)a(e,o[s],n)}}function s(t){var n=C[t];if(n){C[j(t)]=n,C[t]=function(){var r=e(arguments,t);switch(r.length){case 0:this[B]=new n;break;case 1:this[B]=new n(r[0]);break;case 2:this[B]=new n(r[0],r[1]);break;case 3:this[B]=new n(r[0],r[1],r[2]);break;case 4:this[B]=new n(r[0],r[1],r[2],r[3]);break;default:throw new Error("Arg list too long.")}},l(C[t],n);var r,o=new n(function(){});for(r in o)"XMLHttpRequest"===t&&"responseBlob"===r||!function(e){"function"==typeof o[e]?C[t].prototype[e]=function(){return this[B][e].apply(this[B],arguments)}:Object.defineProperty(C[t].prototype,e,{set:function(n){"function"==typeof n?(this[B][e]=Zone.current.wrap(n,t+"."+e),l(this[B][e],n)):this[B][e]=n},get:function(){return this[B][e]}})}(r);for(r in n)"prototype"!==r&&n.hasOwnProperty(r)&&(C[t][r]=n[r])}}function c(e,t,n){for(var r=e;r&&!r.hasOwnProperty(t);)r=Object.getPrototypeOf(r);!r&&e[t]&&(r=e);var a,i=j(t);if(r&&!(a=r[i])){a=r[i]=r[t];var s=r&&Object.getOwnPropertyDescriptor(r,t);if(o(s)){var c=n(a,i,t);r[t]=function(){return c(this,arguments)},l(r[t],a)}}return a}function u(e,t,n){function r(e){var t=e.data;return t.args[t.callbackIndex]=function(){e.invoke.apply(this,arguments)},o.apply(t.target,t.args),e}var o=null;o=c(e,t,function(e){return function(t,o){var a=n(t,o);if(a.callbackIndex>=0&&"function"==typeof o[a.callbackIndex]){var i=Zone.current.scheduleMacroTask(a.name,o[a.callbackIndex],a,r,null);return i}return e.apply(t,o)}})}function l(e,t){e[j("OriginalDelegate")]=t}function p(){if(X)return U;X=!0;try{var e=window.navigator.userAgent;e.indexOf("MSIE ");return e.indexOf("MSIE ")===-1&&e.indexOf("Trident/")===-1&&e.indexOf("Edge/")===-1||(U=!0),U}catch(t){}}function f(e,t,n){function r(t,n){if(!t)return!1;var r=!0;n&&void 0!==n.useGlobalCallback&&(r=n.useGlobalCallback);var d=n&&n.validateHandler,y=!0;n&&void 0!==n.checkDuplicate&&(y=n.checkDuplicate);var k=!1;n&&void 0!==n.returnTarget&&(k=n.returnTarget);for(var m=t;m&&!m.hasOwnProperty(o);)m=Object.getPrototypeOf(m);if(!m&&t[o]&&(m=t),!m)return!1;if(m[c])return!1;var _,b={},T=m[c]=m[o],w=m[j(a)]=m[a],E=m[j(i)]=m[i],D=m[j(s)]=m[s];n&&n.prependEventListenerFnName&&(_=m[j(n.prependEventListenerFnName)]=m[n.prependEventListenerFnName]);var O=function(e){if(!b.isExisting)return T.apply(b.target,[b.eventName,b.capture?g:v,b.options])},S=function(e){if(!e.isRemoved){var t=K[e.eventName],n=void 0;t&&(n=t[e.capture?W:G]);var r=n&&e.target[n];if(r)for(var o=0;o<r.length;o++){var a=r[o];if(a===e){r.splice(o,1),e.isRemoved=!0,0===r.length&&(e.allRemoved=!0,e.target[n]=null);break}}}if(e.allRemoved)return w.apply(e.target,[e.eventName,e.capture?g:v,e.options])},Z=function(e){return T.apply(b.target,[b.eventName,e.invoke,b.options])},P=function(e){return _.apply(b.target,[b.eventName,e.invoke,b.options])},z=function(e){return w.apply(e.target,[e.eventName,e.invoke,e.options])},C=r?O:Z,L=r?S:z,M=function(e,t){var n=typeof t;return n===Q&&e.callback===t||n===$&&e.originalDelegate===t},I=n&&n.compareTaskCallbackVsDelegate?n.compareTaskCallbackVsDelegate:M,R=Zone[Zone.__symbol__("BLACK_LISTED_EVENTS")],H=function(t,n,o,a,i,s){return void 0===i&&(i=!1),void 0===s&&(s=!1),function(){var c=this||e,u=(Zone.current,arguments[1]);if(!u)return t.apply(this,arguments);var l=!1;if(typeof u!==Q){if(!u.handleEvent)return t.apply(this,arguments);l=!0}if(!d||d(t,u,c,arguments)){var p=arguments[0],f=arguments[2];if(R)for(var h=0;h<R.length;h++)if(p===R[h])return t.apply(this,arguments);var v,g=!1;void 0===f?v=!1:f===!0?v=!0:f===!1?v=!1:(v=!!f&&!!f.capture,g=!!f&&!!f.once);var k,m=Zone.current,_=K[p];if(_)k=_[v?W:G];else{var T=p+G,w=p+W,E=ee+T,D=ee+w;K[p]={},K[p][G]=E,K[p][W]=D,k=v?D:E}var O=c[k],S=!1;if(O){if(S=!0,y)for(var h=0;h<O.length;h++)if(I(O[h],u))return}else O=c[k]=[];var Z,P=c.constructor[Y],z=J[P];z&&(Z=z[p]),Z||(Z=P+n+p),b.options=f,g&&(b.options.once=!1),b.target=c,b.capture=v,b.eventName=p,b.isExisting=S;var j=r?V:null;j&&(j.taskData=b);var C=m.scheduleEventTask(Z,u,j,o,a);return b.target=null,j&&(j.taskData=null),g&&(f.once=!0),C.options=f,C.target=c,C.capture=v,C.eventName=p,l&&(C.originalDelegate=u),s?O.unshift(C):O.push(C),i?c:void 0}}};return m[o]=H(T,u,C,L,k),_&&(m[p]=H(_,f,P,L,k,!0)),m[a]=function(){var t,n=this||e,r=arguments[0],o=arguments[2];t=void 0!==o&&(o===!0||o!==!1&&(!!o&&!!o.capture));var a=arguments[1];if(!a)return w.apply(this,arguments);if(!d||d(w,a,n,arguments)){var i,s=K[r];s&&(i=s[t?W:G]);var c=i&&n[i];if(c)for(var u=0;u<c.length;u++){var l=c[u];if(I(l,a))return c.splice(u,1),l.isRemoved=!0,0===c.length&&(l.allRemoved=!0,n[i]=null),void l.zone.cancelTask(l)}return w.apply(this,arguments)}},m[i]=function(){for(var t=this||e,n=arguments[0],r=[],o=h(t,n),a=0;a<o.length;a++){var i=o[a],s=i.originalDelegate?i.originalDelegate:i.callback;r.push(s)}return r},m[s]=function(){var t=this||e,n=arguments[0];if(n){var r=K[n];if(r){var o=r[G],i=r[W],c=t[o],u=t[i];if(c)for(var l=c.slice(),p=0;p<l.length;p++){var f=l[p],h=f.originalDelegate?f.originalDelegate:f.callback;this[a].apply(this,[n,h,f.options])}if(u)for(var l=u.slice(),p=0;p<l.length;p++){var f=l[p],h=f.originalDelegate?f.originalDelegate:f.callback;this[a].apply(this,[n,h,f.options])}}}else{for(var d=Object.keys(t),p=0;p<d.length;p++){var v=d[p],g=te.exec(v),y=g&&g[1];y&&"removeListener"!==y&&this[s].apply(this,[y])}this[s].apply(this,["removeListener"])}},l(m[o],T),l(m[a],w),D&&l(m[s],D),E&&l(m[i],E),!0}for(var o=n&&n.addEventListenerFnName||"addEventListener",a=n&&n.removeEventListenerFnName||"removeEventListener",i=n&&n.listenersFnName||"eventListeners",s=n&&n.removeAllFnName||"removeAllListeners",c=j(o),u="."+o+":",p="prependListener",f="."+p+":",d=function(e,t,n){if(!e.isRemoved){var r=e.callback;typeof r===$&&r.handleEvent&&(e.callback=function(e){return r.handleEvent(e)},e.originalDelegate=r),e.invoke(e,t,[n]);var o=e.options;if(o&&"object"==typeof o&&o.once){var i=e.originalDelegate?e.originalDelegate:e.callback;t[a].apply(t,[n.type,i,o])}}},v=function(t){if(t=t||e.event){var n=this||t.target||e,r=n[K[t.type][G]];if(r)if(1===r.length)d(r[0],n,t);else for(var o=r.slice(),a=0;a<o.length&&(!t||t[ne]!==!0);a++)d(o[a],n,t)}},g=function(t){if(t=t||e.event){var n=this||t.target||e,r=n[K[t.type][W]];if(r)if(1===r.length)d(r[0],n,t);else for(var o=r.slice(),a=0;a<o.length&&(!t||t[ne]!==!0);a++)d(o[a],n,t)}},y=[],k=0;k<t.length;k++)y[k]=r(t[k],n);return y}function h(e,t){var n=[];for(var r in e){var o=te.exec(r),a=o&&o[1];if(a&&(!t||a===t)){var i=e[r];if(i)for(var s=0;s<i.length;s++)n.push(i[s])}}return n}function d(e,t){var n=e.Event;n&&n.prototype&&t.patchMethod(n.prototype,"stopImmediatePropagation",function(e){return function(t,n){t[ne]=!0,e&&e.apply(t,n)}})}function v(e,t,n,r){function o(t){function n(){try{t.invoke.apply(this,arguments)}finally{if(t.data&&t.data.isPeriodic)return;typeof r.handleId===l?delete u[r.handleId]:r.handleId&&(r.handleId[re]=null)}}var r=t.data;return r.args[0]=n,r.handleId=i.apply(e,r.args),t}function a(e){return s(e.data.handleId)}var i=null,s=null;t+=r,n+=r;var u={},l="number",p="string",f="function",h="Interval",d="Timeout",v="notScheduled";i=c(e,t,function(n){return function(i,s){if(typeof s[0]===f){var c=Zone.current,p={handleId:null,isPeriodic:r===h,delay:r===d||r===h?s[1]||0:null,args:s},v=c.scheduleMacroTask(t,s[0],p,o,a);if(!v)return v;var g=v.data.handleId;return typeof g===l?u[g]=v:g&&(g[re]=v),g&&g.ref&&g.unref&&typeof g.ref===f&&typeof g.unref===f&&(v.ref=g.ref.bind(g),v.unref=g.unref.bind(g)),typeof g===l||g?g:v}return n.apply(e,s)}}),s=c(e,n,function(t){return function(n,r){var o,a=r[0];typeof a===l?o=u[a]:(o=a&&a[re],o||(o=a)),o&&typeof o.type===p?o.state!==v&&(o.cancelFn&&o.data.isPeriodic||0===o.runCount)&&(typeof a===l?delete u[a]:a&&(a[re]=null),o.zone.cancelTask(o)):t.apply(e,r)}})}function g(){Object.defineProperty=function(e,t,n){if(k(e,t))throw new TypeError("Cannot assign to read only property '"+t+"' of "+e);var r=n.configurable;return t!==ce&&(n=m(e,t,n)),_(e,t,n,r)},Object.defineProperties=function(e,t){return Object.keys(t).forEach(function(n){Object.defineProperty(e,n,t[n])}),e},Object.create=function(e,t){return typeof t!==ue||Object.isFrozen(t)||Object.keys(t).forEach(function(n){t[n]=m(e,n,t[n])}),ie(e,t)},Object.getOwnPropertyDescriptor=function(e,t){var n=ae(e,t);return k(e,t)&&(n.configurable=!1),n}}function y(e,t,n){var r=n.configurable;return n=m(e,t,n),_(e,t,n,r)}function k(e,t){return e&&e[se]&&e[se][t]}function m(e,t,n){return Object.isFrozen(n)||(n.configurable=!0),n.configurable||(e[se]||Object.isFrozen(e)||oe(e,se,{writable:!0,value:{}}),e[se]&&(e[se][t]=!0)),n}function _(e,t,n,r){try{return oe(e,t,n)}catch(o){if(!n.configurable)throw o;typeof r==le?delete n.configurable:n.configurable=r;try{return oe(e,t,n)}catch(o){var a=null;try{a=JSON.stringify(n)}catch(o){a=n.toString()}console.log("Attempting to configure '"+t+"' with descriptor '"+a+"' on object '"+e+"' and got error, giving up: "+o)}}}function b(e,t){var n=t.WebSocket;t.EventTarget||f(t,[n.prototype]),t.WebSocket=function(e,t){var r,o,a=arguments.length>1?new n(e,t):new n(e),s=Object.getOwnPropertyDescriptor(a,"onmessage");return s&&s.configurable===!1?(r=Object.create(a),o=a,["addEventListener","removeEventListener","send","close"].forEach(function(e){r[e]=function(){var t=Array.prototype.slice.call(arguments);if("addEventListener"===e||"removeEventListener"===e){var n=t.length>0?t[0]:void 0;if(n){var o=Zone.__symbol__("ON_PROPERTY"+n);a[o]=r[o]}}return a[e].apply(a,t)}})):r=a,i(r,["close","error","message","open"],o),r};var r=t.WebSocket;for(var o in n)r[o]=n[o]}function T(e,t,n){if(!n)return t;var r=n.filter(function(t){return t.target===e});if(!r||0===r.length)return t;var o=r[0].ignoreProperties;return t.filter(function(e){return o.indexOf(e)===-1})}function w(e,t,n,r){var o=T(e,t,n);i(e,o,r)}function E(e,t){if(!x||q){var n="undefined"!=typeof WebSocket;if(D()){var r=t.__Zone_ignore_on_properties;if(F){w(window,Se.concat(["messageerror"]),r,Object.getPrototypeOf(window)),w(Document.prototype,Se,r),"undefined"!=typeof window.SVGElement&&w(window.SVGElement.prototype,Se,r),w(Element.prototype,Se,r),w(HTMLElement.prototype,Se,r),w(HTMLMediaElement.prototype,ve,r),w(HTMLFrameSetElement.prototype,he.concat(be),r),w(HTMLBodyElement.prototype,he.concat(be),r),w(HTMLFrameElement.prototype,_e,r),w(HTMLIFrameElement.prototype,_e,r);var o=window.HTMLMarqueeElement;o&&w(o.prototype,Te,r);var a=window.Worker;a&&w(a.prototype,Oe,r)}w(XMLHttpRequest.prototype,we,r);var i=t.XMLHttpRequestEventTarget;i&&w(i&&i.prototype,we,r),"undefined"!=typeof IDBIndex&&(w(IDBIndex.prototype,Ee,r),w(IDBRequest.prototype,Ee,r),w(IDBOpenDBRequest.prototype,Ee,r),w(IDBDatabase.prototype,Ee,r),w(IDBTransaction.prototype,Ee,r),w(IDBCursor.prototype,Ee,r)),n&&w(WebSocket.prototype,De,r)}else O(),s("XMLHttpRequest"),n&&b(e,t)}}function D(){if((F||q)&&!Object.getOwnPropertyDescriptor(HTMLElement.prototype,"onclick")&&"undefined"!=typeof Element){var e=Object.getOwnPropertyDescriptor(Element.prototype,"onclick");if(e&&!e.configurable)return!1}var t=Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype,"onreadystatechange");if(t){Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",{enumerable:!0,configurable:!0,get:function(){return!0}});var n=new XMLHttpRequest,r=!!n.onreadystatechange;return Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",t||{}),r}var o=j("fakeonreadystatechange");Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",{enumerable:!0,configurable:!0,get:function(){return this[o]},set:function(e){this[o]=e}});var n=new XMLHttpRequest,a=function(){};n.onreadystatechange=a;var r=n[o]===a;return n.onreadystatechange=null,r}function O(){for(var e=function(e){var t=Se[e],n="on"+t;self.addEventListener(t,function(e){var t,r,o=e.target;for(r=o?o.constructor.name+"."+n:"unknown."+n;o;)o[n]&&!o[n][Ze]&&(t=Zone.current.wrap(o[n],r),t[Ze]=o[n],o[n]=t),o=o.parentElement},!0)},t=0;t<Se.length;t++)e(t)}function S(e,t){var n="Anchor,Area,Audio,BR,Base,BaseFont,Body,Button,Canvas,Content,DList,Directory,Div,Embed,FieldSet,Font,Form,Frame,FrameSet,HR,Head,Heading,Html,IFrame,Image,Input,Keygen,LI,Label,Legend,Link,Map,Marquee,Media,Menu,Meta,Meter,Mod,OList,Object,OptGroup,Option,Output,Paragraph,Pre,Progress,Quote,Script,Select,Source,Span,Style,TableCaption,TableCell,TableCol,Table,TableRow,TableSection,TextArea,Title,Track,UList,Unknown,Video",r="ApplicationCache,EventSource,FileReader,InputMethodContext,MediaController,MessagePort,Node,Performance,SVGElementInstance,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebKitNamedFlow,Window,Worker,WorkerGlobalScope,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload,IDBRequest,IDBOpenDBRequest,IDBDatabase,IDBTransaction,IDBCursor,DBIndex,WebSocket".split(","),o="EventTarget",a=[],i=e.wtf,s=n.split(",");i?a=s.map(function(e){return"HTML"+e+"Element"}).concat(r):e[o]?a.push(o):a=r;for(var c=e.__Zone_disable_IE_check||!1,u=e.__Zone_enable_cross_context_check||!1,l=p(),h=".addEventListener:",d="[object FunctionWrapper]",v="function __BROWSERTOOLS_CONSOLE_SAFEFUNC() { [native code] }",g=0;g<Se.length;g++){var y=Se[g],k=y+G,m=y+W,_=ee+k,b=ee+m;K[y]={},K[y][G]=_,K[y][W]=b}for(var g=0;g<n.length;g++)for(var T=s[g],w=J[T]={},E=0;E<Se.length;E++){var y=Se[E];w[y]=T+h+y}for(var D=function(e,t,n,r){if(!c&&l)if(u)try{var o=t.toString();if(o===d||o==v)return e.apply(n,r),!1}catch(a){return e.apply(n,r),!1}else{var o=t.toString();if(o===d||o==v)return e.apply(n,r),!1}else if(u)try{t.toString()}catch(a){return e.apply(n,r),!1}return!0},O=[],g=0;g<a.length;g++){var S=e[a[g]];O.push(S&&S.prototype)}return f(e,O,{validateHandler:D}),t.patchEventTarget=f,!0}function Z(e,t){d(e,t)}function P(e){if((F||q)&&"registerElement"in e.document){var t=document.registerElement,n=["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"];document.registerElement=function(e,r){return r&&r.prototype&&n.forEach(function(e){var t="Document.registerElement::"+e;if(r.prototype.hasOwnProperty(e)){var n=Object.getOwnPropertyDescriptor(r.prototype,e);n&&n.value?(n.value=Zone.current.wrap(n.value,t),y(r.prototype,e,n)):r.prototype[e]=Zone.current.wrap(r.prototype[e],t)}else r.prototype[e]&&(r.prototype[e]=Zone.current.wrap(r.prototype[e],t))}),t.apply(document,[e,r])},l(document.registerElement,t)}}var z=(function(e){function t(e){c&&c.mark&&c.mark(e)}function n(e,t){c&&c.measure&&c.measure(e,t)}function r(t){0===L&&0===y.length&&(l||e[v]&&(l=e[v].resolve(0)),l?l[g](o):e[d](o,0)),t&&y.push(t)}function o(){if(!k){for(k=!0;y.length;){var e=y;y=[];for(var t=0;t<e.length;t++){var n=e[t];try{n.zone.runTask(n,null,null)}catch(r){z.onUnhandledError(r)}}}!u[i("ignoreConsoleErrorUncaughtError")];z.microtaskDrainDone(),k=!1}}function a(){}function i(e){return"__zone_symbol__"+e}var s="function",c=e.performance;if(t("Zone"),e.Zone)throw new Error("Zone already loaded.");var u=function(){function r(e,t){this._properties=null,this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new f(this,this._parent&&this._parent._zoneDelegate,t)}return r.assertZonePatched=function(){if(e.Promise!==P.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")},Object.defineProperty(r,"root",{get:function(){for(var e=r.current;e.parent;)e=e.parent;return e},enumerable:!0,configurable:!0}),Object.defineProperty(r,"current",{get:function(){return j.zone},enumerable:!0,configurable:!0}),Object.defineProperty(r,"currentTask",{get:function(){return C},enumerable:!0,configurable:!0}),r.__load_patch=function(o,a){if(P.hasOwnProperty(o))throw Error("Already loaded patch: "+o);if(!e["__Zone_disable_"+o]){var i="Zone:"+o;t(i),P[o]=a(e,r,z),n(i,i)}},Object.defineProperty(r.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),r.prototype.get=function(e){var t=this.getZoneWith(e);if(t)return t._properties[e]},r.prototype.getZoneWith=function(e){for(var t=this;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null},r.prototype.fork=function(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)},r.prototype.wrap=function(e,t){if(typeof e!==s)throw new Error("Expecting function got: "+e);var n=this._zoneDelegate.intercept(this,e,t),r=this;return function(){return r.runGuarded(n,this,arguments,t)}},r.prototype.run=function(e,t,n,r){void 0===t&&(t=void 0),void 0===n&&(n=null),void 0===r&&(r=null),j={parent:j,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{j=j.parent}},r.prototype.runGuarded=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),j={parent:j,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(o){if(this._zoneDelegate.handleError(this,o))throw o}}finally{j=j.parent}},r.prototype.runTask=function(e,t,n){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||m).name+"; Execution: "+this.name+")");var r=e.state===_;if(!r||e.type!==Z){var o=e.state!=w;o&&e._transitionTo(w,T),e.runCount++;var a=C;C=e,j={parent:j,zone:this};try{e.type==S&&e.data&&!e.data.isPeriodic&&(e.cancelFn=null);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(i){if(this._zoneDelegate.handleError(this,i))throw i}}finally{e.state!==_&&e.state!==D&&(e.type==Z||e.data&&e.data.isPeriodic?o&&e._transitionTo(T,w):(e.runCount=0,this._updateTaskCount(e,-1),o&&e._transitionTo(_,w,_))),j=j.parent,C=a}}},r.prototype.scheduleTask=function(e){if(e.zone&&e.zone!==this)for(var t=this;t;){if(t===e.zone)throw Error("can not reschedule task to "+this.name+" which is descendants of the original zone "+e.zone.name);t=t.parent}e._transitionTo(b,_);var n=[];e._zoneDelegates=n,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(r){throw e._transitionTo(D,b,_),this._zoneDelegate.handleError(this,r),r}return e._zoneDelegates===n&&this._updateTaskCount(e,1),e.state==b&&e._transitionTo(T,b),e},r.prototype.scheduleMicroTask=function(e,t,n,r){return this.scheduleTask(new h(O,e,t,n,r,null))},r.prototype.scheduleMacroTask=function(e,t,n,r,o){return this.scheduleTask(new h(S,e,t,n,r,o))},r.prototype.scheduleEventTask=function(e,t,n,r,o){return this.scheduleTask(new h(Z,e,t,n,r,o))},r.prototype.cancelTask=function(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||m).name+"; Execution: "+this.name+")");e._transitionTo(E,T,w);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(D,E),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(_,E),e.runCount=0,e},r.prototype._updateTaskCount=function(e,t){var n=e._zoneDelegates;t==-1&&(e._zoneDelegates=null);for(var r=0;r<n.length;r++)n[r]._updateTaskCount(e.type,t)},r}();u.__symbol__=i;var l,p={name:"",onHasTask:function(e,t,n,r){return e.hasTask(n,r)},onScheduleTask:function(e,t,n,r){return e.scheduleTask(n,r)},onInvokeTask:function(e,t,n,r,o,a){return e.invokeTask(n,r,o,a)},onCancelTask:function(e,t,n,r){return e.cancelTask(n,r)}},f=function(){function e(e,t,n){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=e,this._parentDelegate=t,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this.zone:t.zone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this.zone:t.zone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this.zone:t.zone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this.zone:t.zone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this.zone:t.zone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this.zone:t.zone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this.zone:t.zone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;var r=n&&n.onHasTask,o=t&&t._hasTaskZS;(r||o)&&(this._hasTaskZS=r?n:p,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=e,n.onScheduleTask||(this._scheduleTaskZS=p,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this.zone),n.onInvokeTask||(this._invokeTaskZS=p,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this.zone),n.onCancelTask||(this._cancelTaskZS=p,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this.zone))}return e.prototype.fork=function(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new u(e,t)},e.prototype.intercept=function(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t},e.prototype.invoke=function(e,t,n,r,o){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,r,o):t.apply(n,r)},e.prototype.handleError=function(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)},e.prototype.scheduleTask=function(e,t){var n=t;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),n||(n=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=O)throw new Error("Task is missing scheduleFn.");r(t)}return n},e.prototype.invokeTask=function(e,t,n,r){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,r):t.callback.apply(n,r)},e.prototype.cancelTask=function(e,t){var n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");n=t.cancelFn(t)}return n},e.prototype.hasTask=function(e,t){try{return this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(n){this.handleError(e,n)}},e.prototype._updateTaskCount=function(e,t){var n=this._taskCounts,r=n[e],o=n[e]=r+t;if(o<0)throw new Error("More tasks executed then were scheduled.");if(0==r||0==o){var a={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e};this.hasTask(this.zone,a)}},e}(),h=function(){function t(n,r,o,a,i,s){this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=n,this.source=r,this.data=a,this.scheduleFn=i,this.cancelFn=s,this.callback=o;var c=this;n===Z&&a&&a.isUsingGlobalCallback?this.invoke=t.invokeTask:this.invoke=function(){return t.invokeTask.apply(e,[c,this,arguments])}}return t.invokeTask=function(e,t,n){e||(e=this),L++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{1==L&&o(),L--}},Object.defineProperty(t.prototype,"zone",{get:function(){return this._zone},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!0,configurable:!0}),t.prototype.cancelScheduleRequest=function(){this._transitionTo(_,b)},t.prototype._transitionTo=function(e,t,n){if(this._state!==t&&this._state!==n)throw new Error(this.type+" '"+this.source+"': can not transition to '"+e+"', expecting state '"+t+"'"+(n?" or '"+n+"'":"")+", was '"+this._state+"'.");this._state=e,e==_&&(this._zoneDelegates=null)},t.prototype.toString=function(){return this.data&&"undefined"!=typeof this.data.handleId?this.data.handleId:Object.prototype.toString.call(this)},t.prototype.toJSON=function(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}},t}(),d=i("setTimeout"),v=i("Promise"),g=i("then"),y=[],k=!1,m={name:"NO ZONE"},_="notScheduled",b="scheduling",T="scheduled",w="running",E="canceling",D="unknown",O="microTask",S="macroTask",Z="eventTask",P={},z={symbol:i,currentZoneFrame:function(){return j},onUnhandledError:a,microtaskDrainDone:a,scheduleMicroTask:r,showUncaughtError:function(){return!u[i("ignoreConsoleErrorUncaughtError")]},patchEventTarget:function(){return[]},patchOnProperties:a,patchMethod:function(){return a},patchArguments:function(){return a},setNativePromise:function(e){e&&typeof e.resolve===s&&(l=e.resolve(0))}},j={parent:null,zone:new u(null,null)},C=null,L=0;return n("Zone","Zone"),e.Zone=u}("undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global),function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}});Zone.__load_patch("ZoneAwarePromise",function(e,t,n){function r(e){if(e&&e.toString===Object.prototype.toString){var t=e.constructor&&e.constructor.name;return(t?t:"")+": "+JSON.stringify(e)}return e?e.toString():Object.prototype.toString.call(e)}function o(e){n.onUnhandledError(e);try{var r=t[m];r&&"function"==typeof r&&r.apply(this,[e])}catch(o){}}function a(e){return e&&e.then}function i(e){return e}function s(e){return I.reject(e)}function c(e,t){return function(n){try{u(e,t,n)}catch(r){u(e,!1,r)}}}function u(e,o,a){var i=S();if(e===a)throw new TypeError(Z);if(e[_]===w){var s=null;try{typeof a!==P&&typeof a!==j||(s=a&&a.then)}catch(f){return i(function(){u(e,!1,f)})(),e}if(o!==D&&a instanceof I&&a.hasOwnProperty(_)&&a.hasOwnProperty(b)&&a[_]!==w)l(a),u(e,a[_],a[b]);else if(o!==D&&typeof s===j)try{s.apply(a,[i(c(e,o)),i(c(e,!1))])}catch(f){i(function(){u(e,!1,f)})()}else{e[_]=o;var h=e[b];if(e[b]=a,o===D&&a instanceof Error){var d=t.currentTask&&t.currentTask.data&&t.currentTask.data[k];d&&Object.defineProperty(a,C,{configurable:!0,enumerable:!1,writable:!0,value:d})}for(var g=0;g<h.length;)p(e,h[g++],h[g++],h[g++],h[g++]);if(0==h.length&&o==D){e[_]=O;try{throw new Error("Uncaught (in promise): "+r(a)+(a&&a.stack?"\n"+a.stack:""))}catch(f){var y=f;y.rejection=a,y.promise=e,y.zone=t.current,y.task=t.currentTask,v.push(y),n.scheduleMicroTask()}}}}return e}function l(e){if(e[_]===O){try{var n=t[L];n&&typeof n===j&&n.apply(this,[{rejection:e[b],promise:e}])}catch(r){}e[_]=D;for(var o=0;o<v.length;o++)e===v[o].promise&&v.splice(o,1)}}function p(e,t,n,r,o){l(e);var a=e[_]?typeof r===j?r:i:typeof o===j?o:s;t.scheduleMicroTask(T,function(){try{u(n,!0,t.run(a,void 0,[e[b]]))}catch(r){u(n,!1,r)}})}function f(e){var t=e.prototype,n=t.then;t[y]=n;var r=Object.getOwnPropertyDescriptor(e.prototype,"then");r&&r.writable===!1&&r.configurable&&Object.defineProperty(e.prototype,"then",{writable:!0}),e.prototype.then=function(e,t){var r=this,o=new I(function(e,t){n.call(r,e,t)});return o.then(e,t)},e[F]=!0}function h(e){return function(){var t=e.apply(this,arguments);if(t instanceof I)return t;var n=t.constructor;return n[F]||f(n),t}}var d=n.symbol,v=[],g=d("Promise"),y=d("then"),k="__creationTrace__";n.onUnhandledError=function(e){if(n.showUncaughtError()){var t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=function(){for(;v.length;)for(var e=function(){var e=v.shift();try{e.zone.runGuarded(function(){throw e})}catch(t){o(t)}};v.length;)e()};var m=d("unhandledPromiseRejectionHandler"),_=d("state"),b=d("value"),T="Promise.then",w=null,E=!0,D=!1,O=0,S=function(){var e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},Z="Promise resolved with itself",P="object",j="function",C=d("currentTaskTrace"),L=d("rejectionHandledHandler"),M="function ZoneAwarePromise() { [native code] }",I=function(){function e(t){var n=this;if(!(n instanceof e))throw new Error("Must be an instanceof Promise.");n[_]=w,n[b]=[];try{t&&t(c(n,E),c(n,D))}catch(r){u(n,!1,r)}}return e.toString=function(){return M},e.resolve=function(e){return u(new this(null),E,e)},e.reject=function(e){return u(new this(null),D,e)},e.race=function(e){function t(e){i&&(i=r(e))}function n(e){i&&(i=o(e))}var r,o,i=new this(function(e,t){r=e,o=t});try{for(var s=z(e),c=s.next();!c.done;c=s.next()){var u=c.value;a(u)||(u=this.resolve(u)),u.then(t,n)}}catch(l){p={error:l}}finally{try{c&&!c.done&&(f=s["return"])&&f.call(s)}finally{if(p)throw p.error}}return i;var p,f},e.all=function(e){var t,n,r=new this(function(e,r){t=e,n=r}),o=0,i=[];try{for(var s=z(e),c=s.next();!c.done;c=s.next()){var u=c.value;a(u)||(u=this.resolve(u)),u.then(function(e){return function(n){i[e]=n,o--,o||t(i)}}(o),n),o++}}catch(l){p={error:l}}finally{try{c&&!c.done&&(f=s["return"])&&f.call(s)}finally{if(p)throw p.error}}return o||t(i),r;var p,f},e.prototype.then=function(e,n){var r=new this.constructor(null),o=t.current;return this[_]==w?this[b].push(o,r,e,n):p(this,o,r,e,n),r},e.prototype["catch"]=function(e){return this.then(null,e)},e}();I.resolve=I.resolve,I.reject=I.reject,I.race=I.race,I.all=I.all;var R=e[g]=e.Promise,H=t.__symbol__("ZoneAwarePromise"),x=Object.getOwnPropertyDescriptor(e,"Promise");x&&!x.configurable||(x&&delete x.writable,x&&delete x.value,x||(x={configurable:!0,enumerable:!0}),x.get=function(){return e[H]?e[H]:e[g]},x.set=function(t){t===I?e[H]=t:(e[g]=t,t.prototype[y]||f(t),n.setNativePromise(t))},Object.defineProperty(e,"Promise",x)),e.Promise=I;var F=d("thenPatched");if(R){f(R);var q=e.fetch;typeof q==j&&(e.fetch=h(q))}return Promise[t.__symbol__("uncaughtPromiseErrors")]=v,I});var j=Zone.__symbol__,C="object"==typeof window&&window||"object"==typeof self&&self||global,L="function",M="undefined",I="removeAttribute",R=[null],H="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,x=!("nw"in C)&&"undefined"!=typeof C.process&&"[object process]"==={}.toString.call(C.process),F=!x&&!H&&!("undefined"==typeof window||!window.HTMLElement),q="undefined"!=typeof C.process&&"[object process]"==={}.toString.call(C.process)&&!H&&!("undefined"==typeof window||!window.HTMLElement),N={},A=function(e){
if(e=e||C.event){var t=N[e.type];t||(t=N[e.type]=j("ON_PROPERTY"+e.type));var n=this||e.target||C,r=n[t],o=r&&r.apply(this,arguments);return void 0==o||o||e.preventDefault(),o}},B=j("originalInstance"),X=!1,U=!1;Zone.__load_patch("toString",function(e,t,n){var r=t.__zone_symbol__originalToString=Function.prototype.toString,o="function",a=j("OriginalDelegate"),i=j("Promise"),s=j("Error");Function.prototype.toString=function(){if(typeof this===o){var t=this[a];if(t)return typeof t===o?r.apply(this[a],arguments):Object.prototype.toString.call(t);if(this===Promise){var n=e[i];if(n)return r.apply(n,arguments)}if(this===Error){var c=e[s];if(c)return r.apply(c,arguments)}}return r.apply(this,arguments)};var c=Object.prototype.toString,u="[object Promise]";Object.prototype.toString=function(){return this instanceof Promise?u:c.apply(this,arguments)}});var W="true",G="false",V={isUsingGlobalCallback:!0},K={},J={},Y="name",Q="function",$="object",ee="__zone_symbol__",te=/^__zone_symbol__(\w+)(true|false)$/,ne="__zone_symbol__propagationStopped",re=j("zoneTask"),oe=Object[j("defineProperty")]=Object.defineProperty,ae=Object[j("getOwnPropertyDescriptor")]=Object.getOwnPropertyDescriptor,ie=Object.create,se=j("unconfigurables"),ce="prototype",ue="object",le="undefined",pe=["abort","animationcancel","animationend","animationiteration","auxclick","beforeinput","blur","cancel","canplay","canplaythrough","change","compositionstart","compositionupdate","compositionend","cuechange","click","close","contextmenu","curechange","dblclick","drag","dragend","dragenter","dragexit","dragleave","dragover","drop","durationchange","emptied","ended","error","focus","focusin","focusout","gotpointercapture","input","invalid","keydown","keypress","keyup","load","loadstart","loadeddata","loadedmetadata","lostpointercapture","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","mousewheel","orientationchange","pause","play","playing","pointercancel","pointerdown","pointerenter","pointerleave","pointerlockchange","mozpointerlockchange","webkitpointerlockerchange","pointerlockerror","mozpointerlockerror","webkitpointerlockerror","pointermove","pointout","pointerover","pointerup","progress","ratechange","reset","resize","scroll","seeked","seeking","select","selectionchange","selectstart","show","sort","stalled","submit","suspend","timeupdate","volumechange","touchcancel","touchmove","touchstart","touchend","transitioncancel","transitionend","waiting","wheel"],fe=["afterscriptexecute","beforescriptexecute","DOMContentLoaded","fullscreenchange","mozfullscreenchange","webkitfullscreenchange","msfullscreenchange","fullscreenerror","mozfullscreenerror","webkitfullscreenerror","msfullscreenerror","readystatechange","visibilitychange"],he=["absolutedeviceorientation","afterinput","afterprint","appinstalled","beforeinstallprompt","beforeprint","beforeunload","devicelight","devicemotion","deviceorientation","deviceorientationabsolute","deviceproximity","hashchange","languagechange","message","mozbeforepaint","offline","online","paint","pageshow","pagehide","popstate","rejectionhandled","storage","unhandledrejection","unload","userproximity","vrdisplyconnected","vrdisplaydisconnected","vrdisplaypresentchange"],de=["beforecopy","beforecut","beforepaste","copy","cut","paste","dragstart","loadend","animationstart","search","transitionrun","transitionstart","webkitanimationend","webkitanimationiteration","webkitanimationstart","webkittransitionend"],ve=["encrypted","waitingforkey","msneedkey","mozinterruptbegin","mozinterruptend"],ge=["activate","afterupdate","ariarequest","beforeactivate","beforedeactivate","beforeeditfocus","beforeupdate","cellchange","controlselect","dataavailable","datasetchanged","datasetcomplete","errorupdate","filterchange","layoutcomplete","losecapture","move","moveend","movestart","propertychange","resizeend","resizestart","rowenter","rowexit","rowsdelete","rowsinserted","command","compassneedscalibration","deactivate","help","mscontentzoom","msmanipulationstatechanged","msgesturechange","msgesturedoubletap","msgestureend","msgesturehold","msgesturestart","msgesturetap","msgotpointercapture","msinertiastart","mslostpointercapture","mspointercancel","mspointerdown","mspointerenter","mspointerhover","mspointerleave","mspointermove","mspointerout","mspointerover","mspointerup","pointerout","mssitemodejumplistitemremoved","msthumbnailclick","stop","storagecommit"],ye=["webglcontextrestored","webglcontextlost","webglcontextcreationerror"],ke=["autocomplete","autocompleteerror"],me=["toggle"],_e=["load"],be=["blur","error","focus","load","resize","scroll","messageerror"],Te=["bounce","finish","start"],we=["loadstart","progress","abort","error","load","progress","timeout","loadend","readystatechange"],Ee=["upgradeneeded","complete","abort","success","error","blocked","versionchange","close"],De=["close","error","open","message"],Oe=["error","message"],Se=pe.concat(ye,ke,me,fe,he,de,ge),Ze=j("unbound");Zone.__load_patch("util",function(e,t,r){r.patchOnProperties=i,r.patchMethod=c,r.patchArguments=n}),Zone.__load_patch("timers",function(e,t,n){var r="set",o="clear";v(e,r,o,"Timeout"),v(e,r,o,"Interval"),v(e,r,o,"Immediate")}),Zone.__load_patch("requestAnimationFrame",function(e,t,n){v(e,"request","cancel","AnimationFrame"),v(e,"mozRequest","mozCancel","AnimationFrame"),v(e,"webkitRequest","webkitCancel","AnimationFrame")}),Zone.__load_patch("blocking",function(e,t,n){for(var r=["alert","prompt","confirm"],o=0;o<r.length;o++){var a=r[o];c(e,a,function(n,r,o){return function(r,a){return t.current.run(n,e,a,o)}})}}),Zone.__load_patch("EventTarget",function(e,t,n){var r=t.__symbol__("BLACK_LISTED_EVENTS");e[r]&&(t[r]=e[r]),Z(e,n),S(e,n);var o=e.XMLHttpRequestEventTarget;o&&o.prototype&&n.patchEventTarget(e,[o.prototype]),s("MutationObserver"),s("WebKitMutationObserver"),s("IntersectionObserver"),s("FileReader")}),Zone.__load_patch("on_property",function(e,t,n){E(n,e),g(),P(e)}),Zone.__load_patch("canvas",function(e,t,n){var r=e.HTMLCanvasElement;"undefined"!=typeof r&&r.prototype&&r.prototype.toBlob&&u(r.prototype,"toBlob",function(e,t){return{name:"HTMLCanvasElement.toBlob",target:e,callbackIndex:0,args:t}})}),Zone.__load_patch("XHR",function(e,t,n){function r(e){function n(e){var t=e[o];return t}function r(e){XMLHttpRequest[s]=!1;var t=e.data,n=t.target,r=n[i];d||(d=n[f],v=n[h]),r&&v.apply(n,[y,r]);var a=n[i]=function(){n.readyState===n.DONE&&!t.aborted&&XMLHttpRequest[s]&&e.state===k&&e.invoke()};d.apply(n,[y,a]);var c=n[o];return c||(n[o]=e),b.apply(n,t.args),XMLHttpRequest[s]=!0,e}function l(){}function p(e){var t=e.data;return t.aborted=!0,w.apply(t.target,t.args)}var f=j("addEventListener"),h=j("removeEventListener"),d=XMLHttpRequest.prototype[f],v=XMLHttpRequest.prototype[h];if(!d){var g=e.XMLHttpRequestEventTarget;g&&(d=g.prototype[f],v=g.prototype[h])}var y="readystatechange",k="scheduled",m=c(e.XMLHttpRequest.prototype,"open",function(){return function(e,t){return e[a]=0==t[2],e[u]=t[1],m.apply(e,t)}}),_="XMLHttpRequest.send",b=c(e.XMLHttpRequest.prototype,"send",function(){return function(e,n){var o=t.current;if(e[a])return b.apply(e,n);var i={target:e,url:e[u],isPeriodic:!1,delay:null,args:n,aborted:!1};return o.scheduleMacroTask(_,l,i,r,p)}}),T="string",w=c(e.XMLHttpRequest.prototype,"abort",function(e){return function(e,t){var r=n(e);if(r&&typeof r.type==T){if(null==r.cancelFn||r.data&&r.data.aborted)return;r.zone.cancelTask(r)}}})}r(e);var o=j("xhrTask"),a=j("xhrSync"),i=j("xhrListener"),s=j("xhrScheduled"),u=j("xhrURL")}),Zone.__load_patch("geolocation",function(e,t,n){e.navigator&&e.navigator.geolocation&&r(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),Zone.__load_patch("getUserMedia",function(e,n,r){var o=e.navigator;o&&o.getUserMedia&&(o.getUserMedia=t(o.getUserMedia))}),Zone.__load_patch("PromiseRejectionEvent",function(e,t,n){function r(t){return function(n){var r=h(e,t);r.forEach(function(r){var o=e.PromiseRejectionEvent;if(o){var a=new o(t,{promise:n.promise,reason:n.rejection});r.invoke(a)}})}}e.PromiseRejectionEvent&&(t[j("unhandledPromiseRejectionHandler")]=r("unhandledrejection"),t[j("rejectionHandledHandler")]=r("rejectionhandled"))})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";function e(e,t){return Zone.current.wrap(e,t)}function t(e,t,n,r,o){return Zone.current.scheduleMacroTask(e,t,n,r,o)}function n(t,n){for(var r=t.length-1;r>=0;r--)"function"==typeof t[r]&&(t[r]=e(t[r],n+"_"+r));return t}function r(e,t){for(var r=e.constructor.name,a=function(a){var i=t[a],s=e[i];if(s){var c=P(e,i);if(!o(c))return"continue";e[i]=function(e){var t=function(){return e.apply(this,n(arguments,r+"."+i))};return l(t,e),t}(s)}},i=0;i<t.length;i++)a(i)}function o(e){return!e||e.writable!==!1&&!("function"==typeof e.get&&"undefined"==typeof e.set)}function a(e,t,n){var r=P(e,t);if(!r&&n){var o=P(n,t);o&&(r={enumerable:!0,configurable:!0})}if(r&&r.configurable){delete r.writable,delete r.value;var a=r.get,i=r.set,s=t.substr(2),c=Q[s];c||(c=Q[s]=B("ON_PROPERTY"+s)),r.set=function(t){var n=this;if(n||e!==X||(n=X),n){var r=n[c];r&&n.removeEventListener(s,$),i&&i.apply(n,U),"function"==typeof t?(n[c]=t,n.addEventListener(s,$,!1)):n[c]=null}},r.get=function(){var n=this;if(n||e!==X||(n=X),!n)return null;var o=n[c];if(o)return o;if(a){var i=a&&a.call(this);if(i)return r.set.call(this,i),"function"==typeof n[G]&&n.removeAttribute(t),i}return null},j(e,t,r)}}function i(e,t,n){if(t)for(var r=0;r<t.length;r++)a(e,"on"+t[r],n);else{var o=[];for(var i in e)"on"==i.substr(0,2)&&o.push(i);for(var s=0;s<o.length;s++)a(e,o[s],n)}}function s(t){var r=X[t];if(r){X[B(t)]=r,X[t]=function(){var e=n(arguments,t);switch(e.length){case 0:this[ee]=new r;break;case 1:this[ee]=new r(e[0]);break;case 2:this[ee]=new r(e[0],e[1]);break;case 3:this[ee]=new r(e[0],e[1],e[2]);break;case 4:this[ee]=new r(e[0],e[1],e[2],e[3]);break;default:throw new Error("Arg list too long.")}},l(X[t],r);var o,a=new r(function(){});for(o in a)"XMLHttpRequest"===t&&"responseBlob"===o||!function(n){"function"==typeof a[n]?X[t].prototype[n]=function(){return this[ee][n].apply(this[ee],arguments)}:j(X[t].prototype,n,{set:function(r){"function"==typeof r?(this[ee][n]=e(r,t+"."+n),l(this[ee][n],r)):this[ee][n]=r},get:function(){return this[ee][n]}})}(o);for(o in r)"prototype"!==o&&r.hasOwnProperty(o)&&(X[t][o]=r[o])}}function c(e,t,n){for(var r=e;r&&!r.hasOwnProperty(t);)r=C(r);!r&&e[t]&&(r=e);var a,i=B(t);if(r&&!(a=r[i])){a=r[i]=r[t];var s=r&&P(r,t);if(o(s)){var c=n(a,i,t);r[t]=function(){return c(this,arguments)},l(r[t],a)}}return a}function u(e,n,r){function o(e){var t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},a.apply(t.target,t.args),e}var a=null;a=c(e,n,function(e){return function(n,a){var i=r(n,a);return i.cbIdx>=0&&"function"==typeof a[i.cbIdx]?t(i.name,a[i.cbIdx],i,o,null):e.apply(n,a)}})}function l(e,t){e[B("OriginalDelegate")]=t}function p(){if(te)return ne;te=!0;try{var e=W.navigator.userAgent;return e.indexOf("MSIE ")===-1&&e.indexOf("Trident/")===-1&&e.indexOf("Edge/")===-1||(ne=!0),ne}catch(t){}}function f(e,t,n){function r(t,n){if(!t)return!1;var r=!0;n&&void 0!==n.useG&&(r=n.useG);var d=n&&n.vh,y=!0;n&&void 0!==n.chkDup&&(y=n.chkDup);var k=!1;n&&void 0!==n.rt&&(k=n.rt);for(var m=t;m&&!m.hasOwnProperty(o);)m=C(m);if(!m&&t[o]&&(m=t),!m)return!1;if(m[c])return!1;var _,b={},T=m[c]=m[o],w=m[B(a)]=m[a],E=m[B(i)]=m[i],S=m[B(s)]=m[s];n&&n.prepend&&(_=m[B(n.prepend)]=m[n.prepend]);var D=function(){if(!b.isExisting)return T.call(b.target,b.eventName,b.capture?g:v,b.options)},Z=function(e){if(!e.isRemoved){var t=oe[e.eventName],n=void 0;t&&(n=t[e.capture?F:q]);var r=n&&e.target[n];if(r)for(var o=0;o<r.length;o++){var a=r[o];if(a===e){r.splice(o,1),e.isRemoved=!0,0===r.length&&(e.allRemoved=!0,e.target[n]=null);break}}}if(e.allRemoved)return w.call(e.target,e.eventName,e.capture?g:v,e.options)},z=function(e){return T.call(b.target,b.eventName,e.invoke,b.options)},O=function(e){return _.call(b.target,b.eventName,e.invoke,b.options)},P=function(e){return w.call(e.target,e.eventName,e.invoke,e.options)},j=r?D:z,I=r?Z:P,L=function(e,t){var n=typeof t;return"function"===n&&e.callback===t||"object"===n&&e.originalDelegate===t},M=n&&n.diff?n.diff:L,R=Zone[Zone.__symbol__("BLACK_LISTED_EVENTS")],H=function(t,n,o,a,i,s){return void 0===i&&(i=!1),void 0===s&&(s=!1),function(){var c=this||e,u=arguments[1];if(!u)return t.apply(this,arguments);var l=!1;if("function"!=typeof u){if(!u.handleEvent)return t.apply(this,arguments);l=!0}if(!d||d(t,u,c,arguments)){var p=arguments[0],f=arguments[2];if(R)for(var h=0;h<R.length;h++)if(p===R[h])return t.apply(this,arguments);var v,g=!1;void 0===f?v=!1:f===!0?v=!0:f===!1?v=!1:(v=!!f&&!!f.capture,g=!!f&&!!f.once);var k,m=Zone.current,_=oe[p];if(_)k=_[v?F:q];else{var T=p+q,w=p+F,E=A+T,S=A+w;oe[p]={},oe[p][q]=E,oe[p][F]=S,k=v?S:E}var D=c[k],Z=!1;if(D){if(Z=!0,y)for(var h=0;h<D.length;h++)if(M(D[h],u))return}else D=c[k]=[];var z,O=c.constructor.name,P=ae[O];P&&(z=P[p]),z||(z=O+n+p),b.options=f,g&&(b.options.once=!1),b.target=c,b.capture=v,b.eventName=p,b.isExisting=Z;var j=r?re:null;j&&(j.taskData=b);var C=m.scheduleEventTask(z,u,j,o,a);return b.target=null,j&&(j.taskData=null),g&&(f.once=!0),C.options=f,C.target=c,C.capture=v,C.eventName=p,l&&(C.originalDelegate=u),s?D.unshift(C):D.push(C),i?c:void 0}}};return m[o]=H(T,u,j,I,k),_&&(m[p]=H(_,f,O,I,k,!0)),m[a]=function(){var t,n=this||e,r=arguments[0],o=arguments[2];t=void 0!==o&&(o===!0||o!==!1&&(!!o&&!!o.capture));var a=arguments[1];if(!a)return w.apply(this,arguments);if(!d||d(w,a,n,arguments)){var i,s=oe[r];s&&(i=s[t?F:q]);var c=i&&n[i];if(c)for(var u=0;u<c.length;u++){var l=c[u];if(M(l,a))return c.splice(u,1),l.isRemoved=!0,0===c.length&&(l.allRemoved=!0,n[i]=null),void l.zone.cancelTask(l)}return w.apply(this,arguments)}},m[i]=function(){for(var t=this||e,n=arguments[0],r=[],o=h(t,n),a=0;a<o.length;a++){var i=o[a],s=i.originalDelegate?i.originalDelegate:i.callback;r.push(s)}return r},m[s]=function(){var t=this||e,n=arguments[0];if(n){var r=oe[n];if(r){var o=r[q],i=r[F],c=t[o],u=t[i];if(c)for(var l=c.slice(),p=0;p<l.length;p++){var f=l[p],h=f.originalDelegate?f.originalDelegate:f.callback;this[a].call(this,n,h,f.options)}if(u)for(var l=u.slice(),p=0;p<l.length;p++){var f=l[p],h=f.originalDelegate?f.originalDelegate:f.callback;this[a].call(this,n,h,f.options)}}}else{for(var d=Object.keys(t),p=0;p<d.length;p++){var v=d[p],g=ie.exec(v),y=g&&g[1];y&&"removeListener"!==y&&this[s].call(this,y)}this[s].call(this,"removeListener")}},l(m[o],T),l(m[a],w),S&&l(m[s],S),E&&l(m[i],E),!0}for(var o=n&&n.add||M,a=n&&n.rm||R,i=n&&n.listeners||"eventListeners",s=n&&n.rmAll||"removeAllListeners",c=B(o),u="."+o+":",p="prependListener",f="."+p+":",d=function(e,t,n){if(!e.isRemoved){var r=e.callback;"object"==typeof r&&r.handleEvent&&(e.callback=function(e){return r.handleEvent(e)},e.originalDelegate=r),e.invoke(e,t,[n]);var o=e.options;if(o&&"object"==typeof o&&o.once){var i=e.originalDelegate?e.originalDelegate:e.callback;t[a].call(t,n.type,i,o)}}},v=function(t){if(t=t||e.event){var n=this||t.target||e,r=n[oe[t.type][q]];if(r)if(1===r.length)d(r[0],n,t);else for(var o=r.slice(),a=0;a<o.length&&(!t||t[se]!==!0);a++)d(o[a],n,t)}},g=function(t){if(t=t||e.event){var n=this||t.target||e,r=n[oe[t.type][F]];if(r)if(1===r.length)d(r[0],n,t);else for(var o=r.slice(),a=0;a<o.length&&(!t||t[se]!==!0);a++)d(o[a],n,t)}},y=[],k=0;k<t.length;k++)y[k]=r(t[k],n);return y}function h(e,t){var n=[];for(var r in e){var o=ie.exec(r),a=o&&o[1];if(a&&(!t||a===t)){var i=e[r];if(i)for(var s=0;s<i.length;s++)n.push(i[s])}}return n}function d(e,t){var n=e.Event;n&&n.prototype&&t.patchMethod(n.prototype,"stopImmediatePropagation",function(e){return function(t,n){t[se]=!0,e&&e.apply(t,n)}})}function v(e,n,r,o){function a(t){function n(){try{t.invoke.apply(this,arguments)}finally{t.data&&t.data.isPeriodic||("number"==typeof r.handleId?delete l[r.handleId]:r.handleId&&(r.handleId[ce]=null))}}var r=t.data;return r.args[0]=n,r.handleId=s.apply(e,r.args),t}function i(e){return u(e.data.handleId)}var s=null,u=null;n+=o,r+=o;var l={};s=c(e,n,function(r){return function(s,c){if("function"==typeof c[0]){var u={handleId:null,isPeriodic:"Interval"===o,delay:"Timeout"===o||"Interval"===o?c[1]||0:null,args:c},p=t(n,c[0],u,a,i);if(!p)return p;var f=p.data.handleId;return"number"==typeof f?l[f]=p:f&&(f[ce]=p),f&&f.ref&&f.unref&&"function"==typeof f.ref&&"function"==typeof f.unref&&(p.ref=f.ref.bind(f),p.unref=f.unref.bind(f)),"number"==typeof f||f?f:p}return r.apply(e,c)}}),u=c(e,r,function(t){return function(n,r){var o,a=r[0];"number"==typeof a?o=l[a]:(o=a&&a[ce],o||(o=a)),o&&"string"==typeof o.type?"notScheduled"!==o.state&&(o.cancelFn&&o.data.isPeriodic||0===o.runCount)&&("number"==typeof a?delete l[a]:a&&(a[ce]=null),o.zone.cancelTask(o)):t.apply(e,r)}})}function g(){Object.defineProperty=function(e,t,n){if(k(e,t))throw new TypeError("Cannot assign to read only property '"+t+"' of "+e);var r=n.configurable;return"prototype"!==t&&(n=m(e,t,n)),_(e,t,n,r)},Object.defineProperties=function(e,t){return Object.keys(t).forEach(function(n){Object.defineProperty(e,n,t[n])}),e},Object.create=function(e,t){return"object"!=typeof t||Object.isFrozen(t)||Object.keys(t).forEach(function(n){t[n]=m(e,n,t[n])}),pe(e,t)},Object.getOwnPropertyDescriptor=function(e,t){var n=le(e,t);return k(e,t)&&(n.configurable=!1),n}}function y(e,t,n){var r=n.configurable;return n=m(e,t,n),_(e,t,n,r)}function k(e,t){return e&&e[fe]&&e[fe][t]}function m(e,t,n){return Object.isFrozen(n)||(n.configurable=!0),n.configurable||(e[fe]||Object.isFrozen(e)||ue(e,fe,{writable:!0,value:{}}),e[fe]&&(e[fe][t]=!0)),n}function _(e,t,n,r){try{return ue(e,t,n)}catch(o){if(!n.configurable)throw o;"undefined"==typeof r?delete n.configurable:n.configurable=r;try{return ue(e,t,n)}catch(o){var a=null;try{a=JSON.stringify(n)}catch(o){a=n.toString()}console.log("Attempting to configure '"+t+"' with descriptor '"+a+"' on object '"+e+"' and got error, giving up: "+o)}}}function b(e,t){var n=t.WebSocket;t.EventTarget||f(t,[n.prototype]),t.WebSocket=function(e,t){var r,o,a=arguments.length>1?new n(e,t):new n(e),s=P(a,"onmessage");return s&&s.configurable===!1?(r=I(a),o=a,[M,R,"send","close"].forEach(function(e){r[e]=function(){var t=L.call(arguments);if(e===M||e===R){var n=t.length>0?t[0]:void 0;if(n){var o=Zone.__symbol__("ON_PROPERTY"+n);a[o]=r[o]}}return a[e].apply(a,t)}})):r=a,i(r,["close","error","message","open"],o),r};var r=t.WebSocket;for(var o in n)r[o]=n[o]}function T(e,t,n){if(!n)return t;var r=n.filter(function(t){return t.target===e});if(!r||0===r.length)return t;var o=r[0].ignoreProperties;return t.filter(function(e){return o.indexOf(e)===-1})}function w(e,t,n,r){var o=T(e,t,n);i(e,o,r)}function E(e,t){if(!K||Y){var n="undefined"!=typeof WebSocket;if(S()){var r=t.__Zone_ignore_on_properties;if(J){var o=window;w(o,Oe.concat(["messageerror"]),r,C(o)),w(Document.prototype,Oe,r),"undefined"!=typeof o.SVGElement&&w(o.SVGElement.prototype,Oe,r),w(Element.prototype,Oe,r),w(HTMLElement.prototype,Oe,r),w(HTMLMediaElement.prototype,ye,r),w(HTMLFrameSetElement.prototype,ve.concat(we),r),w(HTMLBodyElement.prototype,ve.concat(we),r),w(HTMLFrameElement.prototype,Te,r),w(HTMLIFrameElement.prototype,Te,r);var a=o.HTMLMarqueeElement;a&&w(a.prototype,Ee,r);var i=o.Worker;i&&w(i.prototype,ze,r)}w(XMLHttpRequest.prototype,Se,r);var c=t.XMLHttpRequestEventTarget;c&&w(c&&c.prototype,Se,r),"undefined"!=typeof IDBIndex&&(w(IDBIndex.prototype,De,r),w(IDBRequest.prototype,De,r),w(IDBOpenDBRequest.prototype,De,r),w(IDBDatabase.prototype,De,r),w(IDBTransaction.prototype,De,r),w(IDBCursor.prototype,De,r)),n&&w(WebSocket.prototype,Ze,r)}else D(),s("XMLHttpRequest"),n&&b(e,t)}}function S(){if((J||Y)&&!P(HTMLElement.prototype,"onclick")&&"undefined"!=typeof Element){var e=P(Element.prototype,"onclick");if(e&&!e.configurable)return!1}var t="onreadystatechange",n=XMLHttpRequest.prototype,r=P(n,t);if(r){j(n,t,{enumerable:!0,configurable:!0,get:function(){return!0}});var o=new XMLHttpRequest,a=!!o.onreadystatechange;return j(n,t,r||{}),a}var i=B("fake");j(n,t,{enumerable:!0,configurable:!0,get:function(){return this[i]},set:function(e){this[i]=e}});var o=new XMLHttpRequest,s=function(){};o.onreadystatechange=s;var a=o[i]===s;return o.onreadystatechange=null,a}function D(){for(var t=function(t){var n=Oe[t],r="on"+n;self.addEventListener(n,function(t){var n,o,a=t.target;for(o=a?a.constructor.name+"."+r:"unknown."+r;a;)a[r]&&!a[r][Pe]&&(n=e(a[r],o),n[Pe]=a[r],a[r]=n),a=a.parentElement},!0)},n=0;n<Oe.length;n++)t(n)}function Z(e,t){var n="Anchor,Area,Audio,BR,Base,BaseFont,Body,Button,Canvas,Content,DList,Directory,Div,Embed,FieldSet,Font,Form,Frame,FrameSet,HR,Head,Heading,Html,IFrame,Image,Input,Keygen,LI,Label,Legend,Link,Map,Marquee,Media,Menu,Meta,Meter,Mod,OList,Object,OptGroup,Option,Output,Paragraph,Pre,Progress,Quote,Script,Select,Source,Span,Style,TableCaption,TableCell,TableCol,Table,TableRow,TableSection,TextArea,Title,Track,UList,Unknown,Video",r="ApplicationCache,EventSource,FileReader,InputMethodContext,MediaController,MessagePort,Node,Performance,SVGElementInstance,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebKitNamedFlow,Window,Worker,WorkerGlobalScope,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload,IDBRequest,IDBOpenDBRequest,IDBDatabase,IDBTransaction,IDBCursor,DBIndex,WebSocket".split(","),o="EventTarget",a=[],i=e.wtf,s=n.split(",");i?a=s.map(function(e){return"HTML"+e+"Element"}).concat(r):e[o]?a.push(o):a=r;for(var c=e.__Zone_disable_IE_check||!1,u=e.__Zone_enable_cross_context_check||!1,l=p(),h=".addEventListener:",d="[object FunctionWrapper]",v="function __BROWSERTOOLS_CONSOLE_SAFEFUNC() { [native code] }",g=0;g<Oe.length;g++){var y=Oe[g],k=y+q,m=y+F,_=A+k,b=A+m;oe[y]={},oe[y][q]=_,oe[y][F]=b}for(var g=0;g<n.length;g++)for(var T=s[g],w=ae[T]={},E=0;E<Oe.length;E++){var y=Oe[E];w[y]=T+h+y}for(var S=function(e,t,n,r){if(!c&&l)if(u)try{var o=t.toString();if(o===d||o==v)return e.apply(n,r),!1}catch(a){return e.apply(n,r),!1}else{var o=t.toString();if(o===d||o==v)return e.apply(n,r),!1}else if(u)try{t.toString()}catch(a){return e.apply(n,r),!1}return!0},D=[],g=0;g<a.length;g++){var Z=e[a[g]];D.push(Z&&Z.prototype)}return f(e,D,{vh:S}),t.patchEventTarget=f,!0}function z(e,t){d(e,t)}function O(t){if((J||Y)&&"registerElement"in t.document){var n=document.registerElement,r=["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"];document.registerElement=function(t,o){return o&&o.prototype&&r.forEach(function(t){var n="Document.registerElement::"+t,r=o.prototype;if(r.hasOwnProperty(t)){var a=P(r,t);a&&a.value?(a.value=e(a.value,n),y(o.prototype,t,a)):r[t]=e(r[t],n)}else r[t]&&(r[t]=e(r[t],n))}),n.call(document,t,o)},l(document.registerElement,n)}}(function(e){function t(e){c&&c.mark&&c.mark(e)}function n(e,t){c&&c.measure&&c.measure(e,t)}function r(t){0===I&&0===y.length&&(l||e[v]&&(l=e[v].resolve(0)),l?l[g](o):e[d](o,0)),t&&y.push(t)}function o(){if(!k){for(k=!0;y.length;){var e=y;y=[];for(var t=0;t<e.length;t++){var n=e[t];try{n.zone.runTask(n,null,null)}catch(r){P.onUnhandledError(r)}}}P.microtaskDrainDone(),k=!1}}function a(){}function i(e){return"__zone_symbol__"+e}var s="function",c=e.performance;if(t("Zone"),e.Zone)throw new Error("Zone already loaded.");var u=function(){function r(e,t){this._properties=null,this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new f(this,this._parent&&this._parent._zoneDelegate,t)}return r.assertZonePatched=function(){if(e.Promise!==O.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")},Object.defineProperty(r,"root",{get:function(){for(var e=r.current;e.parent;)e=e.parent;return e},enumerable:!0,configurable:!0}),Object.defineProperty(r,"current",{get:function(){return j.zone},enumerable:!0,configurable:!0}),Object.defineProperty(r,"currentTask",{get:function(){return C},enumerable:!0,configurable:!0}),r.__load_patch=function(o,a){if(O.hasOwnProperty(o))throw Error("Already loaded patch: "+o);if(!e["__Zone_disable_"+o]){var i="Zone:"+o;t(i),O[o]=a(e,r,P),n(i,i)}},Object.defineProperty(r.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),r.prototype.get=function(e){var t=this.getZoneWith(e);if(t)return t._properties[e]},r.prototype.getZoneWith=function(e){for(var t=this;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null},r.prototype.fork=function(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)},r.prototype.wrap=function(e,t){if(typeof e!==s)throw new Error("Expecting function got: "+e);var n=this._zoneDelegate.intercept(this,e,t),r=this;return function(){return r.runGuarded(n,this,arguments,t)}},r.prototype.run=function(e,t,n,r){void 0===t&&(t=void 0),void 0===n&&(n=null),void 0===r&&(r=null),j={parent:j,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{j=j.parent}},r.prototype.runGuarded=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),j={parent:j,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(o){if(this._zoneDelegate.handleError(this,o))throw o}}finally{j=j.parent}},r.prototype.runTask=function(e,t,n){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||m).name+"; Execution: "+this.name+")");var r=e.state===_;if(!r||e.type!==z){var o=e.state!=w;o&&e._transitionTo(w,T),e.runCount++;var a=C;C=e,j={parent:j,zone:this};try{e.type==Z&&e.data&&!e.data.isPeriodic&&(e.cancelFn=null);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(i){if(this._zoneDelegate.handleError(this,i))throw i}}finally{e.state!==_&&e.state!==S&&(e.type==z||e.data&&e.data.isPeriodic?o&&e._transitionTo(T,w):(e.runCount=0,this._updateTaskCount(e,-1),o&&e._transitionTo(_,w,_))),j=j.parent,C=a}}},r.prototype.scheduleTask=function(e){if(e.zone&&e.zone!==this)for(var t=this;t;){if(t===e.zone)throw Error("can not reschedule task to "+this.name+" which is descendants of the original zone "+e.zone.name);t=t.parent}e._transitionTo(b,_);var n=[];e._zoneDelegates=n,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(r){throw e._transitionTo(S,b,_),this._zoneDelegate.handleError(this,r),r}return e._zoneDelegates===n&&this._updateTaskCount(e,1),e.state==b&&e._transitionTo(T,b),e},r.prototype.scheduleMicroTask=function(e,t,n,r){return this.scheduleTask(new h(D,e,t,n,r,null))},r.prototype.scheduleMacroTask=function(e,t,n,r,o){return this.scheduleTask(new h(Z,e,t,n,r,o))},r.prototype.scheduleEventTask=function(e,t,n,r,o){return this.scheduleTask(new h(z,e,t,n,r,o))},r.prototype.cancelTask=function(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||m).name+"; Execution: "+this.name+")");e._transitionTo(E,T,w);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(S,E),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(_,E),e.runCount=0,e},r.prototype._updateTaskCount=function(e,t){var n=e._zoneDelegates;t==-1&&(e._zoneDelegates=null);for(var r=0;r<n.length;r++)n[r]._updateTaskCount(e.type,t)},r}();u.__symbol__=i;var l,p={name:"",onHasTask:function(e,t,n,r){return e.hasTask(n,r)},onScheduleTask:function(e,t,n,r){return e.scheduleTask(n,r)},onInvokeTask:function(e,t,n,r,o,a){return e.invokeTask(n,r,o,a)},onCancelTask:function(e,t,n,r){return e.cancelTask(n,r)}},f=function(){function e(e,t,n){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=e,this._parentDelegate=t,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this.zone:t.zone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this.zone:t.zone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this.zone:t.zone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this.zone:t.zone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this.zone:t.zone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this.zone:t.zone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this.zone:t.zone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;var r=n&&n.onHasTask,o=t&&t._hasTaskZS;(r||o)&&(this._hasTaskZS=r?n:p,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=e,n.onScheduleTask||(this._scheduleTaskZS=p,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this.zone),n.onInvokeTask||(this._invokeTaskZS=p,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this.zone),n.onCancelTask||(this._cancelTaskZS=p,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this.zone))}return e.prototype.fork=function(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new u(e,t)},e.prototype.intercept=function(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t},e.prototype.invoke=function(e,t,n,r,o){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,r,o):t.apply(n,r)},e.prototype.handleError=function(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)},e.prototype.scheduleTask=function(e,t){var n=t;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),n||(n=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=D)throw new Error("Task is missing scheduleFn.");r(t)}return n},e.prototype.invokeTask=function(e,t,n,r){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,r):t.callback.apply(n,r)},e.prototype.cancelTask=function(e,t){var n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");n=t.cancelFn(t)}return n},e.prototype.hasTask=function(e,t){try{return this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(n){this.handleError(e,n)}},e.prototype._updateTaskCount=function(e,t){var n=this._taskCounts,r=n[e],o=n[e]=r+t;if(o<0)throw new Error("More tasks executed then were scheduled.");if(0==r||0==o){var a={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e};this.hasTask(this.zone,a)}},e}(),h=function(){function t(n,r,o,a,i,s){this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=n,this.source=r,this.data=a,this.scheduleFn=i,this.cancelFn=s,this.callback=o;var c=this;n===z&&a&&a.useG?this.invoke=t.invokeTask:this.invoke=function(){return t.invokeTask.call(e,c,this,arguments)}}return t.invokeTask=function(e,t,n){e||(e=this),I++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{1==I&&o(),I--}},Object.defineProperty(t.prototype,"zone",{get:function(){return this._zone},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!0,configurable:!0}),t.prototype.cancelScheduleRequest=function(){this._transitionTo(_,b)},t.prototype._transitionTo=function(e,t,n){if(this._state!==t&&this._state!==n)throw new Error(this.type+" '"+this.source+"': can not transition to '"+e+"', expecting state '"+t+"'"+(n?" or '"+n+"'":"")+", was '"+this._state+"'.");this._state=e,e==_&&(this._zoneDelegates=null)},t.prototype.toString=function(){return this.data&&"undefined"!=typeof this.data.handleId?this.data.handleId:Object.prototype.toString.call(this)},t.prototype.toJSON=function(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}},t}(),d=i("setTimeout"),v=i("Promise"),g=i("then"),y=[],k=!1,m={name:"NO ZONE"},_="notScheduled",b="scheduling",T="scheduled",w="running",E="canceling",S="unknown",D="microTask",Z="macroTask",z="eventTask",O={},P={symbol:i,currentZoneFrame:function(){return j},onUnhandledError:a,microtaskDrainDone:a,scheduleMicroTask:r,showUncaughtError:function(){return!u[i("ignoreConsoleErrorUncaughtError")]},patchEventTarget:function(){return[]},patchOnProperties:a,patchMethod:function(){return a},bindArguments:function(){return null},setNativePromise:function(e){e&&typeof e.resolve===s&&(l=e.resolve(0))}},j={parent:null,zone:new u(null,null)},C=null,I=0;return n("Zone","Zone"),e.Zone=u})("undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global);Zone.__load_patch("ZoneAwarePromise",function(e,t,n){function r(e){if(e&&e.toString===Object.prototype.toString){var t=e.constructor&&e.constructor.name;return(t?t:"")+": "+JSON.stringify(e)}return e?e.toString():Object.prototype.toString.call(e)}function o(e){n.onUnhandledError(e);try{var r=t[b];r&&"function"==typeof r&&r.call(this,e)}catch(o){}}function a(e){return e&&e.then}function i(e){return e}function s(e){return L.reject(e)}function c(e,t){return function(n){try{u(e,t,n)}catch(r){u(e,!1,r)}}}function u(e,o,a){var i=O();if(e===a)throw new TypeError(P);if(e[T]===S){var s=null;try{"object"!=typeof a&&"function"!=typeof a||(s=a&&a.then)}catch(f){return i(function(){u(e,!1,f)})(),e}if(o!==Z&&a instanceof L&&a.hasOwnProperty(T)&&a.hasOwnProperty(w)&&a[T]!==S)l(a),u(e,a[T],a[w]);else if(o!==Z&&"function"==typeof s)try{s.call(a,i(c(e,o)),i(c(e,!1)))}catch(f){i(function(){u(e,!1,f)})()}else{e[T]=o;var h=e[w];if(e[w]=a,o===Z&&a instanceof Error){var d=t.currentTask&&t.currentTask.data&&t.currentTask.data[_];d&&v(a,j,{configurable:!0,enumerable:!1,writable:!0,value:d})}for(var g=0;g<h.length;)p(e,h[g++],h[g++],h[g++],h[g++]);if(0==h.length&&o==Z){e[T]=z;try{throw new Error("Uncaught (in promise): "+r(a)+(a&&a.stack?"\n"+a.stack:""))}catch(f){var k=f;k.rejection=a,k.promise=e,k.zone=t.current,k.task=t.currentTask,y.push(k),n.scheduleMicroTask()}}}}return e}function l(e){if(e[T]===z){try{var n=t[C];n&&"function"==typeof n&&n.call(this,{rejection:e[w],promise:e})}catch(r){}e[T]=Z;for(var o=0;o<y.length;o++)e===y[o].promise&&y.splice(o,1)}}function p(e,t,n,r,o){l(e);var a=e[T]?"function"==typeof r?r:i:"function"==typeof o?o:s;t.scheduleMicroTask(E,function(){try{u(n,!0,t.run(a,void 0,[e[w]]))}catch(r){u(n,!1,r)}})}function f(e){var t=e.prototype,n=t.then;t[m]=n;var r=d(e.prototype,"then");r&&r.writable===!1&&r.configurable&&v(e.prototype,"then",{writable:!0}),e.prototype.then=function(e,t){var r=this,o=new L(function(e,t){n.call(r,e,t)});return o.then(e,t)},e[x]=!0}function h(e){return function(){var t=e.apply(this,arguments);if(t instanceof L)return t;var n=t.constructor;return n[x]||f(n),t}}var d=Object.getOwnPropertyDescriptor,v=Object.defineProperty,g=n.symbol,y=[],k=g("Promise"),m=g("then"),_="__creationTrace__";n.onUnhandledError=function(e){if(n.showUncaughtError()){var t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=function(){for(;y.length;)for(var e=function(){var e=y.shift();try{e.zone.runGuarded(function(){throw e})}catch(t){o(t)}};y.length;)e()};var b=g("unhandledPromiseRejectionHandler"),T=g("state"),w=g("value"),E="Promise.then",S=null,D=!0,Z=!1,z=0,O=function(){var e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},P="Promise resolved with itself",j=g("currentTaskTrace"),C=g("rejectionHandledHandler"),I="function ZoneAwarePromise() { [native code] }",L=function(){function e(t){var n=this;if(!(n instanceof e))throw new Error("Must be an instanceof Promise.");n[T]=S,n[w]=[];try{t&&t(c(n,D),c(n,Z))}catch(r){u(n,!1,r)}}return e.toString=function(){return I},e.resolve=function(e){return u(new this(null),D,e)},e.reject=function(e){return u(new this(null),Z,e)},e.race=function(e){function t(e){i&&(i=r(e))}function n(e){i&&(i=o(e))}for(var r,o,i=new this(function(e,t){r=e,o=t}),s=0,c=e;s<c.length;s++){var u=c[s];a(u)||(u=this.resolve(u)),u.then(t,n)}return i},e.all=function(e){for(var t,n,r=new this(function(e,r){t=e,n=r}),o=0,i=[],s=0,c=e;s<c.length;s++){var u=c[s];a(u)||(u=this.resolve(u)),u.then(function(e){return function(n){i[e]=n,o--,o||t(i)}}(o),n),o++}return o||t(i),r},e.prototype.then=function(e,n){var r=new this.constructor(null),o=t.current;return this[T]==S?this[w].push(o,r,e,n):p(this,o,r,e,n),r},e.prototype["catch"]=function(e){return this.then(null,e)},e}();L.resolve=L.resolve,L.reject=L.reject,L.race=L.race,L.all=L.all;var M=e[k]=e.Promise,R=t.__symbol__("ZoneAwarePromise"),H=d(e,"Promise");H&&!H.configurable||(H&&delete H.writable,H&&delete H.value,H||(H={configurable:!0,enumerable:!0}),H.get=function(){return e[R]?e[R]:e[k]},H.set=function(t){t===L?e[R]=t:(e[k]=t,t.prototype[m]||f(t),n.setNativePromise(t))},v(e,"Promise",H)),e.Promise=L;var x=g("thenPatched");if(M){f(M);var F=e.fetch;"function"==typeof F&&(e.fetch=h(F))}return Promise[t.__symbol__("uncaughtPromiseErrors")]=y,L});var P=Object.getOwnPropertyDescriptor,j=Object.defineProperty,C=Object.getPrototypeOf,I=Object.create,L=Array.prototype.slice,M="addEventListener",R="removeEventListener",H=Zone.__symbol__(M),x=Zone.__symbol__(R),F="true",q="false",A="__zone_symbol__",B=Zone.__symbol__,N="undefined"!=typeof window,W=N?window:void 0,X=N&&W||"object"==typeof self&&self||global,G="removeAttribute",U=[null],V="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,K=!("nw"in X)&&"undefined"!=typeof X.process&&"[object process]"==={}.toString.call(X.process),J=!K&&!V&&!(!N||!W.HTMLElement),Y="undefined"!=typeof X.process&&"[object process]"==={}.toString.call(X.process)&&!V&&!(!N||!W.HTMLElement),Q={},$=function(e){if(e=e||X.event){var t=Q[e.type];t||(t=Q[e.type]=B("ON_PROPERTY"+e.type));var n=this||e.target||X,r=n[t],o=r&&r.apply(this,arguments);return void 0==o||o||e.preventDefault(),o}},ee=B("originalInstance"),te=!1,ne=!1;Zone.__load_patch("toString",function(e,t){var n=t.__zone_symbol__originalToString=Function.prototype.toString,r=B("OriginalDelegate"),o=B("Promise"),a=B("Error");Function.prototype.toString=function(){if("function"==typeof this){var t=this[r];if(t)return"function"==typeof t?n.apply(this[r],arguments):Object.prototype.toString.call(t);if(this===Promise){var i=e[o];if(i)return n.apply(i,arguments)}if(this===Error){var s=e[a];if(s)return n.apply(s,arguments)}}return n.apply(this,arguments)};var i=Object.prototype.toString,s="[object Promise]";Object.prototype.toString=function(){return this instanceof Promise?s:i.apply(this,arguments)}});var re={useG:!0},oe={},ae={},ie=/^__zone_symbol__(\w+)(true|false)$/,se="__zone_symbol__propagationStopped",ce=B("zoneTask"),ue=Object[B("defineProperty")]=Object.defineProperty,le=Object[B("getOwnPropertyDescriptor")]=Object.getOwnPropertyDescriptor,pe=Object.create,fe=B("unconfigurables"),he=["abort","animationcancel","animationend","animationiteration","auxclick","beforeinput","blur","cancel","canplay","canplaythrough","change","compositionstart","compositionupdate","compositionend","cuechange","click","close","contextmenu","curechange","dblclick","drag","dragend","dragenter","dragexit","dragleave","dragover","drop","durationchange","emptied","ended","error","focus","focusin","focusout","gotpointercapture","input","invalid","keydown","keypress","keyup","load","loadstart","loadeddata","loadedmetadata","lostpointercapture","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","mousewheel","orientationchange","pause","play","playing","pointercancel","pointerdown","pointerenter","pointerleave","pointerlockchange","mozpointerlockchange","webkitpointerlockerchange","pointerlockerror","mozpointerlockerror","webkitpointerlockerror","pointermove","pointout","pointerover","pointerup","progress","ratechange","reset","resize","scroll","seeked","seeking","select","selectionchange","selectstart","show","sort","stalled","submit","suspend","timeupdate","volumechange","touchcancel","touchmove","touchstart","touchend","transitioncancel","transitionend","waiting","wheel"],de=["afterscriptexecute","beforescriptexecute","DOMContentLoaded","fullscreenchange","mozfullscreenchange","webkitfullscreenchange","msfullscreenchange","fullscreenerror","mozfullscreenerror","webkitfullscreenerror","msfullscreenerror","readystatechange","visibilitychange"],ve=["absolutedeviceorientation","afterinput","afterprint","appinstalled","beforeinstallprompt","beforeprint","beforeunload","devicelight","devicemotion","deviceorientation","deviceorientationabsolute","deviceproximity","hashchange","languagechange","message","mozbeforepaint","offline","online","paint","pageshow","pagehide","popstate","rejectionhandled","storage","unhandledrejection","unload","userproximity","vrdisplyconnected","vrdisplaydisconnected","vrdisplaypresentchange"],ge=["beforecopy","beforecut","beforepaste","copy","cut","paste","dragstart","loadend","animationstart","search","transitionrun","transitionstart","webkitanimationend","webkitanimationiteration","webkitanimationstart","webkittransitionend"],ye=["encrypted","waitingforkey","msneedkey","mozinterruptbegin","mozinterruptend"],ke=["activate","afterupdate","ariarequest","beforeactivate","beforedeactivate","beforeeditfocus","beforeupdate","cellchange","controlselect","dataavailable","datasetchanged","datasetcomplete","errorupdate","filterchange","layoutcomplete","losecapture","move","moveend","movestart","propertychange","resizeend","resizestart","rowenter","rowexit","rowsdelete","rowsinserted","command","compassneedscalibration","deactivate","help","mscontentzoom","msmanipulationstatechanged","msgesturechange","msgesturedoubletap","msgestureend","msgesturehold","msgesturestart","msgesturetap","msgotpointercapture","msinertiastart","mslostpointercapture","mspointercancel","mspointerdown","mspointerenter","mspointerhover","mspointerleave","mspointermove","mspointerout","mspointerover","mspointerup","pointerout","mssitemodejumplistitemremoved","msthumbnailclick","stop","storagecommit"],me=["webglcontextrestored","webglcontextlost","webglcontextcreationerror"],_e=["autocomplete","autocompleteerror"],be=["toggle"],Te=["load"],we=["blur","error","focus","load","resize","scroll","messageerror"],Ee=["bounce","finish","start"],Se=["loadstart","progress","abort","error","load","progress","timeout","loadend","readystatechange"],De=["upgradeneeded","complete","abort","success","error","blocked","versionchange","close"],Ze=["close","error","open","message"],ze=["error","message"],Oe=he.concat(me,_e,be,de,ve,ge,ke),Pe=B("unbound");
Zone.__load_patch("util",function(e,t,r){r.patchOnProperties=i,r.patchMethod=c,r.bindArguments=n}),Zone.__load_patch("timers",function(e){var t="set",n="clear";v(e,t,n,"Timeout"),v(e,t,n,"Interval"),v(e,t,n,"Immediate")}),Zone.__load_patch("requestAnimationFrame",function(e){v(e,"request","cancel","AnimationFrame"),v(e,"mozRequest","mozCancel","AnimationFrame"),v(e,"webkitRequest","webkitCancel","AnimationFrame")}),Zone.__load_patch("blocking",function(e,t){for(var n=["alert","prompt","confirm"],r=0;r<n.length;r++){var o=n[r];c(e,o,function(n,r,o){return function(r,a){return t.current.run(n,e,a,o)}})}}),Zone.__load_patch("EventTarget",function(e,t,n){var r=t.__symbol__("BLACK_LISTED_EVENTS");e[r]&&(t[r]=e[r]),z(e,n),Z(e,n);var o=e.XMLHttpRequestEventTarget;o&&o.prototype&&n.patchEventTarget(e,[o.prototype]),s("MutationObserver"),s("WebKitMutationObserver"),s("IntersectionObserver"),s("FileReader")}),Zone.__load_patch("on_property",function(e,t,n){E(n,e),g(),O(e)}),Zone.__load_patch("canvas",function(e){var t=e.HTMLCanvasElement;"undefined"!=typeof t&&t.prototype&&t.prototype.toBlob&&u(t.prototype,"toBlob",function(e,t){return{name:"HTMLCanvasElement.toBlob",target:e,cbIdx:0,args:t}})}),Zone.__load_patch("XHR",function(e,n){function r(e){function n(e){return e[o]}function r(e){XMLHttpRequest[s]=!1;var t=e.data,n=t.target,r=n[i];h||(h=n[H],d=n[x]),r&&d.call(n,y,r);var a=n[i]=function(){n.readyState===n.DONE&&!t.aborted&&XMLHttpRequest[s]&&e.state===k&&e.invoke()};h.call(n,y,a);var c=n[o];return c||(n[o]=e),b.apply(n,t.args),XMLHttpRequest[s]=!0,e}function l(){}function p(e){var t=e.data;return t.aborted=!0,T.apply(t.target,t.args)}var f=XMLHttpRequest.prototype,h=f[H],d=f[x];if(!h){var v=e.XMLHttpRequestEventTarget;if(v){var g=v.prototype;h=g[H],d=g[x]}}var y="readystatechange",k="scheduled",m=c(f,"open",function(){return function(e,t){return e[a]=0==t[2],e[u]=t[1],m.apply(e,t)}}),_="XMLHttpRequest.send",b=c(f,"send",function(){return function(e,n){if(e[a])return b.apply(e,n);var o={target:e,url:e[u],isPeriodic:!1,delay:null,args:n,aborted:!1};return t(_,l,o,r,p)}}),T=c(f,"abort",function(){return function(e){var t=n(e);if(t&&"string"==typeof t.type){if(null==t.cancelFn||t.data&&t.data.aborted)return;t.zone.cancelTask(t)}}})}r(e);var o=B("xhrTask"),a=B("xhrSync"),i=B("xhrListener"),s=B("xhrScheduled"),u=B("xhrURL")}),Zone.__load_patch("geolocation",function(e){e.navigator&&e.navigator.geolocation&&r(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),Zone.__load_patch("PromiseRejectionEvent",function(e,t){function n(t){return function(n){var r=h(e,t);r.forEach(function(r){var o=e.PromiseRejectionEvent;if(o){var a=new o(t,{promise:n.promise,reason:n.rejection});r.invoke(a)}})}}e.PromiseRejectionEvent&&(t[B("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),t[B("rejectionHandledHandler")]=n("rejectionhandled"))})});

@@ -15,3 +15,3 @@ /**

import {patchTimer} from '../common/timers';
import {patchArguments, patchClass, patchMacroTask, patchMethod, patchOnProperties, patchPrototype, wrapFunctionArgs, zoneSymbol} from '../common/utils';
import {bindArguments, patchClass, patchMacroTask, patchMethod, patchOnProperties, patchPrototype, scheduleMacroTaskWithCurrentZone, ZONE_SYMBOL_ADD_EVENT_LISTENER, ZONE_SYMBOL_REMOVE_EVENT_LISTENER, zoneSymbol} from '../common/utils';

@@ -26,6 +26,6 @@ import {propertyPatch} from './define-property';

api.patchMethod = patchMethod;
api.patchArguments = patchArguments;
api.bindArguments = bindArguments;
});
Zone.__load_patch('timers', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
Zone.__load_patch('timers', (global: any) => {
const set = 'set';

@@ -38,3 +38,3 @@ const clear = 'clear';

Zone.__load_patch('requestAnimationFrame', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
Zone.__load_patch('requestAnimationFrame', (global: any) => {
patchTimer(global, 'request', 'cancel', 'AnimationFrame');

@@ -45,3 +45,3 @@ patchTimer(global, 'mozRequest', 'mozCancel', 'AnimationFrame');

Zone.__load_patch('blocking', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
Zone.__load_patch('blocking', (global: any, Zone: ZoneType) => {
const blockingMethods = ['alert', 'prompt', 'confirm'];

@@ -84,3 +84,3 @@ for (let i = 0; i < blockingMethods.length; i++) {

Zone.__load_patch('canvas', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
Zone.__load_patch('canvas', (global: any) => {
const HTMLCanvasElement = global['HTMLCanvasElement'];

@@ -90,3 +90,3 @@ if (typeof HTMLCanvasElement !== 'undefined' && HTMLCanvasElement.prototype &&

patchMacroTask(HTMLCanvasElement.prototype, 'toBlob', (self: any, args: any[]) => {
return {name: 'HTMLCanvasElement.toBlob', target: self, callbackIndex: 0, args: args};
return {name: 'HTMLCanvasElement.toBlob', target: self, cbIdx: 0, args: args};
});

@@ -96,4 +96,4 @@ }

Zone.__load_patch('XHR', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
// Treat XMLHTTPRequest as a macrotask.
Zone.__load_patch('XHR', (global: any, Zone: ZoneType) => {
// Treat XMLHttpRequest as a macrotask.
patchXHR(global);

@@ -115,17 +115,16 @@

function patchXHR(window: any) {
const XMLHttpRequestPrototype: any = XMLHttpRequest.prototype;
function findPendingTask(target: any) {
const pendingTask: Task = target[XHR_TASK];
return pendingTask;
return target[XHR_TASK];
}
const SYMBOL_ADDEVENTLISTENER = zoneSymbol('addEventListener');
const SYMBOL_REMOVEEVENTLISTENER = zoneSymbol('removeEventListener');
let oriAddListener = (XMLHttpRequest.prototype as any)[SYMBOL_ADDEVENTLISTENER];
let oriRemoveListener = (XMLHttpRequest.prototype as any)[SYMBOL_REMOVEEVENTLISTENER];
let oriAddListener = XMLHttpRequestPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];
let oriRemoveListener = XMLHttpRequestPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];
if (!oriAddListener) {
const XMLHttpRequestEventTarget = window['XMLHttpRequestEventTarget'];
if (XMLHttpRequestEventTarget) {
oriAddListener = XMLHttpRequestEventTarget.prototype[SYMBOL_ADDEVENTLISTENER];
oriRemoveListener = XMLHttpRequestEventTarget.prototype[SYMBOL_REMOVEEVENTLISTENER];
const XMLHttpRequestEventTargetPrototype = XMLHttpRequestEventTarget.prototype;
oriAddListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];
oriRemoveListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];
}

@@ -144,8 +143,8 @@ }

if (!oriAddListener) {
oriAddListener = target[SYMBOL_ADDEVENTLISTENER];
oriRemoveListener = target[SYMBOL_REMOVEEVENTLISTENER];
oriAddListener = target[ZONE_SYMBOL_ADD_EVENT_LISTENER];
oriRemoveListener = target[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];
}
if (listener) {
oriRemoveListener.apply(target, [READY_STATE_CHANGE, listener]);
oriRemoveListener.call(target, READY_STATE_CHANGE, listener);
}

@@ -161,3 +160,3 @@ const newListener = target[XHR_LISTENER] = () => {

};
oriAddListener.apply(target, [READY_STATE_CHANGE, newListener]);
oriAddListener.call(target, READY_STATE_CHANGE, newListener);

@@ -183,4 +182,4 @@ const storedTask: Task = target[XHR_TASK];

const openNative: Function = patchMethod(
window.XMLHttpRequest.prototype, 'open', () => function(self: any, args: any[]) {
const openNative: Function =
patchMethod(XMLHttpRequestPrototype, 'open', () => function(self: any, args: any[]) {
self[XHR_SYNC] = args[2] == false;

@@ -192,5 +191,4 @@ self[XHR_URL] = args[1];

const XMLHTTPREQUEST_SOURCE = 'XMLHttpRequest.send';
const sendNative: Function = patchMethod(
window.XMLHttpRequest.prototype, 'send', () => function(self: any, args: any[]) {
const zone = Zone.current;
const sendNative: Function =
patchMethod(XMLHttpRequestPrototype, 'send', () => function(self: any, args: any[]) {
if (self[XHR_SYNC]) {

@@ -208,3 +206,3 @@ // if the XHR is sync there is no task to schedule, just execute the code.

};
return zone.scheduleMacroTask(
return scheduleMacroTaskWithCurrentZone(
XMLHTTPREQUEST_SOURCE, placeholderCallback, options, scheduleTask, clearTask);

@@ -214,26 +212,22 @@ }

const STRING_TYPE = 'string';
const abortNative = patchMethod(
window.XMLHttpRequest.prototype, 'abort',
(delegate: Function) => function(self: any, args: any[]) {
const task: Task = findPendingTask(self);
if (task && typeof task.type == STRING_TYPE) {
// If the XHR has already completed, do nothing.
// If the XHR has already been aborted, do nothing.
// Fix #569, call abort multiple times before done will cause
// macroTask task count be negative number
if (task.cancelFn == null || (task.data && (<XHROptions>task.data).aborted)) {
return;
}
task.zone.cancelTask(task);
}
// Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no
// task
// to cancel. Do nothing.
});
const abortNative = patchMethod(XMLHttpRequestPrototype, 'abort', () => function(self: any) {
const task: Task = findPendingTask(self);
if (task && typeof task.type == 'string') {
// If the XHR has already completed, do nothing.
// If the XHR has already been aborted, do nothing.
// Fix #569, call abort multiple times before done will cause
// macroTask task count be negative number
if (task.cancelFn == null || (task.data && (<XHROptions>task.data).aborted)) {
return;
}
task.zone.cancelTask(task);
}
// Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no
// task
// to cancel. Do nothing.
});
}
});
Zone.__load_patch('geolocation', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
Zone.__load_patch('geolocation', (global: any) => {
/// GEO_LOCATION

@@ -245,10 +239,3 @@ if (global['navigator'] && global['navigator'].geolocation) {

Zone.__load_patch('getUserMedia', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
let navigator = global['navigator'];
if (navigator && navigator.getUserMedia) {
navigator.getUserMedia = wrapFunctionArgs(navigator.getUserMedia);
}
});
Zone.__load_patch('PromiseRejectionEvent', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
Zone.__load_patch('PromiseRejectionEvent', (global: any, Zone: ZoneType) => {
// handle unhandled promise rejection

@@ -255,0 +242,0 @@ function findPromiseRejectionHandler(evtName: string) {

@@ -20,5 +20,2 @@ /**

const unconfigurablesKey = zoneSymbol('unconfigurables');
const PROTOTYPE = 'prototype';
const OBJECT = 'object';
const UNDEFINED = 'undefined';

@@ -31,3 +28,3 @@ export function propertyPatch() {

const originalConfigurableFlag = desc.configurable;
if (prop !== PROTOTYPE) {
if (prop !== 'prototype') {
desc = rewriteDescriptor(obj, prop, desc);

@@ -46,3 +43,3 @@ }

Object.create = <any>function(obj: any, proto: any) {
if (typeof proto === OBJECT && !Object.isFrozen(proto)) {
if (typeof proto === 'object' && !Object.isFrozen(proto)) {
Object.keys(proto).forEach(function(prop) {

@@ -98,3 +95,3 @@ proto[prop] = rewriteDescriptor(obj, prop, proto[prop]);

// retry with the original flag value
if (typeof originalConfigurableFlag == UNDEFINED) {
if (typeof originalConfigurableFlag == 'undefined') {
delete desc.configurable;

@@ -101,0 +98,0 @@ } else {

@@ -9,4 +9,4 @@ /**

import {FALSE_STR, globalSources, patchEventPrototype, patchEventTarget, TRUE_STR, ZONE_SYMBOL_PREFIX, zoneSymbolEventNames} from '../common/events';
import {attachOriginToPatched, isIEOrEdge, zoneSymbol} from '../common/utils';
import {globalSources, patchEventPrototype, patchEventTarget, zoneSymbolEventNames} from '../common/events';
import {FALSE_STR, isIEOrEdge, TRUE_STR, ZONE_SYMBOL_PREFIX} from '../common/utils';

@@ -105,3 +105,5 @@ import {eventNames} from './property-descriptor';

}
patchEventTarget(_global, apiTypes, {validateHandler: checkIEAndCrossContext});
// vh is validateHandler to check event handler
// is valid or not(for security check)
patchEventTarget(_global, apiTypes, {vh: checkIEAndCrossContext});
api.patchEventTarget = patchEventTarget;

@@ -108,0 +110,0 @@

@@ -13,3 +13,3 @@ /**

import {isBrowser, isMix, isNode, patchClass, patchOnProperties, zoneSymbol} from '../common/utils';
import {isBrowser, isMix, isNode, ObjectDefineProperty, ObjectGetOwnPropertyDescriptor, ObjectGetPrototypeOf, patchClass, patchOnProperties, wrapWithCurrentZone, zoneSymbol} from '../common/utils';

@@ -274,12 +274,13 @@ import * as webSocketPatch from './websocket';

if (isBrowser) {
const internalWindow: any = window;
// in IE/Edge, onProp not exist in window object, but in WindowPrototype
// so we need to pass WindowPrototype to check onProp exist or not
patchFilteredProperties(
window, eventNames.concat(['messageerror']), ignoreProperties,
Object.getPrototypeOf(window));
internalWindow, eventNames.concat(['messageerror']), ignoreProperties,
ObjectGetPrototypeOf(internalWindow));
patchFilteredProperties(Document.prototype, eventNames, ignoreProperties);
if (typeof(<any>window)['SVGElement'] !== 'undefined') {
if (typeof internalWindow['SVGElement'] !== 'undefined') {
patchFilteredProperties(
(<any>window)['SVGElement'].prototype, eventNames, ignoreProperties);
internalWindow['SVGElement'].prototype, eventNames, ignoreProperties);
}

@@ -297,7 +298,7 @@ patchFilteredProperties(Element.prototype, eventNames, ignoreProperties);

const HTMLMarqueeElement = (window as any)['HTMLMarqueeElement'];
const HTMLMarqueeElement = internalWindow['HTMLMarqueeElement'];
if (HTMLMarqueeElement) {
patchFilteredProperties(HTMLMarqueeElement.prototype, marqueeEventNames, ignoreProperties);
}
const Worker = (window as any)['Worker'];
const Worker = internalWindow['Worker'];
if (Worker) {

@@ -336,12 +337,15 @@ patchFilteredProperties(Worker.prototype, workerEventNames, ignoreProperties);

function canPatchViaPropertyDescriptor() {
if ((isBrowser || isMix) && !Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'onclick') &&
if ((isBrowser || isMix) && !ObjectGetOwnPropertyDescriptor(HTMLElement.prototype, 'onclick') &&
typeof Element !== 'undefined') {
// WebKit https://bugs.webkit.org/show_bug.cgi?id=134364
// IDL interface attributes are not configurable
const desc = Object.getOwnPropertyDescriptor(Element.prototype, 'onclick');
const desc = ObjectGetOwnPropertyDescriptor(Element.prototype, 'onclick');
if (desc && !desc.configurable) return false;
}
const xhrDesc = Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, 'onreadystatechange');
const ON_READY_STATE_CHANGE = 'onreadystatechange';
const XMLHttpRequestPrototype = XMLHttpRequest.prototype;
const xhrDesc = ObjectGetOwnPropertyDescriptor(XMLHttpRequestPrototype, ON_READY_STATE_CHANGE);
// add enumerable and configurable here because in opera

@@ -354,3 +358,3 @@ // by default XMLHttpRequest.prototype.onreadystatechange is undefined

if (xhrDesc) {
Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', {
ObjectDefineProperty(XMLHttpRequestPrototype, ON_READY_STATE_CHANGE, {
enumerable: true,

@@ -365,7 +369,7 @@ configurable: true,

// restore original desc
Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', xhrDesc || {});
ObjectDefineProperty(XMLHttpRequestPrototype, ON_READY_STATE_CHANGE, xhrDesc || {});
return result;
} else {
const SYMBOL_FAKE_ONREADYSTATECHANGE = zoneSymbol('fakeonreadystatechange');
Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', {
const SYMBOL_FAKE_ONREADYSTATECHANGE = zoneSymbol('fake');
ObjectDefineProperty(XMLHttpRequestPrototype, ON_READY_STATE_CHANGE, {
enumerable: true,

@@ -407,3 +411,3 @@ configurable: true,

if (elt[onproperty] && !elt[onproperty][unboundKey]) {
bound = Zone.current.wrap(elt[onproperty], source);
bound = wrapWithCurrentZone(elt[onproperty], source);
bound[unboundKey] = elt[onproperty];

@@ -410,0 +414,0 @@ elt[onproperty] = bound;

@@ -9,3 +9,3 @@ /**

import {attachOriginToPatched, isBrowser, isMix} from '../common/utils';
import {attachOriginToPatched, isBrowser, isMix, ObjectGetOwnPropertyDescriptor, wrapWithCurrentZone} from '../common/utils';

@@ -27,12 +27,13 @@ import {_redefineProperty} from './define-property';

const source = 'Document.registerElement::' + callback;
if (opts.prototype.hasOwnProperty(callback)) {
const descriptor = Object.getOwnPropertyDescriptor(opts.prototype, callback);
const prototype = opts.prototype;
if (prototype.hasOwnProperty(callback)) {
const descriptor = ObjectGetOwnPropertyDescriptor(prototype, callback);
if (descriptor && descriptor.value) {
descriptor.value = Zone.current.wrap(descriptor.value, source);
descriptor.value = wrapWithCurrentZone(descriptor.value, source);
_redefineProperty(opts.prototype, callback, descriptor);
} else {
opts.prototype[callback] = Zone.current.wrap(opts.prototype[callback], source);
prototype[callback] = wrapWithCurrentZone(prototype[callback], source);
}
} else if (opts.prototype[callback]) {
opts.prototype[callback] = Zone.current.wrap(opts.prototype[callback], source);
} else if (prototype[callback]) {
prototype[callback] = wrapWithCurrentZone(prototype[callback], source);
}

@@ -42,3 +43,3 @@ });

return _registerElement.apply(document, [name, opts]);
return _registerElement.call(document, name, opts);
};

@@ -45,0 +46,0 @@

@@ -24,2 +24,2 @@ /**

}
});
});

@@ -13,4 +13,3 @@ /**

api.patchEventTarget(
global, [global['MediaQueryList'].prototype],
{addEventListenerFnName: 'addListener', removeEventListenerFnName: 'removeListener'});
});
global, [global['MediaQueryList'].prototype], {add: 'addListener', rm: 'removeListener'});
});

@@ -18,2 +18,2 @@ /**

api.patchOnProperties(Notification.prototype, null);
});
});

@@ -21,7 +21,7 @@ /**

// RTCPeerConnection extends EventTarget, so we must clear the symbol
// to allow pathc RTCPeerConnection.prototype.addEventListener again
// to allow patch RTCPeerConnection.prototype.addEventListener again
RTCPeerConnection.prototype[addSymbol] = null;
RTCPeerConnection.prototype[removeSymbol] = null;
api.patchEventTarget(global, [RTCPeerConnection.prototype], {useGlobalCallback: false});
api.patchEventTarget(global, [RTCPeerConnection.prototype], {useG: false});
});

@@ -10,3 +10,3 @@ /**

import {patchEventTarget} from '../common/events';
import {patchOnProperties} from '../common/utils';
import {ADD_EVENT_LISTENER_STR, ArraySlice, ObjectCreate, ObjectGetOwnPropertyDescriptor, patchOnProperties, REMOVE_EVENT_LISTENER_STR} from '../common/utils';

@@ -21,4 +21,4 @@ // we have to patch the instance since the proto is non-configurable

}
(<any>_global).WebSocket = function(a: any, b: any) {
const socket = arguments.length > 1 ? new WS(a, b) : new WS(a);
(<any>_global).WebSocket = function(x: any, y: any) {
const socket = arguments.length > 1 ? new WS(x, y) : new WS(x);
let proxySocket: any;

@@ -29,5 +29,5 @@

// Safari 7.0 has non-configurable own 'onmessage' and friends properties on the socket instance
const onmessageDesc = Object.getOwnPropertyDescriptor(socket, 'onmessage');
const onmessageDesc = ObjectGetOwnPropertyDescriptor(socket, 'onmessage');
if (onmessageDesc && onmessageDesc.configurable === false) {
proxySocket = Object.create(socket);
proxySocket = ObjectCreate(socket);
// socket have own property descriptor 'onopen', 'onmessage', 'onclose', 'onerror'

@@ -37,6 +37,7 @@ // but proxySocket not, so we will keep socket as prototype and pass it to

proxySocketProto = socket;
['addEventListener', 'removeEventListener', 'send', 'close'].forEach(function(propName) {
[ADD_EVENT_LISTENER_STR, REMOVE_EVENT_LISTENER_STR, 'send', 'close'].forEach(function(
propName) {
proxySocket[propName] = function() {
const args = Array.prototype.slice.call(arguments);
if (propName === 'addEventListener' || propName === 'removeEventListener') {
const args = ArraySlice.call(arguments);
if (propName === ADD_EVENT_LISTENER_STR || propName === REMOVE_EVENT_LISTENER_STR) {
const eventName = args.length > 0 ? args[0] : undefined;

@@ -43,0 +44,0 @@ if (eventName) {

@@ -51,3 +51,3 @@ /**

* If the current zone does not have a key, the request is delegated to the parent zone. Use
* [ZoneSpec.properties] to configure the set of properties asseciated with the current zone.
* [ZoneSpec.properties] to configure the set of properties associated with the current zone.
*

@@ -210,8 +210,8 @@ * @param {!string} key The key to retrieve.

* Allows interception of the callback invocation.
*
*
* @type {
* undefined|?function(ZoneDelegate, Zone, Zone, Function, Object, Array, string): *
* undefined|?function(ZoneDelegate, Zone, Zone, Function, Object, Array, string): *
* }
*/
ZoneSpec.prototype.onInvoke;
ZoneSpec.prototype.onInvoke;

@@ -222,3 +222,3 @@ /**

* @type {
* undefined|?function(ZoneDelegate, Zone, Zone, Object): boolean
* undefined|?function(ZoneDelegate, Zone, Zone, Object): boolean
* }

@@ -232,3 +232,3 @@ */

* @type {
* undefined|?function(ZoneDelegate, Zone, Zone, Task): Task
* undefined|?function(ZoneDelegate, Zone, Zone, Task): Task
* }

@@ -245,3 +245,3 @@ */

*/
ZoneSpec.prototype.onInvokeTask;
ZoneSpec.prototype.onInvokeTask;

@@ -252,6 +252,6 @@ /**

* @type {
* undefined|?function(ZoneDelegate, Zone, Zone, Task): *
* undefined|?function(ZoneDelegate, Zone, Zone, Task): *
* }
*/
ZoneSpec.prototype.onCancelTask;
ZoneSpec.prototype.onCancelTask;
/**

@@ -284,3 +284,3 @@ * Notifies of changes to the task queue empty status.

* @param {string=} source the argument passed into the `wrap` method.
* @returns {!Function}
* @returns {!Function}
*/

@@ -326,3 +326,3 @@ ZoneDelegate.prototype.intercept = function(targetZone, callback, source) {};

* @param {!Zone} targetZone The [Zone] which originally received the request.
* @param {!HasTaskState} hasTaskState
* @param {!HasTaskState} hasTaskState
*/

@@ -450,2 +450,2 @@ ZoneDelegate.prototype.hasTask = function(targetZone, hasTaskState) {};

*/
Error.prototype.originalStack;
Error.prototype.originalStack;

@@ -192,3 +192,3 @@ /**

}
return value.apply(this, [error, structuredStackTrace]);
return value.call(this, error, structuredStackTrace);
};

@@ -222,3 +222,3 @@ }

// This check makes sure that we don't filter frames on name only (must have
// linenumber)
// line number)
if (/:\d+:\d+/.test(frame)) {

@@ -288,4 +288,3 @@ // Get rid of the path so that we don't accidentally find function name in path.

childDetectZone.runGuarded(() => {
const fakeTransitionTo =
(toState: TaskState, fromState1: TaskState, fromState2: TaskState) => {};
const fakeTransitionTo = () => {};
childDetectZone.scheduleEventTask(

@@ -292,0 +291,0 @@ blacklistedStackFramesSymbol,

@@ -13,12 +13,13 @@ /**

import {attachOriginToPatched, zoneSymbol} from './utils';
import {ADD_EVENT_LISTENER_STR, attachOriginToPatched, FALSE_STR, ObjectGetPrototypeOf, REMOVE_EVENT_LISTENER_STR, TRUE_STR, ZONE_SYMBOL_PREFIX, zoneSymbol} from './utils';
export const TRUE_STR = 'true';
export const FALSE_STR = 'false';
/** @internal **/
interface EventTaskData extends TaskData {
// use global callback or not
readonly useG?: boolean;
}
export interface EventTaskData extends TaskData { readonly isUsingGlobalCallback?: boolean; }
// an identifier to tell ZoneTask do not create a new invoke closure
export const OPTIMIZED_ZONE_EVENT_TASK_DATA: EventTaskData = {
isUsingGlobalCallback: true
const OPTIMIZED_ZONE_EVENT_TASK_DATA: EventTaskData = {
useG: true
};

@@ -29,24 +30,26 @@

export const CONSTRUCTOR_NAME = 'name';
export const FUNCTION_TYPE = 'function';
export const OBJECT_TYPE = 'object';
export const ZONE_SYMBOL_PREFIX = '__zone_symbol__';
const EVENT_NAME_SYMBOL_REGX = /^__zone_symbol__(\w+)(true|false)$/;
const IMMEDIATE_PROPAGATION_SYMBOL = ('__zone_symbol__propagationStopped');
export interface PatchEventTargetOptions {
validateHandler?: (nativeDelegate: any, delegate: any, target: any, args: any) => boolean;
addEventListenerFnName?: string;
removeEventListenerFnName?: string;
prependEventListenerFnName?: string;
listenersFnName?: string;
removeAllFnName?: string;
useGlobalCallback?: boolean;
checkDuplicate?: boolean;
returnTarget?: boolean;
compareTaskCallbackVsDelegate?: (task: any, delegate: any) => boolean;
// validateHandler
vh?: (nativeDelegate: any, delegate: any, target: any, args: any) => boolean;
// addEventListener function name
add?: string;
// removeEventListener function name
rm?: string;
// prependEventListener function name
prepend?: string;
// listeners function name
listeners?: string;
// removeAllListeners function name
rmAll?: string;
// useGlobalCallback flag
useG?: boolean;
// check duplicate flag when addEventListener
chkDup?: boolean;
// return target flag when addEventListener
rt?: boolean;
// event compare handler
diff?: (task: any, delegate: any) => boolean;
}

@@ -56,11 +59,8 @@

_global: any, apis: any[], patchOptions?: PatchEventTargetOptions) {
const ADD_EVENT_LISTENER =
(patchOptions && patchOptions.addEventListenerFnName) || 'addEventListener';
const REMOVE_EVENT_LISTENER =
(patchOptions && patchOptions.removeEventListenerFnName) || 'removeEventListener';
const ADD_EVENT_LISTENER = (patchOptions && patchOptions.add) || ADD_EVENT_LISTENER_STR;
const REMOVE_EVENT_LISTENER = (patchOptions && patchOptions.rm) || REMOVE_EVENT_LISTENER_STR;
const LISTENERS_EVENT_LISTENER =
(patchOptions && patchOptions.listenersFnName) || 'eventListeners';
const LISTENERS_EVENT_LISTENER = (patchOptions && patchOptions.listeners) || 'eventListeners';
const REMOVE_ALL_LISTENERS_EVENT_LISTENER =
(patchOptions && patchOptions.removeAllFnName) || 'removeAllListeners';
(patchOptions && patchOptions.rmAll) || 'removeAllListeners';

@@ -81,3 +81,3 @@ const zoneSymbolAddEventListener = zoneSymbol(ADD_EVENT_LISTENER);

const delegate = task.callback;
if (typeof delegate === OBJECT_TYPE && delegate.handleEvent) {
if (typeof delegate === 'object' && delegate.handleEvent) {
// create the bind version of handleEvent when invoke

@@ -95,3 +95,3 @@ task.callback = (event: Event) => delegate.handleEvent(event);

const delegate = task.originalDelegate ? task.originalDelegate : task.callback;
target[REMOVE_EVENT_LISTENER].apply(target, [event.type, delegate, options]);
target[REMOVE_EVENT_LISTENER].call(target, event.type, delegate, options);
}

@@ -108,3 +108,3 @@ };

}
// event.target is needed for Samusung TV and SourceBuffer
// event.target is needed for Samsung TV and SourceBuffer
// || global is needed https://github.com/angular/zone.js/issues/190

@@ -141,3 +141,3 @@ const target: any = this || event.target || _global;

}
// event.target is needed for Samusung TV and SourceBuffer
// event.target is needed for Samsung TV and SourceBuffer
// || global is needed https://github.com/angular/zone.js/issues/190

@@ -172,15 +172,15 @@ const target: any = this || event.target || _global;

let useGlobalCallback = true;
if (patchOptions && patchOptions.useGlobalCallback !== undefined) {
useGlobalCallback = patchOptions.useGlobalCallback;
if (patchOptions && patchOptions.useG !== undefined) {
useGlobalCallback = patchOptions.useG;
}
const validateHandler = patchOptions && patchOptions.validateHandler;
const validateHandler = patchOptions && patchOptions.vh;
let checkDuplicate = true;
if (patchOptions && patchOptions.checkDuplicate !== undefined) {
checkDuplicate = patchOptions.checkDuplicate;
if (patchOptions && patchOptions.chkDup !== undefined) {
checkDuplicate = patchOptions.chkDup;
}
let returnTarget = false;
if (patchOptions && patchOptions.returnTarget !== undefined) {
returnTarget = patchOptions.returnTarget;
if (patchOptions && patchOptions.rt !== undefined) {
returnTarget = patchOptions.rt;
}

@@ -190,3 +190,3 @@

while (proto && !proto.hasOwnProperty(ADD_EVENT_LISTENER)) {
proto = Object.getPrototypeOf(proto);
proto = ObjectGetPrototypeOf(proto);
}

@@ -219,8 +219,8 @@ if (!proto && obj[ADD_EVENT_LISTENER]) {

let nativePrependEventListener: any;
if (patchOptions && patchOptions.prependEventListenerFnName) {
nativePrependEventListener = proto[zoneSymbol(patchOptions.prependEventListenerFnName)] =
proto[patchOptions.prependEventListenerFnName];
if (patchOptions && patchOptions.prepend) {
nativePrependEventListener = proto[zoneSymbol(patchOptions.prepend)] =
proto[patchOptions.prepend];
}
const customScheduleGlobal = function(task: Task) {
const customScheduleGlobal = function() {
// if there is already a task for the eventName + capture,

@@ -231,7 +231,6 @@ // just return, because we use the shared globalZoneAwareCallback here.

}
return nativeAddEventListener.apply(taskData.target, [
taskData.eventName,
taskData.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback,
taskData.options
]);
return nativeAddEventListener.call(
taskData.target, taskData.eventName,
taskData.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback,
taskData.options);
};

@@ -274,21 +273,19 @@

}
return nativeRemoveEventListener.apply(task.target, [
task.eventName, task.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback,
task.options
]);
return nativeRemoveEventListener.call(
task.target, task.eventName,
task.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, task.options);
};
const customScheduleNonGlobal = function(task: Task) {
return nativeAddEventListener.apply(
taskData.target, [taskData.eventName, task.invoke, taskData.options]);
return nativeAddEventListener.call(
taskData.target, taskData.eventName, task.invoke, taskData.options);
};
const customSchedulePrepend = function(task: Task) {
return nativePrependEventListener.apply(
taskData.target, [taskData.eventName, task.invoke, taskData.options]);
return nativePrependEventListener.call(
taskData.target, taskData.eventName, task.invoke, taskData.options);
};
const customCancelNonGlobal = function(task: any) {
return nativeRemoveEventListener.apply(
task.target, [task.eventName, task.invoke, task.options]);
return nativeRemoveEventListener.call(task.target, task.eventName, task.invoke, task.options);
};

@@ -301,13 +298,9 @@

const typeOfDelegate = typeof delegate;
if ((typeOfDelegate === FUNCTION_TYPE && task.callback === delegate) ||
(typeOfDelegate === OBJECT_TYPE && task.originalDelegate === delegate)) {
// same callback, same capture, same event name, just return
return true;
}
return false;
return (typeOfDelegate === 'function' && task.callback === delegate) ||
(typeOfDelegate === 'object' && task.originalDelegate === delegate);
};
const compare = (patchOptions && patchOptions.compareTaskCallbackVsDelegate) ?
patchOptions.compareTaskCallbackVsDelegate :
compareTaskCallbackVsDelegate;
const compare =
(patchOptions && patchOptions.diff) ? patchOptions.diff : compareTaskCallbackVsDelegate;

@@ -321,3 +314,2 @@ const blackListedEvents: string[] = (Zone as any)[Zone.__symbol__('BLACK_LISTED_EVENTS')];

const target = this || _global;
const targetZone = Zone.current;
let delegate = arguments[1];

@@ -332,3 +324,3 @@ if (!delegate) {

let isHandleEvent = false;
if (typeof delegate !== FUNCTION_TYPE) {
if (typeof delegate !== 'function') {
if (!delegate.handleEvent) {

@@ -402,3 +394,3 @@ return nativeListener.apply(this, arguments);

let source;
const constructorName = target.constructor[CONSTRUCTOR_NAME];
const constructorName = target.constructor['name'];
const targetSource = globalSources[constructorName];

@@ -427,3 +419,3 @@ if (targetSource) {

// keep taskData into data to allow onScheduleEventTask to acess the task information
// keep taskData into data to allow onScheduleEventTask to access the task information
if (data) {

@@ -514,3 +506,2 @@ (data as any).taskData = taskData;

const existingTask = existingTasks[i];
const typeOfDelegate = typeof delegate;
if (compare(existingTask, delegate)) {

@@ -568,7 +559,7 @@ existingTasks.splice(i, 1);

if (evtName && evtName !== 'removeListener') {
this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].apply(this, [evtName]);
this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, evtName);
}
}
// remove removeListener listener finally
this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].apply(this, ['removeListener']);
this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, 'removeListener');
} else {

@@ -588,3 +579,3 @@ const symbolEventNames = zoneSymbolEventNames[eventName];

let delegate = task.originalDelegate ? task.originalDelegate : task.callback;
this[REMOVE_EVENT_LISTENER].apply(this, [eventName, delegate, task.options]);
this[REMOVE_EVENT_LISTENER].call(this, eventName, delegate, task.options);
}

@@ -598,3 +589,3 @@ }

let delegate = task.originalDelegate ? task.originalDelegate : task.callback;
this[REMOVE_EVENT_LISTENER].apply(this, [eventName, delegate, task.options]);
this[REMOVE_EVENT_LISTENER].call(this, eventName, delegate, task.options);
}

@@ -601,0 +592,0 @@ }

@@ -9,2 +9,5 @@ /**

Zone.__load_patch('ZoneAwarePromise', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
const ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
const ObjectDefineProperty = Object.defineProperty;
function readableObjectToString(obj: any) {

@@ -69,3 +72,3 @@ if (obj && obj.toString === Object.prototype.toString) {

if (handler && typeof handler === 'function') {
handler.apply(this, [e]);
handler.call(this, e);
}

@@ -122,4 +125,2 @@ } catch (err) {

const TYPE_ERROR = 'Promise resolved with itself';
const OBJECT = 'object';
const FUNCTION = 'function';
const CURRENT_TASK_TRACE_SYMBOL = __symbol__('currentTaskTrace');

@@ -138,3 +139,3 @@

try {
if (typeof value === OBJECT || typeof value === FUNCTION) {
if (typeof value === 'object' || typeof value === 'function') {
then = value && value.then;

@@ -154,7 +155,7 @@ }

resolvePromise(promise, (value as any)[symbolState], (value as any)[symbolValue]);
} else if (state !== REJECTED && typeof then === FUNCTION) {
} else if (state !== REJECTED && typeof then === 'function') {
try {
then.apply(value, [
onceWrapper(makeResolver(promise, state)), onceWrapper(makeResolver(promise, false))
]);
then.call(
value, onceWrapper(makeResolver(promise, state)),
onceWrapper(makeResolver(promise, false)));
} catch (err) {

@@ -178,3 +179,3 @@ onceWrapper(() => {

// only keep the long stack trace into error when in longStackTraceZone
Object.defineProperty(
ObjectDefineProperty(
value, CURRENT_TASK_TRACE_SYMBOL,

@@ -221,4 +222,4 @@ {configurable: true, enumerable: false, writable: true, value: trace});

const handler = (Zone as any)[REJECTION_HANDLED_HANDLER];
if (handler && typeof handler === FUNCTION) {
handler.apply(this, [{rejection: (promise as any)[symbolValue], promise: promise}]);
if (handler && typeof handler === 'function') {
handler.call(this, {rejection: (promise as any)[symbolValue], promise: promise});
}

@@ -241,4 +242,4 @@ } catch (err) {

const delegate = (promise as any)[symbolState] ?
(typeof onFulfilled === FUNCTION) ? onFulfilled : forwardResolution :
(typeof onRejected === FUNCTION) ? onRejected : forwardRejection;
(typeof onFulfilled === 'function') ? onFulfilled : forwardResolution :
(typeof onRejected === 'function') ? onRejected : forwardRejection;
zone.scheduleMicroTask(source, () => {

@@ -366,3 +367,3 @@ try {

let desc = Object.getOwnPropertyDescriptor(global, 'Promise');
let desc = ObjectGetOwnPropertyDescriptor(global, 'Promise');
if (!desc || desc.configurable) {

@@ -400,3 +401,3 @@ desc && delete desc.writable;

Object.defineProperty(global, 'Promise', desc);
ObjectDefineProperty(global, 'Promise', desc);
}

@@ -414,7 +415,7 @@

// check Ctor.prototype.then propertyDescritor is writable or not
// check Ctor.prototype.then propertyDescriptor is writable or not
// in meteor env, writable is false, we have to make it to be true.
const prop = Object.getOwnPropertyDescriptor(Ctor.prototype, 'then');
const prop = ObjectGetOwnPropertyDescriptor(Ctor.prototype, 'then');
if (prop && prop.writable === false && prop.configurable) {
Object.defineProperty(Ctor.prototype, 'then', {writable: true});
ObjectDefineProperty(Ctor.prototype, 'then', {writable: true});
}

@@ -449,3 +450,3 @@

let fetch = global['fetch'];
if (typeof fetch == FUNCTION) {
if (typeof fetch == 'function') {
global['fetch'] = zoneify(fetch);

@@ -452,0 +453,0 @@ }

@@ -13,3 +13,3 @@ /**

import {patchMethod, zoneSymbol} from './utils';
import {patchMethod, scheduleMacroTaskWithCurrentZone, zoneSymbol} from './utils';

@@ -30,8 +30,2 @@ const taskSymbol = zoneSymbol('zoneTask');

const tasksByHandleId: {[id: number]: Task} = {};
const NUMBER = 'number';
const STRING = 'string';
const FUNCTION = 'function';
const INTERVAL = 'Interval';
const TIMEOUT = 'Timeout';
const NOT_SCHEDULED = 'notScheduled';

@@ -44,17 +38,16 @@ function scheduleTask(task: Task) {

} finally {
if (task.data && task.data.isPeriodic) {
// issue-934, task will be cancelled
// even it is a periodic task such as
// setInterval
return;
// issue-934, task will be cancelled
// even it is a periodic task such as
// setInterval
if (!(task.data && task.data.isPeriodic)) {
if (typeof data.handleId === 'number') {
// in non-nodejs env, we remove timerId
// from local cache
delete tasksByHandleId[data.handleId];
} else if (data.handleId) {
// Node returns complex objects as handleIds
// we remove task reference from timer object
(data.handleId as any)[taskSymbol] = null;
}
}
if (typeof data.handleId === NUMBER) {
// in non-nodejs env, we remove timerId
// from local cache
delete tasksByHandleId[data.handleId];
} else if (data.handleId) {
// Node returns complex objects as handleIds
// we remove task reference from timer object
(data.handleId as any)[taskSymbol] = null;
}
}

@@ -73,11 +66,11 @@ }

patchMethod(window, setName, (delegate: Function) => function(self: any, args: any[]) {
if (typeof args[0] === FUNCTION) {
const zone = Zone.current;
if (typeof args[0] === 'function') {
const options: TimerOptions = {
handleId: null,
isPeriodic: nameSuffix === INTERVAL,
delay: (nameSuffix === TIMEOUT || nameSuffix === INTERVAL) ? args[1] || 0 : null,
isPeriodic: nameSuffix === 'Interval',
delay: (nameSuffix === 'Timeout' || nameSuffix === 'Interval') ? args[1] || 0 : null,
args: args
};
const task = zone.scheduleMacroTask(setName, args[0], options, scheduleTask, clearTask);
const task =
scheduleMacroTaskWithCurrentZone(setName, args[0], options, scheduleTask, clearTask);
if (!task) {

@@ -88,3 +81,3 @@ return task;

const handle: any = (<TimerOptions>task.data).handleId;
if (typeof handle === NUMBER) {
if (typeof handle === 'number') {
// for non nodejs env, we save handleId: task

@@ -101,8 +94,8 @@ // mapping in local cache for clearTimeout

// may return undefined from setTimeout/setInterval/setImmediate/requestAnimationFrame
if (handle && handle.ref && handle.unref && typeof handle.ref === FUNCTION &&
typeof handle.unref === FUNCTION) {
if (handle && handle.ref && handle.unref && typeof handle.ref === 'function' &&
typeof handle.unref === 'function') {
(<any>task).ref = (<any>handle).ref.bind(handle);
(<any>task).unref = (<any>handle).unref.bind(handle);
}
if (typeof handle === NUMBER || handle) {
if (typeof handle === 'number' || handle) {
return handle;

@@ -121,3 +114,3 @@ }

let task: Task;
if (typeof id === NUMBER) {
if (typeof id === 'number') {
// non nodejs env.

@@ -133,6 +126,6 @@ task = tasksByHandleId[id];

}
if (task && typeof task.type === STRING) {
if (task.state !== NOT_SCHEDULED &&
if (task && typeof task.type === 'string') {
if (task.state !== 'notScheduled' &&
(task.cancelFn && task.data.isPeriodic || task.runCount === 0)) {
if (typeof id === NUMBER) {
if (typeof id === 'number') {
delete tasksByHandleId[id];

@@ -139,0 +132,0 @@ } else if (id) {

@@ -12,3 +12,3 @@ /**

// look like native function
Zone.__load_patch('toString', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
Zone.__load_patch('toString', (global: any, Zone: ZoneType) => {
// patch Func.prototype.toString to let them look like native

@@ -18,3 +18,2 @@ const originalFunctionToString = (Zone as any)['__zone_symbol__originalToString'] =

const FUNCTION = 'function';
const ORIGINAL_DELEGATE_SYMBOL = zoneSymbol('OriginalDelegate');

@@ -24,6 +23,6 @@ const PROMISE_SYMBOL = zoneSymbol('Promise');

Function.prototype.toString = function() {
if (typeof this === FUNCTION) {
if (typeof this === 'function') {
const originalDelegate = this[ORIGINAL_DELEGATE_SYMBOL];
if (originalDelegate) {
if (typeof originalDelegate === FUNCTION) {
if (typeof originalDelegate === 'function') {
return originalFunctionToString.apply(this[ORIGINAL_DELEGATE_SYMBOL], arguments);

@@ -30,0 +29,0 @@ } else {

@@ -14,2 +14,39 @@ /**

// issue #989, to reduce bundle size, use short name
/** Object.getOwnPropertyDescriptor */
export const ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
/** Object.defineProperty */
export const ObjectDefineProperty = Object.defineProperty;
/** Object.getPrototypeOf */
export const ObjectGetPrototypeOf = Object.getPrototypeOf;
/** Object.create */
export const ObjectCreate = Object.create;
/** Array.prototype.slice */
export const ArraySlice = Array.prototype.slice;
/** addEventListener string const */
export const ADD_EVENT_LISTENER_STR = 'addEventListener';
/** removeEventListener string const */
export const REMOVE_EVENT_LISTENER_STR = 'removeEventListener';
/** zoneSymbol addEventListener */
export const ZONE_SYMBOL_ADD_EVENT_LISTENER = Zone.__symbol__(ADD_EVENT_LISTENER_STR);
/** zoneSymbol removeEventListener */
export const ZONE_SYMBOL_REMOVE_EVENT_LISTENER = Zone.__symbol__(REMOVE_EVENT_LISTENER_STR);
/** true string const */
export const TRUE_STR = 'true';
/** false string const */
export const FALSE_STR = 'false';
/** __zone_symbol__ string const */
export const ZONE_SYMBOL_PREFIX = '__zone_symbol__';
export function wrapWithCurrentZone<T extends Function>(callback: T, source: string): T {
return Zone.current.wrap(callback, source);
}
export function scheduleMacroTaskWithCurrentZone(
source: string, callback: Function, data: TaskData, customSchedule: (task: Task) => void,
customCancel: (task: Task) => void): MacroTask {
return Zone.current.scheduleMacroTask(source, callback, data, customSchedule, customCancel);
}
// Hack since TypeScript isn't compiling this for a worker.

@@ -19,7 +56,6 @@ declare const WorkerGlobalScope: any;

export const zoneSymbol = Zone.__symbol__;
const _global: any =
typeof window === 'object' && window || typeof self === 'object' && self || global;
const isWindowExists = typeof window !== 'undefined';
const internalWindow: any = isWindowExists ? window : undefined;
const _global: any = isWindowExists && internalWindow || typeof self === 'object' && self || global;
const FUNCTION = 'function';
const UNDEFINED = 'undefined';
const REMOVE_ATTRIBUTE = 'removeAttribute';

@@ -30,4 +66,4 @@ const NULL_ON_PROP_VALUE: any[] = [null];

for (let i = args.length - 1; i >= 0; i--) {
if (typeof args[i] === FUNCTION) {
args[i] = Zone.current.wrap(args[i], source + '_' + i);
if (typeof args[i] === 'function') {
args[i] = wrapWithCurrentZone(args[i], source + '_' + i);
}

@@ -38,18 +74,2 @@ }

export function wrapFunctionArgs(func: Function, source?: string): Function {
return function() {
const args = Array.prototype.slice.call(arguments);
const wrappedArgs = bindArguments(args, source ? source : (func as any).name);
return func.apply(this, wrappedArgs);
};
}
export function patchArguments(target: any, name: string, source: string): Function {
return patchMethod(
target, name,
(delegate: Function, delegateName: string, name: string) => (self: any, args: any[]) => {
return delegate && delegate.apply(self, bindArguments(args, source));
});
}
export function patchPrototype(prototype: any, fnNames: string[]) {

@@ -61,3 +81,3 @@ const source = prototype.constructor['name'];

if (delegate) {
const prototypeDesc = Object.getOwnPropertyDescriptor(prototype, name);
const prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, name);
if (!isPropertyWritable(prototypeDesc)) {

@@ -86,7 +106,3 @@ continue;

if (typeof propertyDesc.get === FUNCTION && typeof propertyDesc.set === UNDEFINED) {
return false;
}
return true;
return !(typeof propertyDesc.get === 'function' && typeof propertyDesc.set === 'undefined');
}

@@ -97,3 +113,3 @@

// Make sure to access `process` through `_global` so that WebPack does not accidently browserify
// Make sure to access `process` through `_global` so that WebPack does not accidentally browserify
// this code.

@@ -105,10 +121,10 @@ export const isNode: boolean =

export const isBrowser: boolean =
!isNode && !isWebWorker && !!(typeof window !== 'undefined' && (window as any)['HTMLElement']);
!isNode && !isWebWorker && !!(isWindowExists && internalWindow['HTMLElement']);
// we are in electron of nw, so we are both browser and nodejs
// Make sure to access `process` through `_global` so that WebPack does not accidently browserify
// Make sure to access `process` through `_global` so that WebPack does not accidentally browserify
// this code.
export const isMix: boolean = typeof _global.process !== 'undefined' &&
{}.toString.call(_global.process) === '[object process]' && !isWebWorker &&
!!(typeof window !== 'undefined' && (window as any)['HTMLElement']);
!!(isWindowExists && internalWindow['HTMLElement']);

@@ -139,6 +155,6 @@ const zoneSymbolEventNames: {[eventName: string]: string} = {};

export function patchProperty(obj: any, prop: string, prototype?: any) {
let desc = Object.getOwnPropertyDescriptor(obj, prop);
let desc = ObjectGetOwnPropertyDescriptor(obj, prop);
if (!desc && prototype) {
// when patch window object, use prototype to check prop exist or not
const prototypeDesc = Object.getOwnPropertyDescriptor(prototype, prop);
const prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, prop);
if (prototypeDesc) {

@@ -223,6 +239,6 @@ desc = {enumerable: true, configurable: true};

// so we should use original native get to retrieve the handler
let value = originalDescGet && originalDescGet.apply(this);
let value = originalDescGet && originalDescGet.call(this);
if (value) {
desc.set.apply(this, [value]);
if (typeof target[REMOVE_ATTRIBUTE] === FUNCTION) {
desc.set.call(this, value);
if (typeof target[REMOVE_ATTRIBUTE] === 'function') {
target.removeAttribute(prop);

@@ -236,3 +252,3 @@ }

Object.defineProperty(obj, prop, desc);
ObjectDefineProperty(obj, prop, desc);
}

@@ -305,6 +321,6 @@

} else {
Object.defineProperty(_global[className].prototype, prop, {
ObjectDefineProperty(_global[className].prototype, prop, {
set: function(fn) {
if (typeof fn === 'function') {
this[originalInstanceKey][prop] = Zone.current.wrap(fn, className + '.' + prop);
this[originalInstanceKey][prop] = wrapWithCurrentZone(fn, className + '.' + prop);
// keep callback in wrapped function so we can

@@ -339,3 +355,3 @@ // use it in Function.prototype.toString to return

while (proto && !proto.hasOwnProperty(name)) {
proto = Object.getPrototypeOf(proto);
proto = ObjectGetPrototypeOf(proto);
}

@@ -353,3 +369,3 @@ if (!proto && target[name]) {

// some property is readonly in safari, such as HtmlCanvasElement.prototype.toBlob
const desc = proto && Object.getOwnPropertyDescriptor(proto, name);
const desc = proto && ObjectGetOwnPropertyDescriptor(proto, name);
if (isPropertyWritable(desc)) {

@@ -369,3 +385,3 @@ const patchDelegate = patchFn(delegate, delegateName, name);

target: any;
callbackIndex: number;
cbIdx: number;
args: any[];

@@ -381,3 +397,3 @@ }

const data = <MacroTaskMeta>task.data;
data.args[data.callbackIndex] = function() {
data.args[data.cbIdx] = function() {
task.invoke.apply(this, arguments);

@@ -391,6 +407,5 @@ };

const meta = metaCreator(self, args);
if (meta.callbackIndex >= 0 && typeof args[meta.callbackIndex] === 'function') {
const task = Zone.current.scheduleMacroTask(
meta.name, args[meta.callbackIndex], meta, scheduleTask, null);
return task;
if (meta.cbIdx >= 0 && typeof args[meta.cbIdx] === 'function') {
return scheduleMacroTaskWithCurrentZone(
meta.name, args[meta.cbIdx], meta, scheduleTask, null);
} else {

@@ -406,3 +421,3 @@ // cause an error by calling it directly.

target: any;
callbackIndex: number;
cbIdx: number;
args: any[];

@@ -417,3 +432,3 @@ }

const data = <MacroTaskMeta>task.data;
data.args[data.callbackIndex] = function() {
data.args[data.cbIdx] = function() {
task.invoke.apply(this, arguments);

@@ -427,6 +442,4 @@ };

const meta = metaCreator(self, args);
if (meta.callbackIndex >= 0 && typeof args[meta.callbackIndex] === 'function') {
const task =
Zone.current.scheduleMicroTask(meta.name, args[meta.callbackIndex], meta, scheduleTask);
return task;
if (meta.cbIdx >= 0 && typeof args[meta.cbIdx] === 'function') {
return Zone.current.scheduleMicroTask(meta.name, args[meta.cbIdx], meta, scheduleTask);
} else {

@@ -454,4 +467,3 @@ // cause an error by calling it directly.

try {
const ua = window.navigator.userAgent;
const msie = ua.indexOf('MSIE ');
const ua = internalWindow.navigator.userAgent;
if (ua.indexOf('MSIE ') !== -1 || ua.indexOf('Trident/') !== -1 || ua.indexOf('Edge/') !== -1) {

@@ -458,0 +470,0 @@ ieOrEdge = true;

@@ -8,3 +8,3 @@ /**

*/
Zone.__load_patch('bluebird', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
Zone.__load_patch('bluebird', (global: any, Zone: ZoneType) => {
// TODO: @JiaLiPassion, we can automatically patch bluebird

@@ -21,2 +21,2 @@ // if global.Promise = Bluebird, but sometimes in nodejs,

};
});
});

@@ -13,4 +13,4 @@ /**

const FUNCTION = 'function';
const nativeExec: Function = api.patchMethod(
global.cordova, 'exec', (delegate: Function) => function(self: any, args: any[]) {
const nativeExec: Function =
api.patchMethod(global.cordova, 'exec', () => function(self: any, args: any[]) {
if (args.length > 0 && typeof args[0] === FUNCTION) {

@@ -27,3 +27,3 @@ args[0] = Zone.current.wrap(args[0], SUCCESS_SOURCE);

Zone.__load_patch('cordova.FileReader', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
Zone.__load_patch('cordova.FileReader', (global: any, Zone: ZoneType) => {
if (global.cordova && typeof global['FileReader'] !== 'undefined') {

@@ -43,2 +43,2 @@ document.addEventListener('deviceReady', () => {

}
});
});

@@ -9,20 +9,24 @@ /**

Zone.__load_patch('electron', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
const FUNCTION = 'function';
const {desktopCapturer, shell, CallbackRegistry} = require('electron');
function patchArguments(target: any, name: string, source: string): Function {
return api.patchMethod(target, name, (delegate: Function) => (self: any, args: any[]) => {
return delegate && delegate.apply(self, api.bindArguments(args, source));
});
}
const {desktopCapturer, shell, CallbacksRegistry} = require('electron');
// patch api in renderer process directly
// desktopCapturer
if (desktopCapturer) {
api.patchArguments(desktopCapturer, 'getSources', 'electron.desktopCapturer.getSources');
patchArguments(desktopCapturer, 'getSources', 'electron.desktopCapturer.getSources');
}
// shell
if (shell) {
api.patchArguments(shell, 'openExternal', 'electron.shell.openExternal');
patchArguments(shell, 'openExternal', 'electron.shell.openExternal');
}
// patch api in main process through CallbackRegistry
if (!CallbackRegistry) {
if (!CallbacksRegistry) {
return;
}
api.patchArguments(CallbackRegistry.prototype, 'add', 'CallbackRegistry.add');
});
patchArguments(CallbacksRegistry.prototype, 'add', 'CallbackRegistry.add');
});

@@ -9,12 +9,5 @@ /**

import {globalSources, patchEventTarget, zoneSymbolEventNames} from '../common/events';
import {patchEventTarget} from '../common/events';
Zone.__load_patch('EventEmitter', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
const callAndReturnFirstParam = (fn: (self: any, args: any[]) => any) => {
return (self: any, args: any[]) => {
fn(self, args);
return self;
};
};
Zone.__load_patch('EventEmitter', (global: any) => {
// For EventEmitter

@@ -29,7 +22,4 @@ const EE_ADD_LISTENER = 'addListener';

const compareTaskCallbackVsDelegate = function(task: any, delegate: any) {
if (task.callback === delegate || task.callback.listener === delegate) {
// same callback, same capture, same event name, just return
return true;
}
return false;
// same callback, same capture, same event name, just return
return task.callback === delegate || task.callback.listener === delegate;
};

@@ -39,11 +29,11 @@

const result = patchEventTarget(global, [obj], {
useGlobalCallback: false,
addEventListenerFnName: EE_ADD_LISTENER,
removeEventListenerFnName: EE_REMOVE_LISTENER,
prependEventListenerFnName: EE_PREPEND_LISTENER,
removeAllFnName: EE_REMOVE_ALL_LISTENER,
listenersFnName: EE_LISTENERS,
checkDuplicate: false,
returnTarget: true,
compareTaskCallbackVsDelegate: compareTaskCallbackVsDelegate
useG: false,
add: EE_ADD_LISTENER,
rm: EE_REMOVE_LISTENER,
prepend: EE_PREPEND_LISTENER,
rmAll: EE_REMOVE_ALL_LISTENER,
listeners: EE_LISTENERS,
chkDup: false,
rt: true,
diff: compareTaskCallbackVsDelegate
});

@@ -50,0 +40,0 @@ if (result && result[0]) {

@@ -11,3 +11,3 @@ /**

Zone.__load_patch('fs', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
Zone.__load_patch('fs', () => {
let fs: any;

@@ -36,3 +36,3 @@ try {

args: args,
callbackIndex: args.length > 0 ? args.length - 1 : -1,
cbIdx: args.length > 0 ? args.length - 1 : -1,
target: self

@@ -43,2 +43,2 @@ };

}
});
});

@@ -14,3 +14,3 @@ /**

import {patchTimer} from '../common/timers';
import {isMix, patchArguments, patchMacroTask, patchMethod, patchMicroTask, patchOnProperties} from '../common/utils';
import {ArraySlice, bindArguments, isMix, patchMacroTask, patchMethod, patchMicroTask, patchOnProperties} from '../common/utils';

@@ -23,6 +23,6 @@ const set = 'set';

api.patchMethod = patchMethod;
api.patchArguments = patchArguments;
api.bindArguments = bindArguments;
});
Zone.__load_patch('node_timers', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
Zone.__load_patch('node_timers', (global: any, Zone: ZoneType) => {
// Timers

@@ -52,3 +52,3 @@ let globalUseTimeoutFromTimer = false;

} catch (error) {
// timers module not exists, for example, when we using nativescript
// timers module not exists, for example, when we using nativeScript
// timers is not available

@@ -71,3 +71,3 @@ }

// global use timers setTimeout, but not equals
// this happenes when use nodejs v0.10.x, global setTimeout will
// this happens when use nodejs v0.10.x, global setTimeout will
// use a lazy load version of timers setTimeout

@@ -83,3 +83,3 @@ // we should not double patch timer's setTimeout

// patch process related methods
Zone.__load_patch('nextTick', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
Zone.__load_patch('nextTick', () => {
// patch nextTick as microTask

@@ -90,3 +90,3 @@ patchMicroTask(process, 'nextTick', (self: any, args: any[]) => {

args: args,
callbackIndex: (args.length > 0 && typeof args[0] === 'function') ? 0 : -1,
cbIdx: (args.length > 0 && typeof args[0] === 'function') ? 0 : -1,
target: process

@@ -125,3 +125,3 @@ };

// Crypto
Zone.__load_patch('crypto', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
Zone.__load_patch('crypto', () => {
let crypto: any;

@@ -141,3 +141,3 @@ try {

args: args,
callbackIndex: (args.length > 0 && typeof args[args.length - 1] === 'function') ?
cbIdx: (args.length > 0 && typeof args[args.length - 1] === 'function') ?
args.length - 1 :

@@ -152,3 +152,3 @@ -1,

Zone.__load_patch('console', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
Zone.__load_patch('console', (global: any, Zone: ZoneType) => {
const consoleMethods =

@@ -160,3 +160,3 @@ ['dir', 'log', 'info', 'error', 'warn', 'assert', 'debug', 'timeEnd', 'trace'];

(console as any)[m] = function() {
const args = Array.prototype.slice.call(arguments);
const args = ArraySlice.call(arguments);
if (Zone.current === Zone.root) {

@@ -163,0 +163,0 @@ return originalMethod.apply(this, args);

@@ -22,11 +22,10 @@ /**

(Zone as any).__load_patch('rxjs', (global: any, Zone: ZoneType, api: any) => {
(Zone as any).__load_patch('rxjs', (global: any, Zone: ZoneType) => {
const symbol: (symbolString: string) => string = (Zone as any).__symbol__;
const subscribeSource = 'rxjs.subscribe';
const nextSource = 'rxjs.Subscriber.next';
const errorSource = 'rxjs.Subscriber.error';
const completeSource = 'rxjs.Subscriber.complete';
const unsubscribeSource = 'rxjs.Subscriber.unsubscribe';
const teardownSource = 'rxjs.Subscriber.teardownLogic';
const ObjectDefineProperties = Object.defineProperties;
const empty = {

@@ -65,3 +64,3 @@ closed: true,

Object.defineProperties(Observable.prototype, {
ObjectDefineProperties(Observable.prototype, {
_zone: {value: null, writable: true, configurable: true},

@@ -117,3 +116,3 @@ _zoneSource: {value: null, writable: true, configurable: true},

Subscription.prototype.unsubscribe;
Object.defineProperties(Subscription.prototype, {
ObjectDefineProperties(Subscription.prototype, {
_zone: {value: null, writable: true, configurable: true},

@@ -327,3 +326,2 @@ _zoneUnsubscribe: {value: null, writable: true, configurable: true},

const scheduleSymbol = symbol('scheduleSymbol');
const flushSymbol = symbol('flushSymbol');
const zoneSymbol = symbol('zone');

@@ -352,3 +350,3 @@ if (asap[scheduleSymbol]) {

};
return schedule.apply(this, [patchedWork, delay, state]);
return schedule.call(this, patchedWork, delay, state);
};

@@ -367,2 +365,2 @@ };

patchImmediate(asap);
});
});

@@ -185,3 +185,3 @@ /**

this.name = 'fakeAsyncTestZone for ' + namePrefix;
// in case user can't access the construction of FakyAsyncTestSpec
// in case user can't access the construction of FakeAsyncTestSpec
// user can also define macroTaskOptions by define a global variable.

@@ -332,7 +332,7 @@ if (!this.macroTaskOptions) {

// arguments
let addtionalArgs: any[];
let additionalArgs: any[];
if (args) {
let callbackIndex = (task.data as any).callbackIndex;
let callbackIndex = (task.data as any).cbIdx;
if (typeof args.length === 'number' && args.length > callbackIndex + 1) {
addtionalArgs = Array.prototype.slice.call(args, callbackIndex + 1);
additionalArgs = Array.prototype.slice.call(args, callbackIndex + 1);
}

@@ -342,3 +342,3 @@ }

func: task.invoke,
args: addtionalArgs,
args: additionalArgs,
target: task.data && (task.data as any).target

@@ -384,3 +384,3 @@ });

} else {
// not periodic, use setTimout to simulate
// not periodic, use setTimeout to simulate
task.data['handleId'] = this._setTimeout(task.invoke, delay, callbackArgs);

@@ -387,0 +387,0 @@ }

@@ -330,3 +330,3 @@ /**

(self: any, args: any[]) => any) => Function;
patchArguments: (target: any, name: string, source: string) => Function;
bindArguments: (args: any[], source: string) => any[];
}

@@ -1171,7 +1171,8 @@

const self = this;
if (type === eventTask && options && (options as any).isUsingGlobalCallback) {
// TODO: @JiaLiPassion options should have interface
if (type === eventTask && options && (options as any).useG) {
this.invoke = ZoneTask.invokeTask;
} else {
this.invoke = function() {
return ZoneTask.invokeTask.apply(global, [self, this, <any>arguments]);
return ZoneTask.invokeTask.call(global, self, this, <any>arguments);
};

@@ -1292,3 +1293,2 @@ }

}
const showError: boolean = !(Zone as any)[__symbol__('ignoreConsoleErrorUncaughtError')];
_api.microtaskDrainDone();

@@ -1324,3 +1324,3 @@ _isDrainingMicrotaskQueue = false;

patchMethod: () => noop,
patchArguments: () => noop,
bindArguments: () => null,
setNativePromise: (NativePromise: any) => {

@@ -1345,5 +1345,4 @@ // sometimes NativePromise.resolve static function

performanceMeasure('Zone', 'Zone');
return global['Zone'] = Zone;
})(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global);
{
"name": "zone.js",
"version": "0.8.19",
"version": "0.8.20",
"description": "Zones for JavaScript",

@@ -5,0 +5,0 @@ "main": "dist/zone-node.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc