blob: 4e3f33ab92e8ce56cb86ce6d034394fc4f8018d4 [file] [log] [blame]
"use strict";
/**
* @license Angular v12.0.0-next.0
* (c) 2010-2020 Google LLC. https://angular.io/
* License: MIT
*/!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* 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 e=function(){function e(e){void 0===e&&(e=null),this.defaultSpecDelegate=e,this.name="ProxyZone",this._delegateSpec=null,this.properties={ProxyZoneSpec:this},this.propertyKeys=null,this.lastTaskState=null,this.isNeedToTriggerHasTask=!1,this.tasks=[],this.setDelegate(e)}return e.get=function(){return Zone.current.get("ProxyZoneSpec")},e.isLoaded=function(){return e.get()instanceof e},e.assertPresent=function(){if(!e.isLoaded())throw new Error("Expected to be running in 'ProxyZone', but it was not found.");return e.get()},e.prototype.setDelegate=function(e){var t=this,s=this._delegateSpec!==e;this._delegateSpec=e,this.propertyKeys&&this.propertyKeys.forEach((function(e){return delete t.properties[e]})),this.propertyKeys=null,e&&e.properties&&(this.propertyKeys=Object.keys(e.properties),this.propertyKeys.forEach((function(s){return t.properties[s]=e.properties[s]}))),s&&this.lastTaskState&&(this.lastTaskState.macroTask||this.lastTaskState.microTask)&&(this.isNeedToTriggerHasTask=!0)},e.prototype.getDelegate=function(){return this._delegateSpec},e.prototype.resetDelegate=function(){this.getDelegate(),this.setDelegate(this.defaultSpecDelegate)},e.prototype.tryTriggerHasTask=function(e,t,s){this.isNeedToTriggerHasTask&&this.lastTaskState&&(this.isNeedToTriggerHasTask=!1,this.onHasTask(e,t,s,this.lastTaskState))},e.prototype.removeFromTasks=function(e){if(this.tasks)for(var t=0;t<this.tasks.length;t++)if(this.tasks[t]===e)return void this.tasks.splice(t,1)},e.prototype.getAndClearPendingTasksInfo=function(){if(0===this.tasks.length)return"";var e="--Pending async tasks are: ["+this.tasks.map((function(e){var t=e.data&&Object.keys(e.data).map((function(t){return t+":"+e.data[t]})).join(",");return"type: "+e.type+", source: "+e.source+", args: {"+t+"}"}))+"]";return this.tasks=[],e},e.prototype.onFork=function(e,t,s,n){return this._delegateSpec&&this._delegateSpec.onFork?this._delegateSpec.onFork(e,t,s,n):e.fork(s,n)},e.prototype.onIntercept=function(e,t,s,n,r){return this._delegateSpec&&this._delegateSpec.onIntercept?this._delegateSpec.onIntercept(e,t,s,n,r):e.intercept(s,n,r)},e.prototype.onInvoke=function(e,t,s,n,r,a,o){return this.tryTriggerHasTask(e,t,s),this._delegateSpec&&this._delegateSpec.onInvoke?this._delegateSpec.onInvoke(e,t,s,n,r,a,o):e.invoke(s,n,r,a,o)},e.prototype.onHandleError=function(e,t,s,n){return this._delegateSpec&&this._delegateSpec.onHandleError?this._delegateSpec.onHandleError(e,t,s,n):e.handleError(s,n)},e.prototype.onScheduleTask=function(e,t,s,n){return"eventTask"!==n.type&&this.tasks.push(n),this._delegateSpec&&this._delegateSpec.onScheduleTask?this._delegateSpec.onScheduleTask(e,t,s,n):e.scheduleTask(s,n)},e.prototype.onInvokeTask=function(e,t,s,n,r,a){return"eventTask"!==n.type&&this.removeFromTasks(n),this.tryTriggerHasTask(e,t,s),this._delegateSpec&&this._delegateSpec.onInvokeTask?this._delegateSpec.onInvokeTask(e,t,s,n,r,a):e.invokeTask(s,n,r,a)},e.prototype.onCancelTask=function(e,t,s,n){return"eventTask"!==n.type&&this.removeFromTasks(n),this.tryTriggerHasTask(e,t,s),this._delegateSpec&&this._delegateSpec.onCancelTask?this._delegateSpec.onCancelTask(e,t,s,n):e.cancelTask(s,n)},e.prototype.onHasTask=function(e,t,s,n){this.lastTaskState=n,this._delegateSpec&&this._delegateSpec.onHasTask?this._delegateSpec.onHasTask(e,t,s,n):e.hasTask(s,n)},e}();Zone.ProxyZoneSpec=e}));