diff --git a/dist/fake-async-test.js b/dist/fake-async-test.js index 2d73d419c..7d0dd4d22 100644 --- a/dist/fake-async-test.js +++ b/dist/fake-async-test.js @@ -98,7 +98,7 @@ return function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { - args[_i - 0] = arguments[_i]; + args[_i] = arguments[_i]; } fn.apply(global, args); if (_this._lastError === null) { diff --git a/dist/mocha-patch.js b/dist/mocha-patch.js index 200949e09..1cef4519a 100644 --- a/dist/mocha-patch.js +++ b/dist/mocha-patch.js @@ -41,7 +41,7 @@ it: Mocha.it }; function modifyArguments(args, syncTest, asyncTest) { - var _loop_1 = function(i) { + var _loop_1 = function (i) { var arg = args[i]; if (typeof arg === 'function') { // The `done` callback is only passed through if the function expects at diff --git a/dist/wtf.js b/dist/wtf.js index 207bb9db0..e61ce8d59 100644 --- a/dist/wtf.js +++ b/dist/wtf.js @@ -87,13 +87,13 @@ return retValue; }; - WtfZoneSpec.forkInstance = wtfEnabled && wtfEvents.createInstance('Zone:fork(ascii zone, ascii newZone)'); - WtfZoneSpec.scheduleInstance = {}; - WtfZoneSpec.cancelInstance = {}; - WtfZoneSpec.invokeScope = {}; - WtfZoneSpec.invokeTaskScope = {}; return WtfZoneSpec; }()); + WtfZoneSpec.forkInstance = wtfEnabled && wtfEvents.createInstance('Zone:fork(ascii zone, ascii newZone)'); + WtfZoneSpec.scheduleInstance = {}; + WtfZoneSpec.cancelInstance = {}; + WtfZoneSpec.invokeScope = {}; + WtfZoneSpec.invokeTaskScope = {}; function shallowObj(obj, depth) { if (!depth) return null; diff --git a/dist/wtf.min.js b/dist/wtf.min.js index 32c1f633e..b835d0ef4 100644 --- a/dist/wtf.min.js +++ b/dist/wtf.min.js @@ -1 +1 @@ -!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n():"function"==typeof define&&define.amd?define(n):n()}(this,function(){"use strict";!function(e){function n(e,o){if(!o)return null;var t={};for(var c in e)if(e.hasOwnProperty(c)){var a=e[c];switch(typeof a){case"object":var r=a&&a.constructor&&a.constructor.name;a=r==Object.name?n(a,o-1):r;break;case"function":a=a.name||void 0}t[c]=a}return t}function o(e){var n=e.name;for(e=e.parent;null!=e;)n=e.name+"::"+n,e=e.parent;return n}var t=null,c=null,a=function(){var n=e.wtf;return!(!n||!(t=n.trace))&&(c=t.events,!0)}(),r=function(){function e(){this.name="WTF"}return e.prototype.onFork=function(n,t,c,a){var r=n.fork(c,a);return e.forkInstance(o(c),r.name),r},e.prototype.onInvoke=function(n,a,r,i,s,u,f){var p=e.invokeScope[f];return p||(p=e.invokeScope[f]=c.createScope("Zone:invoke:"+f+"(ascii zone)")),t.leaveScope(p(o(r)),n.invoke(r,i,s,u,f))},e.prototype.onHandleError=function(e,n,o,t){return e.handleError(o,t)},e.prototype.onScheduleTask=function(t,a,r,i){var s=i.type+":"+i.source,u=e.scheduleInstance[s];u||(u=e.scheduleInstance[s]=c.createInstance("Zone:schedule:"+s+"(ascii zone, any data)"));var f=t.scheduleTask(r,i);return u(o(r),n(i.data,2)),f},e.prototype.onInvokeTask=function(n,a,r,i,s,u){var f=i.source,p=e.invokeTaskScope[f];return p||(p=e.invokeTaskScope[f]=c.createScope("Zone:invokeTask:"+f+"(ascii zone)")),t.leaveScope(p(o(r)),n.invokeTask(r,i,s,u))},e.prototype.onCancelTask=function(t,a,r,i){var s=i.source,u=e.cancelInstance[s];u||(u=e.cancelInstance[s]=c.createInstance("Zone:cancel:"+s+"(ascii zone, any options)"));var f=t.cancelTask(r,i);return u(o(r),n(i.data,2)),f},e.forkInstance=a&&c.createInstance("Zone:fork(ascii zone, ascii newZone)"),e.scheduleInstance={},e.cancelInstance={},e.invokeScope={},e.invokeTaskScope={},e}();Zone.wtfZoneSpec=a?new r:null}("object"==typeof window&&window||"object"==typeof self&&self||global)}); \ No newline at end of file +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n():"function"==typeof define&&define.amd?define(n):n()}(this,function(){"use strict";!function(e){function n(e,o){if(!o)return null;var t={};for(var c in e)if(e.hasOwnProperty(c)){var a=e[c];switch(typeof a){case"object":var r=a&&a.constructor&&a.constructor.name;a=r==Object.name?n(a,o-1):r;break;case"function":a=a.name||void 0}t[c]=a}return t}function o(e){var n=e.name;for(e=e.parent;null!=e;)n=e.name+"::"+n,e=e.parent;return n}var t=null,c=null,a=function(){var n=e.wtf;return!(!n||!(t=n.trace))&&(c=t.events,!0)}(),r=function(){function e(){this.name="WTF"}return e.prototype.onFork=function(n,t,c,a){var r=n.fork(c,a);return e.forkInstance(o(c),r.name),r},e.prototype.onInvoke=function(n,a,r,i,s,u,f){var p=e.invokeScope[f];return p||(p=e.invokeScope[f]=c.createScope("Zone:invoke:"+f+"(ascii zone)")),t.leaveScope(p(o(r)),n.invoke(r,i,s,u,f))},e.prototype.onHandleError=function(e,n,o,t){return e.handleError(o,t)},e.prototype.onScheduleTask=function(t,a,r,i){var s=i.type+":"+i.source,u=e.scheduleInstance[s];u||(u=e.scheduleInstance[s]=c.createInstance("Zone:schedule:"+s+"(ascii zone, any data)"));var f=t.scheduleTask(r,i);return u(o(r),n(i.data,2)),f},e.prototype.onInvokeTask=function(n,a,r,i,s,u){var f=i.source,p=e.invokeTaskScope[f];return p||(p=e.invokeTaskScope[f]=c.createScope("Zone:invokeTask:"+f+"(ascii zone)")),t.leaveScope(p(o(r)),n.invokeTask(r,i,s,u))},e.prototype.onCancelTask=function(t,a,r,i){var s=i.source,u=e.cancelInstance[s];u||(u=e.cancelInstance[s]=c.createInstance("Zone:cancel:"+s+"(ascii zone, any options)"));var f=t.cancelTask(r,i);return u(o(r),n(i.data,2)),f},e}();r.forkInstance=a&&c.createInstance("Zone:fork(ascii zone, ascii newZone)"),r.scheduleInstance={},r.cancelInstance={},r.invokeScope={},r.invokeTaskScope={},Zone.wtfZoneSpec=a?new r:null}("object"==typeof window&&window||"object"==typeof self&&self||global)}); \ No newline at end of file diff --git a/dist/zone-node.js b/dist/zone-node.js index c69c3fcd2..079ed675e 100644 --- a/dist/zone-node.js +++ b/dist/zone-node.js @@ -176,9 +176,9 @@ var Zone$1 = (function (global) { task.cancelFn = null; return value; }; - Zone.__symbol__ = __symbol__; return Zone; }()); + Zone.__symbol__ = __symbol__; var ZoneDelegate = (function () { function ZoneDelegate(zone, parentDelegate, zoneSpec) { @@ -423,7 +423,7 @@ var Zone$1 = (function (global) { } } while (_uncaughtPromiseErrors.length) { - var _loop_1 = function() { + var _loop_1 = function () { var uncaughtPromiseError = _uncaughtPromiseErrors.shift(); try { uncaughtPromiseError.zone.runGuarded(function () { @@ -680,12 +680,11 @@ var Zone$1 = (function (global) { function ZoneAwareError() { // Create an Error. var error = NativeError.apply(this, arguments); - this.message = error.message; // Save original stack trace - this.originalStack = error.stack; + error.originalStack = error.stack; // Process the stack trace and rewrite the frames. - if (ZoneAwareError[stackRewrite] && this.originalStack) { - var frames_1 = this.originalStack.split('\n'); + if (ZoneAwareError[stackRewrite] && error.originalStack) { + var frames_1 = error.originalStack.split('\n'); var zoneFrame = _currentZoneFrame; var i = 0; // Find the first frame @@ -715,12 +714,12 @@ var Zone$1 = (function (global) { } } } - this.stack = this.zoneAwareStack = frames_1.join('\n'); + error.stack = error.zoneAwareStack = frames_1.join('\n'); } + return error; } - // Copy the prototype so that instanceof operator works as expected - ZoneAwareError.prototype = Object.create(NativeError.prototype); + ZoneAwareError.prototype = NativeError.prototype; ZoneAwareError[Zone.__symbol__('blacklistedStackFrames')] = blackListedStackFrames; ZoneAwareError[stackRewrite] = false; if (NativeError.hasOwnProperty('stackTraceLimit')) { @@ -828,7 +827,12 @@ var Zone$1 = (function (global) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ -var zoneSymbol = function (n) { return ("__zone_symbol__" + n); }; +/** + * Suppress closure compiler errors about unknown 'Zone' variable + * @fileoverview + * @suppress {undefinedVars} + */ +var zoneSymbol = function (n) { return "__zone_symbol__" + n; }; var _global$1 = typeof window === 'object' && window || typeof self === 'object' && self || global; function bindArguments(args, source) { for (var i = args.length - 1; i >= 0; i--) { @@ -843,64 +847,7 @@ function bindArguments(args, source) { var isNode = (!('nw' in _global$1) && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'); -function patchProperty(obj, prop) { - var desc = Object.getOwnPropertyDescriptor(obj, prop) || { enumerable: true, configurable: true }; - var originalDesc = Object.getOwnPropertyDescriptor(obj, 'original' + prop); - if (!originalDesc && desc.get) { - Object.defineProperty(obj, 'original' + prop, { enumerable: false, configurable: true, get: desc.get }); - } - // A property descriptor cannot have getter/setter and be writable - // deleting the writable and value properties avoids this error: - // - // TypeError: property descriptors must not specify a value or be writable when a - // getter or setter has been specified - delete desc.writable; - delete desc.value; - // substr(2) cuz 'onclick' -> 'click', etc - var eventName = prop.substr(2); - var _prop = '_' + prop; - desc.set = function (fn) { - if (this[_prop]) { - this.removeEventListener(eventName, this[_prop]); - } - if (typeof fn === 'function') { - var wrapFn = function (event) { - var result; - result = fn.apply(this, arguments); - if (result != undefined && !result) - event.preventDefault(); - }; - this[_prop] = wrapFn; - this.addEventListener(eventName, wrapFn, false); - } - else { - this[_prop] = null; - } - }; - // The getter would return undefined for unassigned properties but the default value of an - // unassigned property is null - desc.get = function () { - var r = this[_prop] || null; - // result will be null when use inline event attribute, - // such as - // because the onclick function is internal raw uncompiled handler - // the onclick will be evaluated when first time event was triggered or - // the property is accessed, https://github.com/angular/zone.js/issues/525 - // so we should use original native get to retrive the handler - if (r === null) { - var oriDesc = Object.getOwnPropertyDescriptor(obj, 'original' + prop); - if (oriDesc && oriDesc.get) { - r = oriDesc.get.apply(this, arguments); - if (r) { - desc.set.apply(this, [r]); - this.removeAttribute(prop); - } - } - } - return this[_prop] || null; - }; - Object.defineProperty(obj, prop, desc); -} + @@ -1331,7 +1278,7 @@ if (crypto) { crypto.pbkdf2 = function pbkdf2Zone() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { - args[_i - 0] = arguments[_i]; + args[_i] = arguments[_i]; } var fn = args[args.length - 1]; if (typeof fn === 'function') { diff --git a/dist/zone.js b/dist/zone.js index 4aae29dae..972e4fe8b 100644 --- a/dist/zone.js +++ b/dist/zone.js @@ -176,9 +176,9 @@ var Zone$1 = (function (global) { task.cancelFn = null; return value; }; - Zone.__symbol__ = __symbol__; return Zone; }()); + Zone.__symbol__ = __symbol__; var ZoneDelegate = (function () { function ZoneDelegate(zone, parentDelegate, zoneSpec) { @@ -423,7 +423,7 @@ var Zone$1 = (function (global) { } } while (_uncaughtPromiseErrors.length) { - var _loop_1 = function() { + var _loop_1 = function () { var uncaughtPromiseError = _uncaughtPromiseErrors.shift(); try { uncaughtPromiseError.zone.runGuarded(function () { @@ -680,12 +680,11 @@ var Zone$1 = (function (global) { function ZoneAwareError() { // Create an Error. var error = NativeError.apply(this, arguments); - this.message = error.message; // Save original stack trace - this.originalStack = error.stack; + error.originalStack = error.stack; // Process the stack trace and rewrite the frames. - if (ZoneAwareError[stackRewrite] && this.originalStack) { - var frames_1 = this.originalStack.split('\n'); + if (ZoneAwareError[stackRewrite] && error.originalStack) { + var frames_1 = error.originalStack.split('\n'); var zoneFrame = _currentZoneFrame; var i = 0; // Find the first frame @@ -715,12 +714,12 @@ var Zone$1 = (function (global) { } } } - this.stack = this.zoneAwareStack = frames_1.join('\n'); + error.stack = error.zoneAwareStack = frames_1.join('\n'); } + return error; } - // Copy the prototype so that instanceof operator works as expected - ZoneAwareError.prototype = Object.create(NativeError.prototype); + ZoneAwareError.prototype = NativeError.prototype; ZoneAwareError[Zone.__symbol__('blacklistedStackFrames')] = blackListedStackFrames; ZoneAwareError[stackRewrite] = false; if (NativeError.hasOwnProperty('stackTraceLimit')) { @@ -828,7 +827,12 @@ var Zone$1 = (function (global) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ -var zoneSymbol = function (n) { return ("__zone_symbol__" + n); }; +/** + * Suppress closure compiler errors about unknown 'Zone' variable + * @fileoverview + * @suppress {undefinedVars} + */ +var zoneSymbol = function (n) { return "__zone_symbol__" + n; }; var _global$1 = typeof window === 'object' && window || typeof self === 'object' && self || global; function bindArguments(args, source) { for (var i = args.length - 1; i >= 0; i--) { @@ -840,7 +844,7 @@ function bindArguments(args, source) { } function patchPrototype(prototype, fnNames) { var source = prototype.constructor['name']; - var _loop_1 = function(i) { + var _loop_1 = function (i) { var name_1 = fnNames[i]; var delegate = prototype[name_1]; if (delegate) { @@ -1512,7 +1516,7 @@ var unboundKey = zoneSymbol('unbound'); // for `onwhatever` properties and replace them with zone-bound functions // - Chrome (for now) function patchViaCapturingAllTheEvents() { - var _loop_1 = function(i) { + var _loop_1 = function (i) { var property = eventNames[i]; var onproperty = 'on' + property; self.addEventListener(property, function (event) { diff --git a/dist/zone.min.js b/dist/zone.min.js index 3d63fe690..21ef96af3 100644 --- a/dist/zone.min.js +++ b/dist/zone.min.js @@ -1 +1 @@ -!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--)"function"==typeof e[n]&&(e[n]=Zone.current.wrap(e[n],t+"_"+n));return e}function t(t,n){for(var r=t.constructor.name,o=function(o){var a=n[o],i=t[a];i&&(t[a]=function(t){return function(){return t.apply(this,e(arguments,r+"."+a))}}(i))},a=0;a1?new t(e,n):new t(e),i=Object.getOwnPropertyDescriptor(a,"onmessage");return i&&i.configurable===!1?(o=Object.create(a),["addEventListener","removeEventListener","send","close"].forEach(function(e){o[e]=function(){return a[e].apply(a,arguments)}})):o=a,r(o,["close","error","message","open"]),o};for(var n in t)e.WebSocket[n]=t[n]}function b(e){if(!Z){var t="undefined"!=typeof WebSocket;T()?(P&&r(HTMLElement.prototype,A),r(XMLHttpRequest.prototype,null),"undefined"!=typeof IDBIndex&&(r(IDBIndex.prototype,null),r(IDBRequest.prototype,null),r(IDBOpenDBRequest.prototype,null),r(IDBDatabase.prototype,null),r(IDBTransaction.prototype,null),r(IDBCursor.prototype,null)),t&&r(WebSocket.prototype,null)):(_(),c("XMLHttpRequest"),t&&m(e))}}function T(){if(P&&!Object.getOwnPropertyDescriptor(HTMLElement.prototype,"onclick")&&"undefined"!=typeof Element){var e=Object.getOwnPropertyDescriptor(Element.prototype,"onclick");if(e&&!e.configurable)return!1}Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",{get:function(){return!0}});var t=new XMLHttpRequest,n=!!t.onreadystatechange;return Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",{}),n}function _(){for(var e=function(e){var t=A[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][W]&&(t=Zone.current.wrap(o[n],r),t[W]=o[n],o[n]=t),o=o.parentElement},!0)},t=0;t "+n.zone.name+"]",n=n.parent):n=null:t[r]+=" ["+n.zone.name+"]"}}this.stack=this.zoneAwareStack=t.join("\n")}}if(e.Zone)throw new Error("Zone already loaded.");var k=function(){function n(e,t){this._properties=null,this._parent=e,this._name=t?t.name||"unnamed":"",this._properties=t&&t.properties||{},this._zoneDelegate=new v(this,this._parent&&this._parent._zoneDelegate,t)}return n.assertZonePatched=function(){if(e.Promise!==F)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(n,"current",{get:function(){return _.zone},enumerable:!0,configurable:!0}),Object.defineProperty(n,"currentTask",{get:function(){return w},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),n.prototype.get=function(e){var t=this.getZoneWith(e);if(t)return t._properties[e]},n.prototype.getZoneWith=function(e){for(var t=this;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null},n.prototype.fork=function(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)},n.prototype.wrap=function(e,t){if("function"!=typeof e)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)}},n.prototype.run=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),_=new y(_,this);try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{_=_.parent}},n.prototype.runGuarded=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),_=new y(_,this);try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(o){if(this._zoneDelegate.handleError(this,o))throw o}}finally{_=_.parent}},n.prototype.runTask=function(e,t,n){if(e.runCount++,e.zone!=this)throw new Error("A task can only be run in the zone which created it! (Creation: "+e.zone.name+"; Execution: "+this.name+")");var r=w;w=e,_=new y(_,this);try{"macroTask"==e.type&&e.data&&!e.data.isPeriodic&&(e.cancelFn=null);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(o){if(this._zoneDelegate.handleError(this,o))throw o}}finally{_=_.parent,w=r}},n.prototype.scheduleMicroTask=function(e,t,n,r){return this._zoneDelegate.scheduleTask(this,new g("microTask",this,e,t,n,r,null))},n.prototype.scheduleMacroTask=function(e,t,n,r,o){return this._zoneDelegate.scheduleTask(this,new g("macroTask",this,e,t,n,r,o))},n.prototype.scheduleEventTask=function(e,t,n,r,o){return this._zoneDelegate.scheduleTask(this,new g("eventTask",this,e,t,n,r,o))},n.prototype.cancelTask=function(e){var t=this._zoneDelegate.cancelTask(this,e);return e.runCount=-1,e.cancelFn=null,t},n.__symbol__=t,n}(),v=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=n&&(n.onHasTask?n:t._hasTaskZS),this._hasTaskDlgt=n&&(n.onHasTask?t:t._hasTaskDlgt),this._hasTaskCurrZone=n&&(n.onHasTask?this.zone:t.zone)}return e.prototype.fork=function(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new k(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){try{if(this._scheduleTaskZS)return this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t);if(t.scheduleFn)t.scheduleFn(t);else{if("microTask"!=t.type)throw new Error("Task is missing scheduleFn.");r(t)}return t}finally{e==this.zone&&this._updateTaskCount(t.type,1)}},e.prototype.invokeTask=function(e,t,n,r){try{return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,r):t.callback.apply(n,r)}finally{e!=this.zone||"eventTask"==t.type||t.data&&t.data.isPeriodic||this._updateTaskCount(t.type,-1)}},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 new Error("Task does not support cancellation, or is already canceled.");n=t.cancelFn(t)}return e==this.zone&&this._updateTaskCount(t.type,-1),n},e.prototype.hasTask=function(e,t){return this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)},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};try{this.hasTask(this.zone,a)}finally{this._parentDelegate&&this._parentDelegate._updateTaskCount(e,t)}}},e}(),g=function(){function e(e,t,n,r,o,i,s){this.runCount=0,this.type=e,this.zone=t,this.source=n,this.data=o,this.scheduleFn=i,this.cancelFn=s,this.callback=r;var u=this;this.invoke=function(){O++;try{return t.runTask(u,this,arguments)}finally{1==O&&a(),O--}}}return e.prototype.toString=function(){return this.data&&"undefined"!=typeof this.data.handleId?this.data.handleId:Object.prototype.toString.call(this)},e}(),y=function(){function e(e,t){this.parent=e,this.zone=t}return e}(),m=t("setTimeout"),b=t("Promise"),T=t("then"),_=new y(null,new k(null,null)),w=null,S=[],E=!1,D=[],O=0,Z=t("state"),P=t("value"),C="Promise.then",z=null,j=!0,I=!1,L=0,F=function(){function e(t){var n=this;if(!(n instanceof e))throw new Error("Must be an instanceof Promise.");n[Z]=z,n[P]=[];try{t&&t(c(n,j),c(n,I))}catch(r){l(n,!1,r)}}return e.resolve=function(e){return l(new this(null),j,e)},e.reject=function(e){return l(new this(null),I,e)},e.race=function(e){function t(e){a&&(a=r(e))}function n(e){a&&(a=o(e))}for(var r,o,a=new this(function(e,t){n=[e,t],r=n[0],o=n[1];var n}),s=0,u=e;s=0;n--)"function"==typeof e[n]&&(e[n]=Zone.current.wrap(e[n],t+"_"+n));return e}function t(t,n){for(var r=t.constructor.name,o=function(o){var a=n[o],i=t[a];i&&(t[a]=function(t){return function(){return t.apply(this,e(arguments,r+"."+a))}}(i))},a=0;a1?new t(e,n):new t(e),i=Object.getOwnPropertyDescriptor(a,"onmessage");return i&&i.configurable===!1?(o=Object.create(a),["addEventListener","removeEventListener","send","close"].forEach(function(e){o[e]=function(){return a[e].apply(a,arguments)}})):o=a,r(o,["close","error","message","open"]),o};for(var n in t)e.WebSocket[n]=t[n]}function b(e){if(!Z){var t="undefined"!=typeof WebSocket;T()?(P&&r(HTMLElement.prototype,A),r(XMLHttpRequest.prototype,null),"undefined"!=typeof IDBIndex&&(r(IDBIndex.prototype,null),r(IDBRequest.prototype,null),r(IDBOpenDBRequest.prototype,null),r(IDBDatabase.prototype,null),r(IDBTransaction.prototype,null),r(IDBCursor.prototype,null)),t&&r(WebSocket.prototype,null)):(_(),c("XMLHttpRequest"),t&&m(e))}}function T(){if(P&&!Object.getOwnPropertyDescriptor(HTMLElement.prototype,"onclick")&&"undefined"!=typeof Element){var e=Object.getOwnPropertyDescriptor(Element.prototype,"onclick");if(e&&!e.configurable)return!1}Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",{get:function(){return!0}});var t=new XMLHttpRequest,n=!!t.onreadystatechange;return Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",{}),n}function _(){for(var e=function(e){var t=A[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][W]&&(t=Zone.current.wrap(o[n],r),t[W]=o[n],o[n]=t),o=o.parentElement},!0)},t=0;t "+n.zone.name+"]",n=n.parent):n=null:t[r]+=" ["+n.zone.name+"]"}}e.stack=e.zoneAwareStack=t.join("\n")}return e}if(e.Zone)throw new Error("Zone already loaded.");var k=function(){function t(e,t){this._properties=null,this._parent=e,this._name=t?t.name||"unnamed":"",this._properties=t&&t.properties||{},this._zoneDelegate=new v(this,this._parent&&this._parent._zoneDelegate,t)}return t.assertZonePatched=function(){if(e.Promise!==F)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(t,"current",{get:function(){return _.zone},enumerable:!0,configurable:!0}),Object.defineProperty(t,"currentTask",{get:function(){return w},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),t.prototype.get=function(e){var t=this.getZoneWith(e);if(t)return t._properties[e]},t.prototype.getZoneWith=function(e){for(var t=this;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null},t.prototype.fork=function(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)},t.prototype.wrap=function(e,t){if("function"!=typeof e)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)}},t.prototype.run=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),_=new y(_,this);try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{_=_.parent}},t.prototype.runGuarded=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),_=new y(_,this);try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(o){if(this._zoneDelegate.handleError(this,o))throw o}}finally{_=_.parent}},t.prototype.runTask=function(e,t,n){if(e.runCount++,e.zone!=this)throw new Error("A task can only be run in the zone which created it! (Creation: "+e.zone.name+"; Execution: "+this.name+")");var r=w;w=e,_=new y(_,this);try{"macroTask"==e.type&&e.data&&!e.data.isPeriodic&&(e.cancelFn=null);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(o){if(this._zoneDelegate.handleError(this,o))throw o}}finally{_=_.parent,w=r}},t.prototype.scheduleMicroTask=function(e,t,n,r){return this._zoneDelegate.scheduleTask(this,new g("microTask",this,e,t,n,r,null))},t.prototype.scheduleMacroTask=function(e,t,n,r,o){return this._zoneDelegate.scheduleTask(this,new g("macroTask",this,e,t,n,r,o))},t.prototype.scheduleEventTask=function(e,t,n,r,o){return this._zoneDelegate.scheduleTask(this,new g("eventTask",this,e,t,n,r,o))},t.prototype.cancelTask=function(e){var t=this._zoneDelegate.cancelTask(this,e);return e.runCount=-1,e.cancelFn=null,t},t}();k.__symbol__=t;var v=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=n&&(n.onHasTask?n:t._hasTaskZS),this._hasTaskDlgt=n&&(n.onHasTask?t:t._hasTaskDlgt),this._hasTaskCurrZone=n&&(n.onHasTask?this.zone:t.zone)}return e.prototype.fork=function(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new k(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){try{if(this._scheduleTaskZS)return this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t);if(t.scheduleFn)t.scheduleFn(t);else{if("microTask"!=t.type)throw new Error("Task is missing scheduleFn.");r(t)}return t}finally{e==this.zone&&this._updateTaskCount(t.type,1)}},e.prototype.invokeTask=function(e,t,n,r){try{return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,r):t.callback.apply(n,r)}finally{e!=this.zone||"eventTask"==t.type||t.data&&t.data.isPeriodic||this._updateTaskCount(t.type,-1)}},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 new Error("Task does not support cancellation, or is already canceled.");n=t.cancelFn(t)}return e==this.zone&&this._updateTaskCount(t.type,-1),n},e.prototype.hasTask=function(e,t){return this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)},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};try{this.hasTask(this.zone,a)}finally{this._parentDelegate&&this._parentDelegate._updateTaskCount(e,t)}}},e}(),g=function(){function e(e,t,n,r,o,i,s){this.runCount=0,this.type=e,this.zone=t,this.source=n,this.data=o,this.scheduleFn=i,this.cancelFn=s,this.callback=r;var u=this;this.invoke=function(){O++;try{return t.runTask(u,this,arguments)}finally{1==O&&a(),O--}}}return e.prototype.toString=function(){return this.data&&"undefined"!=typeof this.data.handleId?this.data.handleId:Object.prototype.toString.call(this)},e}(),y=function(){function e(e,t){this.parent=e,this.zone=t}return e}(),m=t("setTimeout"),b=t("Promise"),T=t("then"),_=new y(null,new k(null,null)),w=null,S=[],E=!1,D=[],O=0,Z=t("state"),P=t("value"),C="Promise.then",z=null,j=!0,I=!1,L=0,F=function(){function e(t){var n=this;if(!(n instanceof e))throw new Error("Must be an instanceof Promise.");n[Z]=z,n[P]=[];try{t&&t(c(n,j),c(n,I))}catch(r){l(n,!1,r)}}return e.resolve=function(e){return l(new this(null),j,e)},e.reject=function(e){return l(new this(null),I,e)},e.race=function(e){function t(e){a&&(a=r(e))}function n(e){a&&(a=o(e))}for(var r,o,a=new this(function(e,t){n=[e,t],r=n[0],o=n[1];var n}),s=0,u=e;s