UNPKG

@angular/core

Version:

Angular - the core framework

143 lines (141 loc) 48.9 kB
/** * @license Angular v10.0.3 * (c) 2010-2020 Google LLC. https://angular.io/ * License: MIT */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/compiler")):"function"==typeof define&&define.amd?define("@angular/core/testing",["exports","@angular/core","@angular/compiler"],t):t(((e=e||self).ng=e.ng||{},e.ng.core=e.ng.core||{},e.ng.core.testing={}),e.ng.core,e.ng.compiler)}(this,(function(e,t,r){"use strict"; /** * @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 n="undefined"==typeof window?global:window;function o(e,t,r,n){var o=Zone.current,i=Zone.AsyncTestZoneSpec;if(void 0===i)throw new Error("AsyncTestZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/dist/async-test.js");var s=Zone.ProxyZoneSpec;if(void 0===s)throw new Error("ProxyZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/dist/proxy.js");var u=s.get();s.assertPresent();var c=Zone.current.getZoneWith("ProxyZoneSpec"),a=u.getDelegate();return c.parent.run((function(){var e=new i((function(){o.run((function(){u.getDelegate()==e&&u.setDelegate(a),r()}))}),(function(t){o.run((function(){u.getDelegate()==e&&u.setDelegate(a),n(t)}))}),"test");u.setDelegate(e)})),Zone.current.runGuarded(e,t)} /** * @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 */ /** * @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 i=function(){function e(e,r,n){var o=this;this.componentRef=e,this.ngZone=r,this._autoDetect=n,this._isStable=!0,this._isDestroyed=!1,this._resolve=null,this._promise=null,this._onUnstableSubscription=null,this._onStableSubscription=null,this._onMicrotaskEmptySubscription=null,this._onErrorSubscription=null,this.changeDetectorRef=e.changeDetectorRef,this.elementRef=e.location,this.debugElement=t.getDebugNode(this.elementRef.nativeElement),this.componentInstance=e.instance,this.nativeElement=this.elementRef.nativeElement,this.componentRef=e,this.ngZone=r,r&&r.runOutsideAngular((function(){o._onUnstableSubscription=r.onUnstable.subscribe({next:function(){o._isStable=!1}}),o._onMicrotaskEmptySubscription=r.onMicrotaskEmpty.subscribe({next:function(){o._autoDetect&&o.detectChanges(!0)}}),o._onStableSubscription=r.onStable.subscribe({next:function(){o._isStable=!0,null!==o._promise&&function e(t){Zone.current.scheduleMicroTask("scheduleMicrotask",t)} /** * @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 */((function(){r.hasPendingMacrotasks||null!==o._promise&&(o._resolve(!0),o._resolve=null,o._promise=null)}))}}),o._onErrorSubscription=r.onError.subscribe({next:function(e){throw e}})}))}return e.prototype._tick=function(e){this.changeDetectorRef.detectChanges(),e&&this.checkNoChanges()},e.prototype.detectChanges=function(e){var t=this;void 0===e&&(e=!0),null!=this.ngZone?this.ngZone.run((function(){t._tick(e)})):this._tick(e)},e.prototype.checkNoChanges=function(){this.changeDetectorRef.checkNoChanges()},e.prototype.autoDetectChanges=function(e){if(void 0===e&&(e=!0),null==this.ngZone)throw new Error("Cannot call autoDetectChanges when ComponentFixtureNoNgZone is set");this._autoDetect=e,this.detectChanges()},e.prototype.isStable=function(){return this._isStable&&!this.ngZone.hasPendingMacrotasks},e.prototype.whenStable=function(){var e=this;return this.isStable()?Promise.resolve(!1):(null!==this._promise||(this._promise=new Promise((function(t){e._resolve=t}))),this._promise)},e.prototype._getRenderer=function(){return void 0===this._renderer&&(this._renderer=this.componentRef.injector.get(t.RendererFactory2,null)),this._renderer},e.prototype.whenRenderingDone=function(){var e=this._getRenderer();return e&&e.whenRenderingDone?e.whenRenderingDone():this.whenStable()},e.prototype.destroy=function(){this._isDestroyed||(this.componentRef.destroy(),null!=this._onUnstableSubscription&&(this._onUnstableSubscription.unsubscribe(),this._onUnstableSubscription=null),null!=this._onStableSubscription&&(this._onStableSubscription.unsubscribe(),this._onStableSubscription=null),null!=this._onMicrotaskEmptySubscription&&(this._onMicrotaskEmptySubscription.unsubscribe(),this._onMicrotaskEmptySubscription=null),null!=this._onErrorSubscription&&(this._onErrorSubscription.unsubscribe(),this._onErrorSubscription=null),this._isDestroyed=!0)},e}(),s="undefined"!=typeof Zone?Zone:null,u=s&&s.FakeAsyncTestZoneSpec,c=s&&s.ProxyZoneSpec,a=null;function l(){a&&a.unlockDatePatch(),a=null,c&&c.assertPresent().resetDelegate()}var p=!1;function d(){if(null==a)throw new Error("The code should be running in the fakeAsync zone to call this function");return a}function h(){d().flushMicrotasks()} /** * @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 f="undefined"!=typeof Zone?Zone:null,v=f&&f[f.__symbol__("fakeAsyncTest")];function m(){return v?v.resetFakeAsyncZone():l()} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var y=function(e,t){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function g(e,t){function r(){this.constructor=e}y(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var _=function(){return(_=Object.assign||function e(t){for(var r,n=1,o=arguments.length;n<o;n++)for(var i in r=arguments[n])Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i]);return t}).apply(this,arguments)};function M(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function u(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):function t(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(s,u)}c((n=n.apply(e,t||[])).next())}))}function O(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function c(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function b(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function T(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function w(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(T(arguments[t]));return e} /** * @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 C=function(){function e(){var e=this;this._promise=new Promise((function(t,r){e._resolve=t,e._reject=r}))}return e.prototype.done=function(e){this._resolve(e)},e.prototype.fail=function(e,t){this._reject(e)},Object.defineProperty(e.prototype,"promise",{get:function(){return this._promise},enumerable:!1,configurable:!0}),e}(); /** * @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 */function E(e){var t=[],r=new Map;function n(t){var n=r.get(t);if(!n){var o=e(t);r.set(t,n=o.then(F))}return n}return D.forEach((function(e,r){var o=[];e.templateUrl&&o.push(n(e.templateUrl).then((function(t){e.template=t})));var i=e.styleUrls,s=e.styles||(e.styles=[]),u=e.styles.length;i&&i.forEach((function(t,r){s.push(""),o.push(n(t).then((function(n){s[u+r]=n,i.splice(i.indexOf(t),1),0==i.length&&(e.styleUrls=void 0)})))}));var c=Promise.all(o).then((function(){return function e(t){P.delete(t)} /** * @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 */(r)}));t.push(c)})),N(),Promise.all(t).then((function(){}))}var D=new Map,P=new Set;function S(e){return P.has(e)}function N(){var e=D;return D=new Map,e}function F(e){return"string"==typeof e?e:e.text()}var j=0,R=function(){function e(){this._references=new Map}return e.prototype.overrideMetadata=function(e,r,n){var o={};if(r&&function i(e){var t=[];Object.keys(e).forEach((function(e){e.startsWith("_")||t.push(e)}));for(var r=e;r=Object.getPrototypeOf(r);)Object.keys(r).forEach((function(e){var n=Object.getOwnPropertyDescriptor(r,e);!e.startsWith("_")&&n&&"get"in n&&t.push(e)}));return t} /** * @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 */(r).forEach((function(e){return o[e]=r[e]})),n.set){if(n.remove||n.add)throw new Error("Cannot set and add/remove "+t.ɵstringify(e)+" at the same time!");!function s(e,t){for(var r in t)e[r]=t[r]}(o,n.set)}return n.remove&&function u(e,t,r){var n=new Set,o=function(e){var o=t[e];Array.isArray(o)?o.forEach((function(t){n.add(A(e,t,r))})):n.add(A(e,o,r))};for(var i in t)o(i);var s=function(t){var o=e[t];Array.isArray(o)?e[t]=o.filter((function(e){return!n.has(A(t,e,r))})):n.has(A(t,o,r))&&(e[t]=void 0)};for(var i in e)s(i)}(o,n.remove,this._references),n.add&&function c(e,t){for(var r in t){var n=t[r],o=e[r];e[r]=null!=o&&Array.isArray(o)?o.concat(n):n}}(o,n.add),new e(o)},e}();function A(e,r,n){return e+":"+JSON.stringify(r,(function(e,r){return"function"==typeof r&&(r=function o(e,r){var n=r.get(e);return n||(n=""+t.ɵstringify(e)+j++,r.set(e,n)),n}(r,n)),r}))}var I,k=new t.ɵReflectionCapabilities,x=function(){function e(){this.overrides=new Map,this.resolved=new Map}return e.prototype.addOverride=function(e,t){var r=this.overrides.get(e)||[];r.push(t),this.overrides.set(e,r),this.resolved.delete(e)},e.prototype.setOverrides=function(e){var t=this;this.overrides.clear(),e.forEach((function(e){var r=T(e,2);t.addOverride(r[0],r[1])}))},e.prototype.getAnnotation=function(e){for(var r=k.annotations(e),n=r.length-1;n>=0;n--){var o=r[n];if(o instanceof t.Directive||o instanceof t.Component||o instanceof t.Pipe||o instanceof t.NgModule)return o instanceof this.type?o:null}return null},e.prototype.resolve=function(e){var t=this,r=this.resolved.get(e)||null;if(!r){if(r=this.getAnnotation(e)){var n=this.overrides.get(e);if(n){var o=new R;n.forEach((function(e){r=o.overrideMetadata(t.type,r,e)}))}}this.resolved.set(e,r)}return r},e}(),Z=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return g(r,e),Object.defineProperty(r.prototype,"type",{get:function(){return t.Directive},enumerable:!1,configurable:!0}),r}(x),U=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return g(r,e),Object.defineProperty(r.prototype,"type",{get:function(){return t.Component},enumerable:!1,configurable:!0}),r}(x),B=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return g(r,e),Object.defineProperty(r.prototype,"type",{get:function(){return t.Pipe},enumerable:!1,configurable:!0}),r}(x),G=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return g(r,e),Object.defineProperty(r.prototype,"type",{get:function(){return t.NgModule},enumerable:!1,configurable:!0}),r}(x);!function(e){e[e.DECLARATION=0]="DECLARATION",e[e.OVERRIDE_TEMPLATE=1]="OVERRIDE_TEMPLATE"}(I||(I={}));var L=function(){function e(e,t){this.platform=e,this.additionalModuleTypes=t,this.originalComponentResolutionQueue=null,this.declarations=[],this.imports=[],this.providers=[],this.schemas=[],this.pendingComponents=new Set,this.pendingDirectives=new Set,this.pendingPipes=new Set,this.seenComponents=new Set,this.seenDirectives=new Set,this.overriddenModules=new Set,this.existingComponentStyles=new Map,this.resolvers=function r(){return{module:new G,component:new U,directive:new Z,pipe:new B}}(),this.componentToModuleScope=new Map,this.initialNgDefs=new Map,this.defCleanupOps=[],this._injector=null,this.compilerProviders=null,this.providerOverrides=[],this.rootProviderOverrides=[],this.providerOverridesByModule=new Map,this.providerOverridesByToken=new Map,this.moduleProvidersOverridden=new Set,this.testModuleRef=null,this.testModuleType=function n(){}}return e.prototype.setCompilerProviders=function(e){this.compilerProviders=e,this._injector=null},e.prototype.configureTestingModule=function(e){var t,r,n,o;void 0!==e.declarations&&(this.queueTypeArray(e.declarations,I.DECLARATION),(t=this.declarations).push.apply(t,w(e.declarations))),void 0!==e.imports&&(this.queueTypesFromModulesArray(e.imports),(r=this.imports).push.apply(r,w(e.imports))),void 0!==e.providers&&(n=this.providers).push.apply(n,w(e.providers)),void 0!==e.schemas&&(o=this.schemas).push.apply(o,w(e.schemas))},e.prototype.overrideModule=function(e,t){this.overriddenModules.add(e),this.resolvers.module.addOverride(e,t);var r=this.resolvers.module.resolve(e);if(null===r)throw J(e.name,"NgModule");this.recompileNgModule(e,r),this.queueTypesFromModulesArray([e])},e.prototype.overrideComponent=function(e,t){this.resolvers.component.addOverride(e,t),this.pendingComponents.add(e)},e.prototype.overrideDirective=function(e,t){this.resolvers.directive.addOverride(e,t),this.pendingDirectives.add(e)},e.prototype.overridePipe=function(e,t){this.resolvers.pipe.addOverride(e,t),this.pendingPipes.add(e)},e.prototype.overrideProvider=function(e,r){var n;n=void 0!==r.useFactory?{provide:e,useFactory:r.useFactory,deps:r.deps||[],multi:r.multi}:void 0!==r.useValue?{provide:e,useValue:r.useValue,multi:r.multi}:{provide:e};var o="string"!=typeof e?t.ɵgetInjectableDef(e):null;if((null!==o&&"root"===o.providedIn?this.rootProviderOverrides:this.providerOverrides).push(n),this.providerOverridesByToken.set(e,n),null!==o&&null!==o.providedIn&&"string"!=typeof o.providedIn){var i=this.providerOverridesByModule.get(o.providedIn);void 0!==i?i.push(n):this.providerOverridesByModule.set(o.providedIn,[n])}},e.prototype.overrideTemplateUsingTestingModule=function(e,r){var n,o=e[t.ɵNG_COMP_DEF],i=!!o&&!S(e)&&!!(n=this.resolvers.component.resolve(e)).styleUrls&&n.styleUrls.length>0;this.overrideComponent(e,{set:i?{template:r,styles:[],styleUrls:[]}:{template:r}}),i&&o.styles&&o.styles.length>0&&this.existingComponentStyles.set(e,o.styles),this.componentToModuleScope.set(e,I.OVERRIDE_TEMPLATE)},e.prototype.compileComponents=function(){return M(this,void 0,void 0,(function(){var e,t=this;return O(this,(function(n){switch(n.label){case 0:return this.clearComponentResolutionQueue(),this.compileTypesSync()?[4,E((function(n){return e||(e=t.injector.get(r.ResourceLoader)),Promise.resolve(e.get(n))}))]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},e.prototype.finalize=function(){this.compileTypesSync(),this.compileTestModule(),this.applyTransitiveScopes(),this.applyProviderOverrides(),this.patchComponentsWithExistingStyles(),this.componentToModuleScope.clear(),this.testModuleRef=new t.ɵRender3NgModuleRef(this.testModuleType,this.platform.injector),this.testModuleRef.injector.get(t.ApplicationInitStatus).runInitializers();var e=this.testModuleRef.injector.get(t.LOCALE_ID,t.ɵDEFAULT_LOCALE_ID);return t.ɵsetLocaleId(e),this.testModuleRef},e.prototype._compileNgModuleSync=function(e){this.queueTypesFromModulesArray([e]),this.compileTypesSync(),this.applyProviderOverrides(),this.applyProviderOverridesToModule(e),this.applyTransitiveScopes()},e.prototype._compileNgModuleAsync=function(e){return M(this,void 0,void 0,(function(){return O(this,(function(t){switch(t.label){case 0:return this.queueTypesFromModulesArray([e]),[4,this.compileComponents()];case 1:return t.sent(),this.applyProviderOverrides(),this.applyProviderOverridesToModule(e),this.applyTransitiveScopes(),[2]}}))}))},e.prototype._getModuleResolver=function(){return this.resolvers.module},e.prototype._getComponentFactories=function(e){var r=this;return q(e.ɵmod.declarations).reduce((function(e,n){var o=n.ɵcmp;return o&&e.push(new t.ɵRender3ComponentFactory(o,r.testModuleRef)),e}),[])},e.prototype.compileTypesSync=function(){var e=this,r=!1;return this.pendingComponents.forEach((function(n){r=r||S(n);var o=e.resolvers.component.resolve(n);if(null===o)throw J(n.name,"Component");e.maybeStoreNgDef(t.ɵNG_COMP_DEF,n),t.ɵcompileComponent(n,o)})),this.pendingComponents.clear(),this.pendingDirectives.forEach((function(r){var n=e.resolvers.directive.resolve(r);if(null===n)throw J(r.name,"Directive");e.maybeStoreNgDef(t.ɵNG_DIR_DEF,r),t.ɵcompileDirective(r,n)})),this.pendingDirectives.clear(),this.pendingPipes.forEach((function(r){var n=e.resolvers.pipe.resolve(r);if(null===n)throw J(r.name,"Pipe");e.maybeStoreNgDef(t.ɵNG_PIPE_DEF,r),t.ɵcompilePipe(r,n)})),this.pendingPipes.clear(),r},e.prototype.applyTransitiveScopes=function(){var e=this;if(this.overriddenModules.size>0){var r=this.collectModulesAffectedByOverrides(this.testModuleType[t.ɵNG_MOD_DEF].imports);r.size>0&&r.forEach((function(r){e.storeFieldOfDefOnType(r,t.ɵNG_MOD_DEF,"transitiveCompileScopes"),r[t.ɵNG_MOD_DEF].transitiveCompileScopes=null}))}var n=new Map;this.componentToModuleScope.forEach((function(r,o){var i=function(r){if(!n.has(r)){var o=function i(e){return e===I.DECLARATION||e===I.OVERRIDE_TEMPLATE}(r);n.set(r,t.ɵtransitiveScopesFor(o?e.testModuleType:r))}return n.get(r)}(r);e.storeFieldOfDefOnType(o,t.ɵNG_COMP_DEF,"directiveDefs"),e.storeFieldOfDefOnType(o,t.ɵNG_COMP_DEF,"pipeDefs"),t.ɵpatchComponentDefWithScope(o.ɵcmp,i)})),this.componentToModuleScope.clear()},e.prototype.applyProviderOverrides=function(){var e=this,r=function(r){return function(n){var o=(r===t.ɵNG_COMP_DEF?e.resolvers.component:e.resolvers.directive).resolve(n);e.hasProviderOverrides(o.providers)&&e.patchDefWithProviderOverrides(n,r)}};this.seenComponents.forEach(r(t.ɵNG_COMP_DEF)),this.seenDirectives.forEach(r(t.ɵNG_DIR_DEF)),this.seenComponents.clear(),this.seenDirectives.clear()},e.prototype.applyProviderOverridesToModule=function(e){var r,n,o,i;if(!this.moduleProvidersOverridden.has(e)){this.moduleProvidersOverridden.add(e);var s=e[t.ɵNG_INJ_DEF];if(this.providerOverridesByToken.size>0){var u=w(s.providers,this.providerOverridesByModule.get(e)||[]);this.hasProviderOverrides(u)&&(this.maybeStoreNgDef(t.ɵNG_INJ_DEF,e),this.storeFieldOfDefOnType(e,t.ɵNG_INJ_DEF,"providers"),s.providers=this.getOverriddenProviders(u));var c=q(e[t.ɵNG_MOD_DEF].imports);try{for(var a=b(c),l=a.next();!l.done;l=a.next())this.applyProviderOverridesToModule(h=l.value)}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}try{for(var p=b(W(s.imports)),d=p.next();!d.done;d=p.next()){var h;(h=d.value).hasOwnProperty("ngModule")&&(this.defCleanupOps.push({object:h,fieldName:"providers",originalValue:h.providers}),h.providers=this.getOverriddenProviders(h.providers))}}catch(e){o={error:e}}finally{try{d&&!d.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}}}},e.prototype.patchComponentsWithExistingStyles=function(){this.existingComponentStyles.forEach((function(e,r){return r[t.ɵNG_COMP_DEF].styles=e})),this.existingComponentStyles.clear()},e.prototype.queueTypeArray=function(e,t){var r,n;try{for(var o=b(e),i=o.next();!i.done;i=o.next()){var s=i.value;Array.isArray(s)?this.queueTypeArray(s,t):this.queueType(s,t)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},e.prototype.recompileNgModule=function(e,r){this.maybeStoreNgDef(t.ɵNG_MOD_DEF,e),this.maybeStoreNgDef(t.ɵNG_INJ_DEF,e),t.ɵcompileNgModuleDefs(e,r)},e.prototype.queueType=function(e,r){return this.resolvers.component.resolve(e)?(!S(e)&&e.hasOwnProperty(t.ɵNG_COMP_DEF)||this.pendingComponents.add(e),this.seenComponents.add(e),void(this.componentToModuleScope.has(e)&&this.componentToModuleScope.get(e)!==I.DECLARATION||this.componentToModuleScope.set(e,r))):this.resolvers.directive.resolve(e)?(e.hasOwnProperty(t.ɵNG_DIR_DEF)||this.pendingDirectives.add(e),void this.seenDirectives.add(e)):void(!this.resolvers.pipe.resolve(e)||e.hasOwnProperty(t.ɵNG_PIPE_DEF)||this.pendingPipes.add(e))},e.prototype.queueTypesFromModulesArray=function(e){var t=this,r=new Set,n=function(e){var o,i;try{for(var s=b(e),u=s.next();!u.done;u=s.next()){var c=u.value;if(Array.isArray(c))n(c);else if(V(c)){var a=c.ɵmod;if(r.has(a))continue;r.add(a),t.queueTypeArray(q(a.declarations),c),n(q(a.imports)),n(q(a.exports))}}}catch(e){o={error:e}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}};n(e)},e.prototype.collectModulesAffectedByOverrides=function(e){var r=this,n=new Set,o=new Set,i=function(e,s){var u,c;try{for(var a=b(e),l=a.next();!l.done;l=a.next()){var p=l.value;if(Array.isArray(p))i(p,s);else if(V(p)){if(n.has(p)){o.has(p)&&s.forEach((function(e){return o.add(e)}));continue}n.add(p),r.overriddenModules.has(p)&&s.forEach((function(e){return o.add(e)})),i(q(p[t.ɵNG_MOD_DEF].imports),s.concat(p))}}}catch(e){u={error:e}}finally{try{l&&!l.done&&(c=a.return)&&c.call(a)}finally{if(u)throw u.error}}};return i(e,[]),o},e.prototype.maybeStoreNgDef=function(e,t){if(!this.initialNgDefs.has(t)){var r=Object.getOwnPropertyDescriptor(t,e);this.initialNgDefs.set(t,[e,r])}},e.prototype.storeFieldOfDefOnType=function(e,t,r){var n=e[t];this.defCleanupOps.push({object:n,fieldName:r,originalValue:n[r]})},e.prototype.clearComponentResolutionQueue=function(){var e=this;null===this.originalComponentResolutionQueue&&(this.originalComponentResolutionQueue=new Map),N().forEach((function(t,r){return e.originalComponentResolutionQueue.set(r,t)}))},e.prototype.restoreComponentResolutionQueue=function(){null!==this.originalComponentResolutionQueue&&(function e(t){P.clear(),t.forEach((function(e,t){return P.add(t)})),D=t}(this.originalComponentResolutionQueue),this.originalComponentResolutionQueue=null)},e.prototype.restoreOriginalState=function(){Q(this.defCleanupOps,(function(e){e.object[e.fieldName]=e.originalValue})),this.initialNgDefs.forEach((function(e,t){var r=T(e,2),n=r[0],o=r[1];o?Object.defineProperty(t,n,o):delete t[n]})),this.initialNgDefs.clear(),this.moduleProvidersOverridden.clear(),this.restoreComponentResolutionQueue(),t.ɵsetLocaleId(t.ɵDEFAULT_LOCALE_ID)},e.prototype.compileTestModule=function(){var e,r=this;t.ɵcompileNgModuleDefs(e=function e(){},{providers:w(this.rootProviderOverrides)});var n=new t.NgZone({enableLongStackTrace:!0}),o=w([{provide:t.NgZone,useValue:n},{provide:t.Compiler,useFactory:function(){return new Y(r)}}],this.providers,this.providerOverrides);t.ɵcompileNgModuleDefs(this.testModuleType,{declarations:this.declarations,imports:[e,this.additionalModuleTypes,this.imports||[]],schemas:this.schemas,providers:o},!0),this.applyProviderOverridesToModule(this.testModuleType)},Object.defineProperty(e.prototype,"injector",{get:function(){if(null!==this._injector)return this._injector;var e,r=[];this.platform.injector.get(t.COMPILER_OPTIONS).forEach((function(e){e.providers&&r.push(e.providers)})),null!==this.compilerProviders&&r.push.apply(r,w(this.compilerProviders)),t.ɵcompileNgModuleDefs(e=function e(){},{providers:r});var n=new t.ɵNgModuleFactory(e);return this._injector=n.create(this.platform.injector).injector,this._injector},enumerable:!1,configurable:!0}),e.prototype.getSingleProviderOverrides=function(e){var t=z(e);return this.providerOverridesByToken.get(t)||null},e.prototype.getProviderOverrides=function(e){var t=this;return e&&e.length&&0!==this.providerOverridesByToken.size?W(W(e,(function(e){return t.getSingleProviderOverrides(e)||[]}))):[]},e.prototype.getOverriddenProviders=function(e){var t=this;if(!e||!e.length||0===this.providerOverridesByToken.size)return[];var r=W(e),n=w(r,this.getProviderOverrides(r)),o=[],i=new Set;return Q(n,(function(e){var r=z(e);t.providerOverridesByToken.has(r)?i.has(r)||(i.add(r),o.unshift(_(_({},e),{multi:!1}))):o.unshift(e)})),o},e.prototype.hasProviderOverrides=function(e){return this.getProviderOverrides(e).length>0},e.prototype.patchDefWithProviderOverrides=function(e,t){var r=this,n=e[t];if(n&&n.providersResolver){this.maybeStoreNgDef(t,e);var o=n.providersResolver,i=function(e){return r.getOverriddenProviders(e)};this.storeFieldOfDefOnType(e,t,"providersResolver"),n.providersResolver=function(e){return o(e,i)}}},e}();function V(e){return e.hasOwnProperty("ɵmod")}function q(e){return e instanceof Function?e():e}function W(e,t){var r=[];return e.forEach((function(e){Array.isArray(e)?r.push.apply(r,w(W(e,t))):r.push(t?t(e):e)})),r}function z(e){return function t(e,r){return e&&"object"==typeof e&&e[r]}(e,"provide")||e}function Q(e,t){for(var r=e.length-1;r>=0;r--)t(e[r],r)}function J(e,t){return new Error(e+" class doesn't have @"+t+" decorator or is missing metadata.")}var H,Y=function(){function e(e){this.testBed=e}return e.prototype.compileModuleSync=function(e){return this.testBed._compileNgModuleSync(e),new t.ɵNgModuleFactory(e)},e.prototype.compileModuleAsync=function(e){return M(this,void 0,void 0,(function(){return O(this,(function(r){switch(r.label){case 0:return[4,this.testBed._compileNgModuleAsync(e)];case 1:return r.sent(),[2,new t.ɵNgModuleFactory(e)]}}))}))},e.prototype.compileModuleAndAllComponentsSync=function(e){var r=this.compileModuleSync(e),n=this.testBed._getComponentFactories(e);return new t.ModuleWithComponentFactories(r,n)},e.prototype.compileModuleAndAllComponentsAsync=function(e){return M(this,void 0,void 0,(function(){var r,n;return O(this,(function(o){switch(o.label){case 0:return[4,this.compileModuleAsync(e)];case 1:return r=o.sent(),n=this.testBed._getComponentFactories(e),[2,new t.ModuleWithComponentFactories(r,n)]}}))}))},e.prototype.clearCache=function(){},e.prototype.clearCacheFor=function(e){},e.prototype.getModuleId=function(e){var t=this.testBed._getModuleResolver().resolve(e);return t&&t.id||void 0},e}(),K=function(){function e(){}return e.prototype.insertRootElement=function(e){},e}(),X=new t.InjectionToken("ComponentFixtureAutoDetect"),$=new t.InjectionToken("ComponentFixtureNoNgZone"),ee=0,te=function(){function e(){this.platform=null,this.ngModule=null,this._compiler=null,this._testModuleRef=null,this._activeFixtures=[],this._globalCompilationChecked=!1}return e.initTestEnvironment=function(e,t,r){var n=re();return n.initTestEnvironment(e,t,r),n},e.resetTestEnvironment=function(){re().resetTestEnvironment()},e.configureCompiler=function(t){return re().configureCompiler(t),e},e.configureTestingModule=function(t){return re().configureTestingModule(t),e},e.compileComponents=function(){return re().compileComponents()},e.overrideModule=function(t,r){return re().overrideModule(t,r),e},e.overrideComponent=function(t,r){return re().overrideComponent(t,r),e},e.overrideDirective=function(t,r){return re().overrideDirective(t,r),e},e.overridePipe=function(t,r){return re().overridePipe(t,r),e},e.overrideTemplate=function(t,r){return re().overrideComponent(t,{set:{template:r,templateUrl:null}}),e},e.overrideTemplateUsingTestingModule=function(t,r){return re().overrideTemplateUsingTestingModule(t,r),e},e.overrideProvider=function(t,r){return re().overrideProvider(t,r),e},e.inject=function(e,t,r){return re().inject(e,t,r)},e.get=function(e,r,n){return void 0===r&&(r=t.Injector.THROW_IF_NOT_FOUND),void 0===n&&(n=t.InjectFlags.Default),re().inject(e,r,n)},e.createComponent=function(e){return re().createComponent(e)},e.resetTestingModule=function(){return re().resetTestingModule(),e},e.prototype.initTestEnvironment=function(e,t,r){if(this.platform||this.ngModule)throw new Error("Cannot set base providers because it has already been called");this.platform=t,this.ngModule=e,this._compiler=new L(this.platform,this.ngModule)},e.prototype.resetTestEnvironment=function(){this.resetTestingModule(),this._compiler=null,this.platform=null,this.ngModule=null},e.prototype.resetTestingModule=function(){this.checkGlobalCompilationFinished(),t.ɵresetCompiledComponents(),null!==this._compiler&&this.compiler.restoreOriginalState(),this._compiler=new L(this.platform,this.ngModule),this._testModuleRef=null,this.destroyActiveFixtures()},e.prototype.configureCompiler=function(e){if(null!=e.useJit)throw new Error("the Render3 compiler JiT mode is not configurable !");void 0!==e.providers&&this.compiler.setCompilerProviders(e.providers)},e.prototype.configureTestingModule=function(e){this.assertNotInstantiated("R3TestBed.configureTestingModule","configure the test module"),this.compiler.configureTestingModule(e)},e.prototype.compileComponents=function(){return this.compiler.compileComponents()},e.prototype.inject=function(t,r,n){if(t===e)return this;var o={},i=this.testModuleRef.injector.get(t,o,n);return i===o?this.compiler.injector.get(t,r,n):i},e.prototype.get=function(e,r,n){return void 0===r&&(r=t.Injector.THROW_IF_NOT_FOUND),void 0===n&&(n=t.InjectFlags.Default),this.inject(e,r,n)},e.prototype.execute=function(e,t,r){var n=this,o=e.map((function(e){return n.inject(e)}));return t.apply(r,o)},e.prototype.overrideModule=function(e,t){this.assertNotInstantiated("overrideModule","override module metadata"),this.compiler.overrideModule(e,t)},e.prototype.overrideComponent=function(e,t){this.assertNotInstantiated("overrideComponent","override component metadata"),this.compiler.overrideComponent(e,t)},e.prototype.overrideTemplateUsingTestingModule=function(e,t){this.assertNotInstantiated("R3TestBed.overrideTemplateUsingTestingModule","Cannot override template when the test module has already been instantiated"),this.compiler.overrideTemplateUsingTestingModule(e,t)},e.prototype.overrideDirective=function(e,t){this.assertNotInstantiated("overrideDirective","override directive metadata"),this.compiler.overrideDirective(e,t)},e.prototype.overridePipe=function(e,t){this.assertNotInstantiated("overridePipe","override pipe metadata"),this.compiler.overridePipe(e,t)},e.prototype.overrideProvider=function(e,t){this.compiler.overrideProvider(e,t)},e.prototype.createComponent=function(e){var r=this,n=this.inject(K),o="root"+ee++;n.insertRootElement(o);var s=e.ɵcmp;if(!s)throw new Error("It looks like '"+t.ɵstringify(e)+"' has not been IVY compiled - it has no 'ɵcmp' field");var u=this.inject($,!1),c=this.inject(X,!1),a=u?null:this.inject(t.NgZone,null),l=new t.ɵRender3ComponentFactory(s),p=function(){var e=l.create(t.Injector.NULL,[],"#"+o,r.testModuleRef);return new i(e,a,c)},d=a?a.run(p):p();return this._activeFixtures.push(d),d},Object.defineProperty(e.prototype,"compiler",{get:function(){if(null===this._compiler)throw new Error("Need to call TestBed.initTestEnvironment() first");return this._compiler},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"testModuleRef",{get:function(){return null===this._testModuleRef&&(this._testModuleRef=this.compiler.finalize()),this._testModuleRef},enumerable:!1,configurable:!0}),e.prototype.assertNotInstantiated=function(e,t){if(null!==this._testModuleRef)throw new Error("Cannot "+t+" when the test module has already been instantiated. Make sure you are not using `inject` before `"+e+"`.")},e.prototype.checkGlobalCompilationFinished=function(){this._globalCompilationChecked||null!==this._testModuleRef||t.ɵflushModuleScopingQueueAsMuchAsPossible(),this._globalCompilationChecked=!0},e.prototype.destroyActiveFixtures=function(){this._activeFixtures.forEach((function(e){try{e.destroy()}catch(t){console.error("Error during cleanup of component",{component:e.componentInstance,stacktrace:t})}})),this._activeFixtures=[]},e}(); /** * @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 */function re(){return H=H||new te} /** * @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 */function ne(){throw Error("unimplemented")}var oe,ie=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return g(r,e),Object.defineProperty(r.prototype,"injector",{get:function(){throw ne()},enumerable:!1,configurable:!0}),r.prototype.overrideModule=function(e,t){throw ne()},r.prototype.overrideDirective=function(e,t){throw ne()},r.prototype.overrideComponent=function(e,t){throw ne()},r.prototype.overridePipe=function(e,t){throw ne()},r.prototype.loadAotSummaries=function(e){throw ne()},r.prototype.getComponentFactory=function(e){throw ne()},r.prototype.getComponentFromError=function(e){throw ne()},r.decorators=[{type:t.Injectable}],r}(t.Compiler),se=function se(){},ue=0,ce=function(){function e(){this._instantiated=!1,this._compiler=null,this._moduleRef=null,this._moduleFactory=null,this._compilerOptions=[],this._moduleOverrides=[],this._componentOverrides=[],this._directiveOverrides=[],this._pipeOverrides=[],this._providers=[],this._declarations=[],this._imports=[],this._schemas=[],this._activeFixtures=[],this._testEnvAotSummaries=function(){return[]},this._aotSummaries=[],this._templateOverrides=[],this._isRoot=!0,this._rootProviderOverrides=[],this.platform=null,this.ngModule=null}return e.initTestEnvironment=function(e,t,r){var n=pe();return n.initTestEnvironment(e,t,r),n},e.resetTestEnvironment=function(){pe().resetTestEnvironment()},e.resetTestingModule=function(){return pe().resetTestingModule(),e},e.configureCompiler=function(t){return pe().configureCompiler(t),e},e.configureTestingModule=function(t){return pe().configureTestingModule(t),e},e.compileComponents=function(){return le().compileComponents()},e.overrideModule=function(t,r){return pe().overrideModule(t,r),e},e.overrideComponent=function(t,r){return pe().overrideComponent(t,r),e},e.overrideDirective=function(t,r){return pe().overrideDirective(t,r),e},e.overridePipe=function(t,r){return pe().overridePipe(t,r),e},e.overrideTemplate=function(t,r){return pe().overrideComponent(t,{set:{template:r,templateUrl:null}}),e},e.overrideTemplateUsingTestingModule=function(t,r){return pe().overrideTemplateUsingTestingModule(t,r),e},e.overrideProvider=function(t,r){return pe().overrideProvider(t,r),e},e.inject=function(e,t,r){return pe().inject(e,t,r)},e.get=function(e,r,n){return void 0===r&&(r=t.Injector.THROW_IF_NOT_FOUND),void 0===n&&(n=t.InjectFlags.Default),pe().inject(e,r,n)},e.createComponent=function(e){return pe().createComponent(e)},e.prototype.initTestEnvironment=function(e,t,r){if(this.platform||this.ngModule)throw new Error("Cannot set base providers because it has already been called");this.platform=t,this.ngModule=e,r&&(this._testEnvAotSummaries=r)},e.prototype.resetTestEnvironment=function(){this.resetTestingModule(),this.platform=null,this.ngModule=null,this._testEnvAotSummaries=function(){return[]}},e.prototype.resetTestingModule=function(){t.ɵclearOverrides(),this._aotSummaries=[],this._templateOverrides=[],this._compiler=null,this._moduleOverrides=[],this._componentOverrides=[],this._directiveOverrides=[],this._pipeOverrides=[],this._isRoot=!0,this._rootProviderOverrides=[],this._moduleRef=null,this._moduleFactory=null,this._compilerOptions=[],this._providers=[],this._declarations=[],this._imports=[],this._schemas=[],this._instantiated=!1,this._activeFixtures.forEach((function(e){try{e.destroy()}catch(t){console.error("Error during cleanup of component",{component:e.componentInstance,stacktrace:t})}})),this._activeFixtures=[]},e.prototype.configureCompiler=function(e){this._assertNotInstantiated("TestBed.configureCompiler","configure the compiler"),this._compilerOptions.push(e)},e.prototype.configureTestingModule=function(e){var t,r,n,o;this._assertNotInstantiated("TestBed.configureTestingModule","configure the test module"),e.providers&&(t=this._providers).push.apply(t,w(e.providers)),e.declarations&&(r=this._declarations).push.apply(r,w(e.declarations)),e.imports&&(n=this._imports).push.apply(n,w(e.imports)),e.schemas&&(o=this._schemas).push.apply(o,w(e.schemas)),e.aotSummaries&&this._aotSummaries.push(e.aotSummaries)},e.prototype.compileComponents=function(){var e=this;if(this._moduleFactory||this._instantiated)return Promise.resolve(null);var t=this._createCompilerAndModule();return this._compiler.compileModuleAndAllComponentsAsync(t).then((function(t){e._moduleFactory=t.ngModuleFactory}))},e.prototype._initIfNeeded=function(){var e,r;if(!this._instantiated){if(!this._moduleFactory)try{var n=this._createCompilerAndModule();this._moduleFactory=this._compiler.compileModuleAndAllComponentsSync(n).ngModuleFactory}catch(e){var o=this._compiler.getComponentFromError(e);throw o?new Error("This test module uses the component "+t.ɵstringify(o)+' which is using a "templateUrl" or "styleUrls", but they were never compiled. Please call "TestBed.compileComponents" before your test.'):e}try{for(var i=b(this._templateOverrides),s=i.next();!s.done;s=i.next()){var u=s.value,c=u.component,a=this._compiler.getComponentFactory(u.templateOf);t.ɵoverrideComponentView(c,a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}var l=new t.NgZone({enableLongStackTrace:!0,shouldCoalesceEventChangeDetection:!1}),p=t.Injector.create({providers:[{provide:t.NgZone,useValue:l}],parent:this.platform.injector,name:this._moduleFactory.moduleType.name});this._moduleRef=this._moduleFactory.create(p),this._moduleRef.injector.get(t.ApplicationInitStatus).runInitializers(),this._instantiated=!0}},e.prototype._createCompilerAndModule=function(){var e,r,n=this,o=this._providers.concat([{provide:ae,useValue:this}]),i=w(this._declarations,this._templateOverrides.map((function(e){return e.templateOf}))),s=[],u=this._rootProviderOverrides;if(this._isRoot){var c=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{providers:w(u),jit:!0}]}],e}();s.push(c)}o.push({provide:t.ɵINJECTOR_SCOPE,useValue:this._isRoot?"root":null});var a=[s,this.ngModule,this._imports],l=this._schemas,p=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{providers:o,declarations:i,imports:a,schemas:l,jit:!0}]}],e}(),d=this.platform.injector.get(se);this._compiler=d.createTestingCompiler(this._compilerOptions);try{for(var h=b(w([this._testEnvAotSummaries],this._aotSummaries)),f=h.next();!f.done;f=h.next())this._compiler.loadAotSummaries(f.value)}catch(t){e={error:t}}finally{try{f&&!f.done&&(r=h.return)&&r.call(h)}finally{if(e)throw e.error}}return this._moduleOverrides.forEach((function(e){return n._compiler.overrideModule(e[0],e[1])})),this._componentOverrides.forEach((function(e){return n._compiler.overrideComponent(e[0],e[1])})),this._directiveOverrides.forEach((function(e){return n._compiler.overrideDirective(e[0],e[1])})),this._pipeOverrides.forEach((function(e){return n._compiler.overridePipe(e[0],e[1])})),p},e.prototype._assertNotInstantiated=function(e,t){if(this._instantiated)throw new Error("Cannot "+t+" when the test module has already been instantiated. Make sure you are not using `inject` before `"+e+"`.")},e.prototype.inject=function(e,t,r){if(this._initIfNeeded(),e===ae)return this;var n={},o=this._moduleRef.injector.get(e,n,r);return o===n?this._compiler.injector.get(e,t,r):o},e.prototype.get=function(e,r,n){return void 0===r&&(r=t.Injector.THROW_IF_NOT_FOUND),void 0===n&&(n=t.InjectFlags.Default),this.inject(e,r,n)},e.prototype.execute=function(e,t,r){var n=this;this._initIfNeeded();var o=e.map((function(e){return n.inject(e)}));return t.apply(r,o)},e.prototype.overrideModule=function(e,t){this._assertNotInstantiated("overrideModule","override module metadata"),this._moduleOverrides.push([e,t])},e.prototype.overrideComponent=function(e,t){this._assertNotInstantiated("overrideComponent","override component metadata"),this._componentOverrides.push([e,t])},e.prototype.overrideDirective=function(e,t){this._assertNotInstantiated("overrideDirective","override directive metadata"),this._directiveOverrides.push([e,t])},e.prototype.overridePipe=function(e,t){this._assertNotInstantiated("overridePipe","override pipe metadata"),this._pipeOverrides.push([e,t])},e.prototype.overrideProvider=function(e,t){this.overrideProviderImpl(e,t)},e.prototype.overrideProviderImpl=function(e,r,n){void 0===n&&(n=!1);var o=null;"string"!=typeof e&&(o=t.ɵgetInjectableDef(e))&&"root"===o.providedIn&&this._rootProviderOverrides.push(r.useFactory?{provide:e,useFactory:r.useFactory,deps:r.deps||[]}:{provide:e,useValue:r.useValue});var i,s=0;r.useFactory?(s|=1024,i=r.useFactory):(s|=256,i=r.useValue);var u=(r.deps||[]).map((function(e){var r,n=0;return Array.isArray(e)?e.forEach((function(e){e instanceof t.Optional?n|=2:e instanceof t.SkipSelf?n|=1:r=e})):r=e,[n,r]}));t.ɵoverrideProvider({token:e,flags:s,deps:u,value:i,deprecatedBehavior:n})},e.prototype.overrideTemplateUsingTestingModule=function(e,r){this._assertNotInstantiated("overrideTemplateUsingTestingModule","override template");var n=function(){function e(){}return e.decorators=[{type:t.Component,args:[{selector:"empty",template:r,jit:!0}]}],e}();this._templateOverrides.push({component:e,templateOf:n})},e.prototype.createComponent=function(e){var r=this;this._initIfNeeded();var n=this._compiler.getComponentFactory(e);if(!n)throw new Error("Cannot create the component "+t.ɵstringify(e)+" as it was not imported into the testing module!");var o=this.inject($,!1),s=this.inject(X,!1),u=o?null:this.inject(t.NgZone,null),c=this.inject(K),a="root"+ue++;c.insertRootElement(a);var l=function(){var e=n.create(t.Injector.NULL,[],"#"+a,r._moduleRef);return new i(e,u,s)},p=u?u.run(l):l();return this._activeFixtures.push(p),p},e}(),ae=t.ɵivyEnabled?te:ce,le=t.ɵivyEnabled?re:pe;function pe(){return oe=oe||new ce}function de(e,t){var r=le();return e.indexOf(C)>=0?function(){var n=this;return r.compileComponents().then((function(){var o=r.inject(C);return r.execute(e,t,n),o.promise}))}:function(){return r.execute(e,t,this)}}var he=function(){function e(e){this._moduleDef=e}return e.prototype._addModule=function(){var e=this._moduleDef();e&&le().configureTestingModule(e)},e.prototype.inject=function(e,t){var r=this;return function(){return r._addModule(),de(e,t).call(this)}},e}(),fe="undefined"==typeof window?global:window;fe.beforeEach&&fe.beforeEach((function(){ae.resetTestingModule(),m()})), /** * @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 */ /** * @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 */ /** * @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 */ /** * @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 */ /** * @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 */ e.ComponentFixture=i,e.ComponentFixtureAutoDetect=X,e.ComponentFixtureNoNgZone=$,e.InjectSetupWrapper=he,e.TestBed=ae,e.TestComponentRenderer=K,e.__core_private_testing_placeholder__="",e.async=function ve(e){var t="undefined"!=typeof Zone?Zone:null;if(!t)return function(){return Promise.reject("Zone is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/dist/zone.js")};var r=t&&t[t.__symbol__("asyncTest")];return"function"==typeof r?r(e):function i(e){return n.jasmine?function(t){t||((t=function(){}).fail=function(e){throw e}),o(e,this,t,(function(e){if("string"==typeof e)return t.fail(new Error(e));t.fail(e)}))}:function(){var t=this;return new Promise((function(r,n){o(e,t,r,n)}))}}(e)},e.discardPeriodicTasks=function me(){if(v)return v.discardPeriodicTasks();!function e(){d().pendingPeriodicTimers.length=0}()},e.fakeAsync=function ye(e){return v?v.fakeAsync(e):function t(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=c.assertPresent();if(p)throw new Error("fakeAsync() calls can not be nested");p=!0;try{if(!a){if(n.getDelegate()instanceof u)throw new Error("fakeAsync() calls can not be nested");a=new u}var o=void 0,i=n.getDelegate();n.setDelegate(a),a.lockDatePatch();try{o=e.apply(this,t),h()}finally{n.setDelegate(i)}if(a.pendingPeriodicTimers.length>0)throw new Error(a.pendingPeriodicTimers.length+" periodic timer(s) still in the queue.");if(a.pendingTimers.length>0)throw new Error(a.pendingTimers.length+" timer(s) still in the queue.");return o}finally{p=!1,l()}}}(e)},e.flush=function ge(e){return v?v.flush(e):function t(e){return d().flush(e)}(e)},e.flushMicrotasks=function _e(){return v?v.flushMicrotasks():h()},e.getTestBed=le,e.inject=de,e.resetFakeAsyncZone=m,e.tick=function Me(e,t){return void 0===e&&(e=0),void 0===t&&(t={processNewMacroTasksSynchronously:!0}),v?v.tick(e,t):function r(e,t){void 0===e&&(e=0),void 0===t&&(t={processNewMacroTasksSynchronously:!0}),d().tick(e,null,t)}(e,t)},e.withModule=function Oe(e,t){return t?function(){var r=le();return e&&r.configureTestingModule(e),t.apply(this)}:new he((function(){return e}))} /** * @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 */,e.ɵMetadataOverrider=R,e.ɵTestingCompiler=ie,e.ɵTestingCompilerFactory=se,e.ɵangular_packages_core_testing_testing_a=ce,e.ɵangular_packages_core_testing_testing_b=te,e.ɵangular_packages_core_testing_testing_c=re,Object.defineProperty(e,"__esModule",{value:!0})}));