@ngxs/store 3.7.4-dev.master-a69f8cc → 3.7.4-dev.master-310a613

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -262,18 +262,33 @@
262
262
  }
263
263
  /** @type {?} */
264
264
  var constructor = target.constructor;
265
- // Means we're in AOT mode.
266
- if (typeof constructor[NG_FACTORY_DEF] === 'function') {
267
- decorateFactory(constructor);
265
+ // The factory is set later by the Angular compiler in JIT mode, and we're not able to patch the factory now.
266
+ // We can't use any asynchronous code like `Promise.resolve().then(...)` since this is not functional in unit
267
+ // tests that are being run in `SyncTestZoneSpec`.
268
+ // Given the following example:
269
+ // @Component()
270
+ // class BaseComponent {}
271
+ // @Component()
272
+ // class MainComponent extends BaseComponent {
273
+ // @Select(AnimalsState) animals$: Observable<string[]>;
274
+ // }
275
+ // In this example, the factory will be defined for the `BaseComponent`, but will not be defined for the `MainComponent`.
276
+ // If we try to decorate the factory immediately, we'll get `Cannot redefine property` exception when Angular will try to define
277
+ // an original factory for the `MainComponent`.
278
+ // Note: the factory is defined statically in the code in AOT mode.
279
+ // AppComponent.ɵfac = function AppComponent_Factory(t) {
280
+ // return new (t || AppComponent)();
281
+ // };
282
+ // __decorate([Select], AppComponent.prototype, 'animals$', void 0);
283
+ /** @type {?} */
284
+ var isJitModeOrIsAngularInTestMode = isAngularInTestMode() || !!(core.ɵglobal.ng && core.ɵglobal.ng.ɵcompilerFacade);
285
+ // If we're in development mode AND we're running unit tests or there's a compiler facade exposed,
286
+ // then patch `Object.defineProperty`. The compiler facade is exposed in JIT mode.
287
+ if (ngDevMode && isJitModeOrIsAngularInTestMode) {
288
+ patchObjectDefineProperty();
268
289
  }
269
- else if (ngDevMode) {
270
- // We're running in JIT mode and that means we're not able to get the compiled definition
271
- // on the class inside the property decorator during the current message loop tick. We have
272
- // to wait for the next message loop tick. Note that this is safe since this Promise will be
273
- // resolved even before the `APP_INITIALIZER` is resolved.
274
- // The below code also will be executed only in development mode, since it's never recommended
275
- // to use the JIT compiler in production mode (by setting "aot: false").
276
- decorateFactoryLater(constructor);
290
+ else {
291
+ decorateFactory(constructor);
277
292
  }
278
293
  target.constructor.prototype[FactoryHasBeenDecorated] = true;
279
294
  }
@@ -343,36 +358,57 @@
343
358
  function () { return decoratedFactory; })
344
359
  });
345
360
  }
346
- /**
347
- * @param {?} constructor
361
+ // Note: this function will be tree-shaken in production.
362
+ var ɵ0 = /**
348
363
  * @return {?}
349
364
  */
350
- function decorateFactoryLater(constructor) {
351
- // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.
352
- // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws
353
- // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call
354
- // Promise.then from within a sync test`.
355
- try {
356
- Promise.resolve().then((/**
365
+ function () {
366
+ /** @type {?} */
367
+ var objectDefinePropertyPatched = false;
368
+ return (/**
369
+ * @return {?}
370
+ */
371
+ function () {
372
+ if (objectDefinePropertyPatched) {
373
+ return;
374
+ }
375
+ /** @type {?} */
376
+ var defineProperty = Object.defineProperty;
377
+ // We should not be patching globals, but there's no other way to know when it's appropriate
378
+ // to decorate the original factory. There're different edge cases, e.g., when the class extends
379
+ // another class, the factory will be defined for the base class but not for the child class.
380
+ // The patching will be done only during the development and in JIT mode.
381
+ Object.defineProperty = (/**
382
+ * @template T
383
+ * @param {?} object
384
+ * @param {?} propertyKey
385
+ * @param {?} attributes
357
386
  * @return {?}
358
387
  */
359
- function () {
360
- decorateFactory(constructor);
361
- }));
362
- }
363
- catch (_a) {
364
- // This is kind of a "hack", but we try to be backwards-compatible,
365
- // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.
366
- core.ɵglobal.process &&
367
- core.ɵglobal.process.nextTick &&
368
- core.ɵglobal.process.nextTick((/**
369
- * @return {?}
370
- */
371
- function () {
372
- decorateFactory(constructor);
373
- }));
374
- }
375
- }
388
+ function (object, propertyKey, attributes) {
389
+ // Angular calls `Object.defineProperty(target, 'ɵfac', { get: ..., configurable: true })` when defining a factory function.
390
+ // We only want to intercept `ɵfac` key.
391
+ // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original
392
+ // implementation and then decorate the factory.
393
+ // // https://github.com/angular/angular/blob/3a60063a54d850c50ce962a8a39ce01cfee71398/packages/core/src/render3/jit/pipe.ts#L21-L39
394
+ if (propertyKey !== NG_FACTORY_DEF ||
395
+ // We also call `Object.defineProperty(target, 'ɵfac', ...)`, but we don't set `configurable` property.
396
+ (propertyKey === NG_FACTORY_DEF && !attributes.configurable)) {
397
+ return (/** @type {?} */ (defineProperty.call(this, object, propertyKey, attributes)));
398
+ }
399
+ else {
400
+ // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original
401
+ // implementation and then decorate the factory.
402
+ defineProperty.call(this, object, propertyKey, attributes);
403
+ decorateFactory((/** @type {?} */ (((/** @type {?} */ (object))))));
404
+ return object;
405
+ }
406
+ });
407
+ objectDefinePropertyPatched = true;
408
+ });
409
+ };
410
+ /** @type {?} */
411
+ var patchObjectDefineProperty = ((ɵ0))();
376
412
  /**
377
413
  * @record
378
414
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ngxs-store-internals.umd.js","sources":["ng://@ngxs/store/internals/angular.ts","ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts","ng://@ngxs/store/internals/decorator-injector-adapter.ts"],"sourcesContent":["declare const __karma__: unknown;\ndeclare const jasmine: unknown;\ndeclare const jest: unknown;\ndeclare const Mocha: unknown;\n\nexport function isAngularInTestMode(): boolean {\n // This is safe to check for these properties in the following way since `typeof` does not\n // throw an exception if the value does not exist in the scope.\n // We should not try to read these values from the global scope (e.g. `ɵglobal` from the `@angular/core`).\n // This is related to how these frameworks compile and execute modules. E.g. Jest wraps the module into\n // its internal code where `jest` variable exists in the scope. It cannot be read from the global scope, e.g.\n // this will return undefined `global.jest`, but `jest` will not equal undefined.\n return (\n typeof __karma__ !== 'undefined' ||\n typeof jasmine !== 'undefined' ||\n typeof jest !== 'undefined' ||\n typeof Mocha !== 'undefined'\n );\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable()\nexport class NgxsBootstrapper {\n /**\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\n */\n private bootstrap$ = new ReplaySubject<boolean>(1);\n\n get appBootstrapped$(): Observable<boolean> {\n return this.bootstrap$.asObservable();\n }\n\n /**\n * This event will be emitted after attaching `ComponentRef` of the root component\n * to the tree of views, that's a signal that application has been fully rendered\n */\n bootstrap(): void {\n this.bootstrap$.next(true);\n this.bootstrap$.complete();\n }\n}\n","function defaultEqualityCheck(a: any, b: any) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(\n equalityCheck: (a: any, b: any) => boolean,\n prev: IArguments | null,\n next: IArguments | null\n) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n const length = prev.length;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Memoize a function on its last inputs only.\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\n *\n * @ignore\n */\nexport function memoize<T extends (...args: any[]) => any>(\n func: T,\n equalityCheck = defaultEqualityCheck\n): T {\n let lastArgs: IArguments | null = null;\n let lastResult: any = null;\n // we reference arguments instead of spreading them for performance reasons\n function memoized() {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = (<Function>func).apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n }\n (<any>memoized).reset = function() {\n // The hidden (for now) ability to reset the memoization\n lastArgs = null;\n lastResult = null;\n };\n return memoized as T;\n}\n","import { InjectionToken } from '@angular/core';\nimport { PlainObject } from './symbols';\n\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\n\nexport class InitialState {\n private static value: PlainObject = {};\n\n public static set(state: PlainObject) {\n this.value = state;\n }\n\n public static pop(): PlainObject {\n const state: PlainObject = this.value;\n this.value = {};\n return state;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateContextFactory'\n);\n\n/**\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateFactory'\n);\n","import {\n InjectionToken,\n Injector,\n INJECTOR,\n Type,\n ɵɵdirectiveInject,\n ɵglobal\n} from '@angular/core';\nimport { ReplaySubject } from 'rxjs';\n\n// Will be provided through Terser global definitions by Angular CLI\n// during the production build. This is how Angular does tree-shaking internally.\ndeclare const ngDevMode: boolean;\n\n// Angular doesn't export `NG_FACTORY_DEF`.\nconst NG_FACTORY_DEF = 'ɵfac';\n\n// A `Symbol` which is used to save the `Injector` onto the class instance.\nconst InjectorInstance: unique symbol = Symbol('InjectorInstance');\n\n// A `Symbol` which is used to determine if factory has been decorated previously or not.\nconst FactoryHasBeenDecorated: unique symbol = Symbol('FactoryHasBeenDecorated');\n\n// A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot\n// be retrieved within the `constructor` since it's set after the `factory()` is called.\nconst InjectorNotifier: unique symbol = Symbol('InjectorNotifier');\n\ninterface PrototypeWithInjectorNotifier extends Object {\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n\nexport function ensureInjectorNotifierIsCaptured(\n target: PrototypeWithInjectorNotifier | PrivateInstance\n): ReplaySubject<boolean> {\n if (target[InjectorNotifier]) {\n return target[InjectorNotifier]!;\n } else {\n const injectorNotifier$ = new ReplaySubject<boolean>(1);\n Object.defineProperty(target, InjectorNotifier, {\n get: () => injectorNotifier$\n });\n return injectorNotifier$;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function ensureLocalInjectorCaptured(target: Object): void {\n if (FactoryHasBeenDecorated in target.constructor.prototype) {\n return;\n }\n\n const constructor: ConstructorWithDefinitionAndFactory = target.constructor;\n // Means we're in AOT mode.\n if (typeof constructor[NG_FACTORY_DEF] === 'function') {\n decorateFactory(constructor);\n } else if (ngDevMode) {\n // We're running in JIT mode and that means we're not able to get the compiled definition\n // on the class inside the property decorator during the current message loop tick. We have\n // to wait for the next message loop tick. Note that this is safe since this Promise will be\n // resolved even before the `APP_INITIALIZER` is resolved.\n // The below code also will be executed only in development mode, since it's never recommended\n // to use the JIT compiler in production mode (by setting \"aot: false\").\n decorateFactoryLater(constructor);\n }\n\n target.constructor.prototype[FactoryHasBeenDecorated] = true;\n}\n\nexport function localInject<T>(\n instance: PrivateInstance,\n token: InjectionToken<T> | Type<T>\n): T | null {\n const injector: Injector | undefined = instance[InjectorInstance];\n return injector ? injector.get(token) : null;\n}\n\nfunction decorateFactory(constructor: ConstructorWithDefinitionAndFactory): void {\n const factory = constructor[NG_FACTORY_DEF];\n\n if (typeof factory !== 'function') {\n return;\n }\n\n // Let's try to get any definition.\n // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first\n // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).\n const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;\n\n const decoratedFactory = () => {\n const instance = factory();\n // Caretaker note: `inject()` won't work here.\n // We can use the `directiveInject` only during the component\n // construction, since Angular captures the currently active injector.\n // We're not able to use this function inside the getter (when the `selectorId` property is\n // requested for the first time), since the currently active injector will be null.\n instance[InjectorInstance] = ɵɵdirectiveInject(\n // We're using `INJECTOR` token except of the `Injector` class since the compiler\n // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.\n // Caretaker note: that this is the same way of getting the injector.\n INJECTOR\n );\n\n // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.\n const injectorNotifier$ = instance[InjectorNotifier];\n if (injectorNotifier$) {\n injectorNotifier$.next(true);\n injectorNotifier$.complete();\n }\n\n return instance;\n };\n\n // If we've found any definition then it's enough to override the `def.factory` since Angular\n // code uses the `def.factory` and then fallbacks to `ɵfac`.\n if (def) {\n def.factory = decoratedFactory;\n }\n\n // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular\n // still uses the `ɵfac`.\n Object.defineProperty(constructor, NG_FACTORY_DEF, {\n get: () => decoratedFactory\n });\n}\n\nfunction decorateFactoryLater(constructor: ConstructorWithDefinitionAndFactory): void {\n // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.\n // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws\n // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call\n // Promise.then from within a sync test`.\n try {\n Promise.resolve().then(() => {\n decorateFactory(constructor);\n });\n } catch {\n // This is kind of a \"hack\", but we try to be backwards-compatible,\n // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.\n ɵglobal.process &&\n ɵglobal.process.nextTick &&\n ɵglobal.process.nextTick(() => {\n decorateFactory(constructor);\n });\n }\n}\n\n// We could've used `ɵɵFactoryDef` but we try to be backwards-compatible,\n// since it's not exported in older Angular versions.\ntype Factory = () => PrivateInstance;\n\n// We could've used `ɵɵInjectableDef`, `ɵɵPipeDef`, etc. We try to be backwards-compatible\n// since they're not exported in older Angular versions.\ninterface Definition {\n factory: Factory | null;\n}\n\ninterface ConstructorWithDefinitionAndFactory extends Function {\n // Provider definition for the `@Injectable()` class.\n ɵprov?: Definition;\n // Pipe definition for the `@Pipe()` class.\n ɵpipe?: Definition;\n // Component definition for the `@Component()` class.\n ɵcmp?: Definition;\n // Directive definition for the `@Directive()` class.\n ɵdir?: Definition;\n [NG_FACTORY_DEF]?: Factory;\n}\n\ninterface PrivateInstance {\n [InjectorInstance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;;;;;;;;;"}
1
+ {"version":3,"file":"ngxs-store-internals.umd.js","sources":["ng://@ngxs/store/internals/angular.ts","ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts","ng://@ngxs/store/internals/decorator-injector-adapter.ts"],"sourcesContent":["declare const __karma__: unknown;\ndeclare const jasmine: unknown;\ndeclare const jest: unknown;\ndeclare const Mocha: unknown;\n\nexport function isAngularInTestMode(): boolean {\n // This is safe to check for these properties in the following way since `typeof` does not\n // throw an exception if the value does not exist in the scope.\n // We should not try to read these values from the global scope (e.g. `ɵglobal` from the `@angular/core`).\n // This is related to how these frameworks compile and execute modules. E.g. Jest wraps the module into\n // its internal code where `jest` variable exists in the scope. It cannot be read from the global scope, e.g.\n // this will return undefined `global.jest`, but `jest` will not equal undefined.\n return (\n typeof __karma__ !== 'undefined' ||\n typeof jasmine !== 'undefined' ||\n typeof jest !== 'undefined' ||\n typeof Mocha !== 'undefined'\n );\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable()\nexport class NgxsBootstrapper {\n /**\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\n */\n private bootstrap$ = new ReplaySubject<boolean>(1);\n\n get appBootstrapped$(): Observable<boolean> {\n return this.bootstrap$.asObservable();\n }\n\n /**\n * This event will be emitted after attaching `ComponentRef` of the root component\n * to the tree of views, that's a signal that application has been fully rendered\n */\n bootstrap(): void {\n this.bootstrap$.next(true);\n this.bootstrap$.complete();\n }\n}\n","function defaultEqualityCheck(a: any, b: any) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(\n equalityCheck: (a: any, b: any) => boolean,\n prev: IArguments | null,\n next: IArguments | null\n) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n const length = prev.length;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Memoize a function on its last inputs only.\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\n *\n * @ignore\n */\nexport function memoize<T extends (...args: any[]) => any>(\n func: T,\n equalityCheck = defaultEqualityCheck\n): T {\n let lastArgs: IArguments | null = null;\n let lastResult: any = null;\n // we reference arguments instead of spreading them for performance reasons\n function memoized() {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = (<Function>func).apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n }\n (<any>memoized).reset = function() {\n // The hidden (for now) ability to reset the memoization\n lastArgs = null;\n lastResult = null;\n };\n return memoized as T;\n}\n","import { InjectionToken } from '@angular/core';\nimport { PlainObject } from './symbols';\n\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\n\nexport class InitialState {\n private static value: PlainObject = {};\n\n public static set(state: PlainObject) {\n this.value = state;\n }\n\n public static pop(): PlainObject {\n const state: PlainObject = this.value;\n this.value = {};\n return state;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateContextFactory'\n);\n\n/**\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateFactory'\n);\n","import {\n InjectionToken,\n Injector,\n INJECTOR,\n Type,\n ɵglobal,\n ɵɵdirectiveInject\n} from '@angular/core';\nimport { ReplaySubject } from 'rxjs';\n\nimport { isAngularInTestMode } from './angular';\n\n// Will be provided through Terser global definitions by Angular CLI\n// during the production build. This is how Angular does tree-shaking internally.\ndeclare const ngDevMode: boolean;\n\n// Angular doesn't export `NG_FACTORY_DEF`.\nconst NG_FACTORY_DEF = 'ɵfac';\n\n// A `Symbol` which is used to save the `Injector` onto the class instance.\nconst InjectorInstance: unique symbol = Symbol('InjectorInstance');\n\n// A `Symbol` which is used to determine if factory has been decorated previously or not.\nconst FactoryHasBeenDecorated: unique symbol = Symbol('FactoryHasBeenDecorated');\n\n// A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot\n// be retrieved within the `constructor` since it's set after the `factory()` is called.\nconst InjectorNotifier: unique symbol = Symbol('InjectorNotifier');\n\ninterface PrototypeWithInjectorNotifier extends Object {\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n\nexport function ensureInjectorNotifierIsCaptured(\n target: PrototypeWithInjectorNotifier | PrivateInstance\n): ReplaySubject<boolean> {\n if (target[InjectorNotifier]) {\n return target[InjectorNotifier]!;\n } else {\n const injectorNotifier$ = new ReplaySubject<boolean>(1);\n Object.defineProperty(target, InjectorNotifier, {\n get: () => injectorNotifier$\n });\n return injectorNotifier$;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function ensureLocalInjectorCaptured(target: Object): void {\n if (FactoryHasBeenDecorated in target.constructor.prototype) {\n return;\n }\n\n const constructor: ConstructorWithDefinitionAndFactory = target.constructor;\n\n // The factory is set later by the Angular compiler in JIT mode, and we're not able to patch the factory now.\n // We can't use any asynchronous code like `Promise.resolve().then(...)` since this is not functional in unit\n // tests that are being run in `SyncTestZoneSpec`.\n // Given the following example:\n // @Component()\n // class BaseComponent {}\n // @Component()\n // class MainComponent extends BaseComponent {\n // @Select(AnimalsState) animals$: Observable<string[]>;\n // }\n // In this example, the factory will be defined for the `BaseComponent`, but will not be defined for the `MainComponent`.\n // If we try to decorate the factory immediately, we'll get `Cannot redefine property` exception when Angular will try to define\n // an original factory for the `MainComponent`.\n\n // Note: the factory is defined statically in the code in AOT mode.\n // AppComponent.ɵfac = function AppComponent_Factory(t) {\n // return new (t || AppComponent)();\n // };\n // __decorate([Select], AppComponent.prototype, 'animals$', void 0);\n\n const isJitModeOrIsAngularInTestMode =\n isAngularInTestMode() || !!(ɵglobal.ng && ɵglobal.ng.ɵcompilerFacade);\n\n // If we're in development mode AND we're running unit tests or there's a compiler facade exposed,\n // then patch `Object.defineProperty`. The compiler facade is exposed in JIT mode.\n if (ngDevMode && isJitModeOrIsAngularInTestMode) {\n patchObjectDefineProperty();\n } else {\n decorateFactory(constructor);\n }\n\n target.constructor.prototype[FactoryHasBeenDecorated] = true;\n}\n\nexport function localInject<T>(\n instance: PrivateInstance,\n token: InjectionToken<T> | Type<T>\n): T | null {\n const injector: Injector | undefined = instance[InjectorInstance];\n return injector ? injector.get(token) : null;\n}\n\nfunction decorateFactory(constructor: ConstructorWithDefinitionAndFactory): void {\n const factory = constructor[NG_FACTORY_DEF];\n\n if (typeof factory !== 'function') {\n return;\n }\n\n // Let's try to get any definition.\n // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first\n // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).\n const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;\n\n const decoratedFactory = () => {\n const instance = factory();\n // Caretaker note: `inject()` won't work here.\n // We can use the `directiveInject` only during the component\n // construction, since Angular captures the currently active injector.\n // We're not able to use this function inside the getter (when the `selectorId` property is\n // requested for the first time), since the currently active injector will be null.\n instance[InjectorInstance] = ɵɵdirectiveInject(\n // We're using `INJECTOR` token except of the `Injector` class since the compiler\n // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.\n // Caretaker note: that this is the same way of getting the injector.\n INJECTOR\n );\n\n // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.\n const injectorNotifier$ = instance[InjectorNotifier];\n if (injectorNotifier$) {\n injectorNotifier$.next(true);\n injectorNotifier$.complete();\n }\n\n return instance;\n };\n\n // If we've found any definition then it's enough to override the `def.factory` since Angular\n // code uses the `def.factory` and then fallbacks to `ɵfac`.\n if (def) {\n def.factory = decoratedFactory;\n }\n\n // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular\n // still uses the `ɵfac`.\n Object.defineProperty(constructor, NG_FACTORY_DEF, {\n get: () => decoratedFactory\n });\n}\n\n// Note: this function will be tree-shaken in production.\nconst patchObjectDefineProperty = (() => {\n let objectDefinePropertyPatched = false;\n return () => {\n if (objectDefinePropertyPatched) {\n return;\n }\n const defineProperty = Object.defineProperty;\n // We should not be patching globals, but there's no other way to know when it's appropriate\n // to decorate the original factory. There're different edge cases, e.g., when the class extends\n // another class, the factory will be defined for the base class but not for the child class.\n // The patching will be done only during the development and in JIT mode.\n Object.defineProperty = function<T>(\n object: T,\n propertyKey: PropertyKey,\n attributes: PropertyDescriptor & ThisType<any>\n ) {\n // Angular calls `Object.defineProperty(target, 'ɵfac', { get: ..., configurable: true })` when defining a factory function.\n // We only want to intercept `ɵfac` key.\n // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original\n // implementation and then decorate the factory.\n // // https://github.com/angular/angular/blob/3a60063a54d850c50ce962a8a39ce01cfee71398/packages/core/src/render3/jit/pipe.ts#L21-L39\n if (\n propertyKey !== NG_FACTORY_DEF ||\n // We also call `Object.defineProperty(target, 'ɵfac', ...)`, but we don't set `configurable` property.\n (propertyKey === NG_FACTORY_DEF && !attributes.configurable)\n ) {\n return defineProperty.call(this, object, propertyKey, attributes) as T;\n } else {\n // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original\n // implementation and then decorate the factory.\n defineProperty.call(this, object, propertyKey, attributes);\n decorateFactory((object as unknown) as ConstructorWithDefinitionAndFactory);\n return object;\n }\n };\n objectDefinePropertyPatched = true;\n };\n})();\n\n// We could've used `ɵɵFactoryDef` but we try to be backwards-compatible,\n// since it's not exported in older Angular versions.\ntype Factory = () => PrivateInstance;\n\n// We could've used `ɵɵInjectableDef`, `ɵɵPipeDef`, etc. We try to be backwards-compatible\n// since they're not exported in older Angular versions.\ninterface Definition {\n factory: Factory | null;\n}\n\ninterface ConstructorWithDefinitionAndFactory extends Function {\n // Provider definition for the `@Injectable()` class.\n ɵprov?: Definition;\n // Pipe definition for the `@Pipe()` class.\n ɵpipe?: Definition;\n // Component definition for the `@Component()` class.\n ɵcmp?: Definition;\n // Directive definition for the `@Directive()` class.\n ɵdir?: Definition;\n [NG_FACTORY_DEF]?: Factory;\n}\n\ninterface PrivateInstance {\n [InjectorInstance]?: Injector;\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n"],"names":["ReplaySubject","Injectable","InjectionToken","ɵglobal","ɵɵdirectiveInject","INJECTOR"],"mappings":";;;;;;;;;;;;;IAKA,SAAgB,mBAAmB;;;;;;;QAOjC,QACE,OAAO,SAAS,KAAK,WAAW;YAChC,OAAO,OAAO,KAAK,WAAW;YAC9B,OAAO,IAAI,KAAK,WAAW;YAC3B,OAAO,KAAK,KAAK,WAAW,EAC5B;KACH;;;;;;AClBD;QAGA;;;;YAKU,eAAU,GAAG,IAAIA,kBAAa,CAAU,CAAC,CAAC,CAAC;SAcpD;QAZC,sBAAI,8CAAgB;;;;YAApB;gBACE,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;aACvC;;;WAAA;;;;;;;;;;QAMD,oCAAS;;;;;QAAT;YACE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC3B,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;SAC5B;;oBAlBFC,eAAU;;QAmBX,uBAAC;KAnBD,IAmBC;;;;;;;QAdC,sCAAmD;;;;;;;;;;;;ICRrD,SAAS,oBAAoB,CAAC,CAAM,EAAE,CAAM;QAC1C,OAAO,CAAC,KAAK,CAAC,CAAC;KAChB;;;;;;;IAED,SAAS,0BAA0B,CACjC,aAA0C,EAC1C,IAAuB,EACvB,IAAuB;QAEvB,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE;YACjE,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AAwB,EACxB,UAA8C;;;;;;gBAO9C,IACE,WAAW,KAAK,cAAc;;qBAE7B,WAAW,KAAK,cAAc,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAC5D;oBACA,0BAAO,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,GAAM;iBACxE;qBAAM;;;oBAGL,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;oBAC3D,eAAe,wCAAE,MAAM,MAAoD,CAAC;oBAC5E,OAAO,MAAM,CAAC;iBACf;aACF,CAAA,CAAC;YACF,2BAA2B,GAAG,IAAI,CAAC;SACpC,EAAC;KACH;;QArCK,yBAAyB,GAAG,QAqC9B;;;;IAQJ,yBAEC;;;QADC,6BAAwB;;;;;IAG1B,kDAUC;;;QARC,oDAAmB;;QAEnB,oDAAmB;;QAEnB,mDAAkB;;QAElB,mDAAkB;;;;;;;IAIpB,8BAGC;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs")):"function"==typeof define&&define.amd?define("@ngxs/store/internals",["exports","@angular/core","rxjs"],t):t(((e=e||self).ngxs=e.ngxs||{},e.ngxs.store=e.ngxs.store||{},e.ngxs.store.internals={}),e.ng.core,e.rxjs)}(this,(function(e,t,n){"use strict";var r=function(){function e(){this.bootstrap$=new n.ReplaySubject(1)}return Object.defineProperty(e.prototype,"appBootstrapped$",{get:function(){return this.bootstrap$.asObservable()},enumerable:!0,configurable:!0}),e.prototype.bootstrap=function(){this.bootstrap$.next(!0),this.bootstrap$.complete()},e.decorators=[{type:t.Injectable}],e}();function o(e,t){return e===t}var u=new t.InjectionToken("INITIAL_STATE_TOKEN"),i=function(){function e(){}return e.set=function(e){this.value=e},e.pop=function(){var e=this.value;return this.value={},e},e.value={},e}();var c=new t.InjectionToken("Internals.StateContextFactory"),a=new t.InjectionToken("Internals.StateFactory"),s="ɵfac",f=Symbol("InjectorInstance"),l=Symbol("FactoryHasBeenDecorated"),p=Symbol("InjectorNotifier");function d(e){var n=e[s];if("function"==typeof n){var r=e.ɵprov||e.ɵpipe||e.ɵcmp||e.ɵdir,o=function(){var e=n();e[f]=t.ɵɵdirectiveInject(t.INJECTOR);var r=e[p];return r&&(r.next(!0),r.complete()),e};r&&(r.factory=o),Object.defineProperty(e,s,{get:function(){return o}})}}e.INITIAL_STATE_TOKEN=u,e.InitialState=i,e.NGXS_STATE_CONTEXT_FACTORY=c,e.NGXS_STATE_FACTORY=a,e.NgxsBootstrapper=r,e.ensureInjectorNotifierIsCaptured=function(e){if(e[p])return e[p];var t=new n.ReplaySubject(1);return Object.defineProperty(e,p,{get:function(){return t}}),t},e.ensureLocalInjectorCaptured=function(e){if(!(l in e.constructor.prototype)){var n=e.constructor;"function"==typeof n[s]?d(n):ngDevMode&&function(e){try{Promise.resolve().then((function(){d(e)}))}catch(n){t.ɵglobal.process&&t.ɵglobal.process.nextTick&&tglobal.process.nextTick((function(){d(e)}))}}(n),e.constructor.prototype[l]=!0}},e.isAngularInTestMode=function(){return"undefined"!=typeof __karma__||"undefined"!=typeof jasmine||"undefined"!=typeof jest||"undefined"!=typeof Mocha},e.localInject=function(e,t){var n=e[f];return n?n.get(t):null},e.memoize=function(e,t){void 0===t&&(t=o);var n=null,r=null;function u(){return function(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}(t,n,arguments)||(r=e.apply(null,arguments)),n=arguments,r}return u.reset=function(){n=null,r=null},u},Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs")):"function"==typeof define&&define.amd?define("@ngxs/store/internals",["exports","@angular/core","rxjs"],t):t(((e=e||self).ngxs=e.ngxs||{},e.ngxs.store=e.ngxs.store||{},e.ngxs.store.internals={}),e.ng.core,e.rxjs)}(this,(function(e,t,n){"use strict";function r(){return"undefined"!=typeof __karma__||"undefined"!=typeof jasmine||"undefined"!=typeof jest||"undefined"!=typeof Mocha}var o=function(){function e(){this.bootstrap$=new n.ReplaySubject(1)}return Object.defineProperty(e.prototype,"appBootstrapped$",{get:function(){return this.bootstrap$.asObservable()},enumerable:!0,configurable:!0}),e.prototype.bootstrap=function(){this.bootstrap$.next(!0),this.bootstrap$.complete()},e.decorators=[{type:t.Injectable}],e}();function i(e,t){return e===t}var u=new t.InjectionToken("INITIAL_STATE_TOKEN"),c=function(){function e(){}return e.set=function(e){this.value=e},e.pop=function(){var e=this.value;return this.value={},e},e.value={},e}();var a=new t.InjectionToken("Internals.StateContextFactory"),f=new t.InjectionToken("Internals.StateFactory"),l="ɵfac",s=Symbol("InjectorInstance"),p=Symbol("FactoryHasBeenDecorated"),d=Symbol("InjectorNotifier");function y(e){var n=e[l];if("function"==typeof n){var r=e.ɵprov||e.ɵpipe||e.ɵcmp||e.ɵdir,o=function(){var e=n();e[s]=t.ɵɵdirectiveInject(t.INJECTOR);var r=e[d];return r&&(r.next(!0),r.complete()),e};r&&(r.factory=o),Object.defineProperty(e,l,{get:function(){return o}})}}var b,g=(b=!1,function(){if(!b){var e=Object.defineProperty;Object.defineProperty=function(t,n,r){return n!==l||n===l&&!r.configurable?e.call(this,t,n,r):(e.call(this,t,n,r),y(t),t)},b=!0}});e.INITIAL_STATE_TOKEN=u,e.InitialState=c,e.NGXS_STATE_CONTEXT_FACTORY=a,e.NGXS_STATE_FACTORY=f,e.NgxsBootstrapper=o,e.ensureInjectorNotifierIsCaptured=function(e){if(e[d])return e[d];var t=new n.ReplaySubject(1);return Object.defineProperty(e,d,{get:function(){return t}}),t},e.ensureLocalInjectorCaptured=function(e){if(!(p in e.constructor.prototype)){var n=e.constructor,o=r()||!(!t.ɵglobal.ng||!t.ɵglobal.ngcompilerFacade);ngDevMode&&o?g():y(n),e.constructor.prototype[p]=!0}},e.isAngularInTestMode=r,e.localInject=function(e,t){var n=e[s];return n?n.get(t):null},e.memoize=function(e,t){void 0===t&&(t=i);var n=null,r=null;function o(){return function(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}(t,n,arguments)||(r=e.apply(null,arguments)),n=arguments,r}return o.reset=function(){n=null,r=null},o},Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=ngxs-store-internals.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts","ng://@ngxs/store/internals/decorator-injector-adapter.ts","ng://@ngxs/store/internals/angular.ts"],"names":["NgxsBootstrapper","this","bootstrap$","ReplaySubject","Object","defineProperty","prototype","asObservable","bootstrap","next","complete","Injectable","defaultEqualityCheck","a","b","INITIAL_STATE_TOKEN","InjectionToken","InitialState","set","state","value","pop","NGXS_STATE_CONTEXT_FACTORY","NGXS_STATE_FACTORY","NG_FACTORY_DEF","InjectorInstance","Symbol","FactoryHasBeenDecorated","InjectorNotifier","decorateFactory","constructor","factory","def","ɵprov","ɵpipe","ɵcmp","ɵdir","decoratedFactory","instance","ɵɵdirectiveInject","INJECTOR","injectorNotifier$","get","target","injectorNotifier$_1","ngDevMode","Promise","resolve","then","_a","ɵglobal","process","nextTick","decorateFactoryLater","__karma__","jasmine","jest","Mocha","token","injector","func","equalityCheck","lastArgs","lastResult","memoized","prev","length","i","areArgumentsShallowlyEqual","arguments","apply","reset"],"mappings":"iXAAA,IAAAA,EAAA,WAGA,SAAAA,IAKUC,KAAAC,WAAa,IAAIC,EAAAA,cAAuB,GAclD,OAZEC,OAAAC,eAAIL,EAAAM,UAAA,mBAAgB,KAApB,WACE,OAAOL,KAAKC,WAAW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BAAhCA,EAAYN,GACrBK,EAAgBC,GACPe,WAsEb,SAA8Bf,GAK5B,IACEgB,QAAQC,UAAUC,MAAI,WACpBnB,EAAgBC,MAElB,MAAAmB,GAGAC,EAAAA,QAAQC,SACND,EAAAA,QAAQC,QAAQC,UAChBF,EAAAA,QAAQC,QAAQC,UAAQ,WACtBvB,EAAgBC,OA9EpBuB,CAAqBvB,GAGvBa,EAAOb,YAAYxB,UAAUqB,IAA2B,0BC5D1D,WAOE,MACuB,oBAAd2B,WACY,oBAAZC,SACS,oBAATC,MACU,oBAAVC,qBDoDX,SACEnB,EACAoB,OAEMC,EAAiCrB,EAASb,GAChD,OAAOkC,EAAWA,EAASjB,IAAIgB,GAAS,gBH3C1C,SACEE,EACAC,QAAA,IAAAA,IAAAA,EAAAjD,OAEIkD,EAA8B,KAC9BC,EAAkB,KAEtB,SAASC,IAOP,OAxCJ,SACEH,EACAI,EACAxD,GAEA,GAAa,OAATwD,GAA0B,OAATxD,GAAiBwD,EAAKC,SAAWzD,EAAKyD,OACzD,OAAO,EAKT,QADMA,EAASD,EAAKC,OACXC,EAAI,EAAGA,EAAID,EAAQC,IAC1B,IAAKN,EAAcI,EAAKE,GAAI1D,EAAK0D,IAC/B,OAAO,EAIX,OAAO,EAiBAC,CAA2BP,EAAeC,EAAUO,aAEvDN,EAAa,EAAiBO,MAAM,KAAMD,YAG5CP,EAAWO,UACJN,EAOT,OALA,EAAgBQ,MAAK,WAEnBT,EAAW,KACXC,EAAa,MAEf","sourcesContent":["import { Injectable } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable()\nexport class NgxsBootstrapper {\n /**\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\n */\n private bootstrap$ = new ReplaySubject<boolean>(1);\n\n get appBootstrapped$(): Observable<boolean> {\n return this.bootstrap$.asObservable();\n }\n\n /**\n * This event will be emitted after attaching `ComponentRef` of the root component\n * to the tree of views, that's a signal that application has been fully rendered\n */\n bootstrap(): void {\n this.bootstrap$.next(true);\n this.bootstrap$.complete();\n }\n}\n","function defaultEqualityCheck(a: any, b: any) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(\n equalityCheck: (a: any, b: any) => boolean,\n prev: IArguments | null,\n next: IArguments | null\n) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n const length = prev.length;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Memoize a function on its last inputs only.\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\n *\n * @ignore\n */\nexport function memoize<T extends (...args: any[]) => any>(\n func: T,\n equalityCheck = defaultEqualityCheck\n): T {\n let lastArgs: IArguments | null = null;\n let lastResult: any = null;\n // we reference arguments instead of spreading them for performance reasons\n function memoized() {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = (<Function>func).apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n }\n (<any>memoized).reset = function() {\n // The hidden (for now) ability to reset the memoization\n lastArgs = null;\n lastResult = null;\n };\n return memoized as T;\n}\n","import { InjectionToken } from '@angular/core';\nimport { PlainObject } from './symbols';\n\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\n\nexport class InitialState {\n private static value: PlainObject = {};\n\n public static set(state: PlainObject) {\n this.value = state;\n }\n\n public static pop(): PlainObject {\n const state: PlainObject = this.value;\n this.value = {};\n return state;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateContextFactory'\n);\n\n/**\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateFactory'\n);\n","import {\n InjectionToken,\n Injector,\n INJECTOR,\n Type,\n ɵɵdirectiveInject,\n ɵglobal\n} from '@angular/core';\nimport { ReplaySubject } from 'rxjs';\n\n// Will be provided through Terser global definitions by Angular CLI\n// during the production build. This is how Angular does tree-shaking internally.\ndeclare const ngDevMode: boolean;\n\n// Angular doesn't export `NG_FACTORY_DEF`.\nconst NG_FACTORY_DEF = 'ɵfac';\n\n// A `Symbol` which is used to save the `Injector` onto the class instance.\nconst InjectorInstance: unique symbol = Symbol('InjectorInstance');\n\n// A `Symbol` which is used to determine if factory has been decorated previously or not.\nconst FactoryHasBeenDecorated: unique symbol = Symbol('FactoryHasBeenDecorated');\n\n// A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot\n// be retrieved within the `constructor` since it's set after the `factory()` is called.\nconst InjectorNotifier: unique symbol = Symbol('InjectorNotifier');\n\ninterface PrototypeWithInjectorNotifier extends Object {\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n\nexport function ensureInjectorNotifierIsCaptured(\n target: PrototypeWithInjectorNotifier | PrivateInstance\n): ReplaySubject<boolean> {\n if (target[InjectorNotifier]) {\n return target[InjectorNotifier]!;\n } else {\n const injectorNotifier$ = new ReplaySubject<boolean>(1);\n Object.defineProperty(target, InjectorNotifier, {\n get: () => injectorNotifier$\n });\n return injectorNotifier$;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function ensureLocalInjectorCaptured(target: Object): void {\n if (FactoryHasBeenDecorated in target.constructor.prototype) {\n return;\n }\n\n const constructor: ConstructorWithDefinitionAndFactory = target.constructor;\n // Means we're in AOT mode.\n if (typeof constructor[NG_FACTORY_DEF] === 'function') {\n decorateFactory(constructor);\n } else if (ngDevMode) {\n // We're running in JIT mode and that means we're not able to get the compiled definition\n // on the class inside the property decorator during the current message loop tick. We have\n // to wait for the next message loop tick. Note that this is safe since this Promise will be\n // resolved even before the `APP_INITIALIZER` is resolved.\n // The below code also will be executed only in development mode, since it's never recommended\n // to use the JIT compiler in production mode (by setting \"aot: false\").\n decorateFactoryLater(constructor);\n }\n\n target.constructor.prototype[FactoryHasBeenDecorated] = true;\n}\n\nexport function localInject<T>(\n instance: PrivateInstance,\n token: InjectionToken<T> | Type<T>\n): T | null {\n const injector: Injector | undefined = instance[InjectorInstance];\n return injector ? injector.get(token) : null;\n}\n\nfunction decorateFactory(constructor: ConstructorWithDefinitionAndFactory): void {\n const factory = constructor[NG_FACTORY_DEF];\n\n if (typeof factory !== 'function') {\n return;\n }\n\n // Let's try to get any definition.\n // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first\n // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).\n const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;\n\n const decoratedFactory = () => {\n const instance = factory();\n // Caretaker note: `inject()` won't work here.\n // We can use the `directiveInject` only during the component\n // construction, since Angular captures the currently active injector.\n // We're not able to use this function inside the getter (when the `selectorId` property is\n // requested for the first time), since the currently active injector will be null.\n instance[InjectorInstance] = ɵɵdirectiveInject(\n // We're using `INJECTOR` token except of the `Injector` class since the compiler\n // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.\n // Caretaker note: that this is the same way of getting the injector.\n INJECTOR\n );\n\n // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.\n const injectorNotifier$ = instance[InjectorNotifier];\n if (injectorNotifier$) {\n injectorNotifier$.next(true);\n injectorNotifier$.complete();\n }\n\n return instance;\n };\n\n // If we've found any definition then it's enough to override the `def.factory` since Angular\n // code uses the `def.factory` and then fallbacks to `ɵfac`.\n if (def) {\n def.factory = decoratedFactory;\n }\n\n // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular\n // still uses the `ɵfac`.\n Object.defineProperty(constructor, NG_FACTORY_DEF, {\n get: () => decoratedFactory\n });\n}\n\nfunction decorateFactoryLater(constructor: ConstructorWithDefinitionAndFactory): void {\n // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.\n // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws\n // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call\n // Promise.then from within a sync test`.\n try {\n Promise.resolve().then(() => {\n decorateFactory(constructor);\n });\n } catch {\n // This is kind of a \"hack\", but we try to be backwards-compatible,\n // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.\n ɵglobal.process &&\n ɵglobal.process.nextTick &&\n ɵglobal.process.nextTick(() => {\n decorateFactory(constructor);\n });\n }\n}\n\n// We could've used `ɵɵFactoryDef` but we try to be backwards-compatible,\n// since it's not exported in older Angular versions.\ntype Factory = () => PrivateInstance;\n\n// We could've used `ɵɵInjectableDef`, `ɵɵPipeDef`, etc. We try to be backwards-compatible\n// since they're not exported in older Angular versions.\ninterface Definition {\n factory: Factory | null;\n}\n\ninterface ConstructorWithDefinitionAndFactory extends Function {\n // Provider definition for the `@Injectable()` class.\n ɵprov?: Definition;\n // Pipe definition for the `@Pipe()` class.\n ɵpipe?: Definition;\n // Component definition for the `@Component()` class.\n ɵcmp?: Definition;\n // Directive definition for the `@Directive()` class.\n ɵdir?: Definition;\n [NG_FACTORY_DEF]?: Factory;\n}\n\ninterface PrivateInstance {\n [InjectorInstance]?: Injector;\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n","declare const __karma__: unknown;\ndeclare const jasmine: unknown;\ndeclare const jest: unknown;\ndeclare const Mocha: unknown;\n\nexport function isAngularInTestMode(): boolean {\n // This is safe to check for these properties in the following way since `typeof` does not\n // throw an exception if the value does not exist in the scope.\n // We should not try to read these values from the global scope (e.g. `ɵglobal` from the `@angular/core`).\n // This is related to how these frameworks compile and execute modules. E.g. Jest wraps the module into\n // its internal code where `jest` variable exists in the scope. It cannot be read from the global scope, e.g.\n // this will return undefined `global.jest`, but `jest` will not equal undefined.\n return (\n typeof __karma__ !== 'undefined' ||\n typeof jasmine !== 'undefined' ||\n typeof jest !== 'undefined' ||\n typeof Mocha !== 'undefined'\n );\n}\n"]}
1
+ {"version":3,"sources":["ng://@ngxs/store/internals/angular.ts","ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts","ng://@ngxs/store/internals/decorator-injector-adapter.ts"],"names":["isAngularInTestMode","__karma__","jasmine","jest","Mocha","NgxsBootstrapper","this","bootstrap$","ReplaySubject","Object","defineProperty","prototype","asObservable","bootstrap","next","complete","Injectable","defaultEqualityCheck","a","b","INITIAL_STATE_TOKEN","InjectionToken","InitialState","set","state","value","pop","NGXS_STATE_CONTEXT_FACTORY","NGXS_STATE_FACTORY","NG_FACTORY_DEF","InjectorInstance","Symbol","FactoryHasBeenDecorated","InjectorNotifier","decorateFactory","constructor","factory","def","ɵprov","ɵpipe","ɵcmp","ɵdir","decoratedFactory","instance","ɵɵdirectiveInject","INJECTOR","injectorNotifier$","get","objectDefinePropertyPatched","patchObjectDefineProperty","object","propertyKey","attributes","configurable","call","target","injectorNotifier$_1","isJitModeOrIsAngularInTestMode","ɵglobal","ng","ɵcompilerFacade","ngDevMode","token","injector","func","equalityCheck","lastArgs","lastResult","memoized","prev","length","i","areArgumentsShallowlyEqual","arguments","apply","reset"],"mappings":"iXAKA,SAAgBA,IAOd,MACuB,oBAAdC,WACY,oBAAZC,SACS,oBAATC,MACU,oBAAVC,MChBX,IAAAC,EAAA,WAGA,SAAAA,IAKUC,KAAAC,WAAa,IAAIC,EAAAA,cAAuB,GAclD,OAZEC,OAAAC,eAAIL,EAAAM,UAAA,mBAAgB,KAApB,WACE,OAAOL,KAAKC,WAAWK,gDAOzBP,EAAAM,UAAAE,UAAA,WACEP,KAAKC,WAAWO,MAAK,GACrBR,KAAKC,WAAWQ,gCAjBnBC,EAAAA,aAmBDX,EAtBA,GCAA,SAASY,EAAqBC,EAAQC,GACpC,OAAOD,IAAMC,ECEf,IAA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EAAkB,CAC9Cc,IAAG,WAAQ,OAAAS,KAENA,iCAKX,SAA4CD,GAC1C,KAAIvB,KAA2BuB,EAAOpB,YAAYxB,WAAlD,KAIMwB,EAAmDoB,EAAOpB,YAsB1DsB,EACJzD,QAA4B0D,EAAAA,QAAQC,KAAMD,EAAAA,QAAQC,GAAGC,iBAInDC,WAAaJ,EACfR,IAEAf,EAAgBC,GAGlBoB,EAAOpB,YAAYxB,UAAUqB,IAA2B,0CAG1D,SACEW,EACAmB,OAEMC,EAAiCpB,EAASb,GAChD,OAAOiC,EAAWA,EAAShB,IAAIe,GAAS,gBHhE1C,SACEE,EACAC,QAAA,IAAAA,IAAAA,EAAAhD,OAEIiD,EAA8B,KAC9BC,EAAkB,KAEtB,SAASC,IAOP,OAxCJ,SACEH,EACAI,EACAvD,GAEA,GAAa,OAATuD,GAA0B,OAATvD,GAAiBuD,EAAKC,SAAWxD,EAAKwD,OACzD,OAAO,EAKT,QADMA,EAASD,EAAKC,OACXC,EAAI,EAAGA,EAAID,EAAQC,IAC1B,IAAKN,EAAcI,EAAKE,GAAIzD,EAAKyD,IAC/B,OAAO,EAIX,OAAO,EAiBAC,CAA2BP,EAAeC,EAAUO,aAEvDN,EAAa,EAAiBO,MAAM,KAAMD,YAG5CP,EAAWO,UACJN,EAOT,OALA,EAAgBQ,MAAK,WAEnBT,EAAW,KACXC,EAAa,MAEf","sourcesContent":["declare const __karma__: unknown;\ndeclare const jasmine: unknown;\ndeclare const jest: unknown;\ndeclare const Mocha: unknown;\n\nexport function isAngularInTestMode(): boolean {\n // This is safe to check for these properties in the following way since `typeof` does not\n // throw an exception if the value does not exist in the scope.\n // We should not try to read these values from the global scope (e.g. `ɵglobal` from the `@angular/core`).\n // This is related to how these frameworks compile and execute modules. E.g. Jest wraps the module into\n // its internal code where `jest` variable exists in the scope. It cannot be read from the global scope, e.g.\n // this will return undefined `global.jest`, but `jest` will not equal undefined.\n return (\n typeof __karma__ !== 'undefined' ||\n typeof jasmine !== 'undefined' ||\n typeof jest !== 'undefined' ||\n typeof Mocha !== 'undefined'\n );\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable()\nexport class NgxsBootstrapper {\n /**\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\n */\n private bootstrap$ = new ReplaySubject<boolean>(1);\n\n get appBootstrapped$(): Observable<boolean> {\n return this.bootstrap$.asObservable();\n }\n\n /**\n * This event will be emitted after attaching `ComponentRef` of the root component\n * to the tree of views, that's a signal that application has been fully rendered\n */\n bootstrap(): void {\n this.bootstrap$.next(true);\n this.bootstrap$.complete();\n }\n}\n","function defaultEqualityCheck(a: any, b: any) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(\n equalityCheck: (a: any, b: any) => boolean,\n prev: IArguments | null,\n next: IArguments | null\n) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n const length = prev.length;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Memoize a function on its last inputs only.\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\n *\n * @ignore\n */\nexport function memoize<T extends (...args: any[]) => any>(\n func: T,\n equalityCheck = defaultEqualityCheck\n): T {\n let lastArgs: IArguments | null = null;\n let lastResult: any = null;\n // we reference arguments instead of spreading them for performance reasons\n function memoized() {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = (<Function>func).apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n }\n (<any>memoized).reset = function() {\n // The hidden (for now) ability to reset the memoization\n lastArgs = null;\n lastResult = null;\n };\n return memoized as T;\n}\n","import { InjectionToken } from '@angular/core';\nimport { PlainObject } from './symbols';\n\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\n\nexport class InitialState {\n private static value: PlainObject = {};\n\n public static set(state: PlainObject) {\n this.value = state;\n }\n\n public static pop(): PlainObject {\n const state: PlainObject = this.value;\n this.value = {};\n return state;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateContextFactory'\n);\n\n/**\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateFactory'\n);\n","import {\n InjectionToken,\n Injector,\n INJECTOR,\n Type,\n ɵglobal,\n ɵɵdirectiveInject\n} from '@angular/core';\nimport { ReplaySubject } from 'rxjs';\n\nimport { isAngularInTestMode } from './angular';\n\n// Will be provided through Terser global definitions by Angular CLI\n// during the production build. This is how Angular does tree-shaking internally.\ndeclare const ngDevMode: boolean;\n\n// Angular doesn't export `NG_FACTORY_DEF`.\nconst NG_FACTORY_DEF = 'ɵfac';\n\n// A `Symbol` which is used to save the `Injector` onto the class instance.\nconst InjectorInstance: unique symbol = Symbol('InjectorInstance');\n\n// A `Symbol` which is used to determine if factory has been decorated previously or not.\nconst FactoryHasBeenDecorated: unique symbol = Symbol('FactoryHasBeenDecorated');\n\n// A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot\n// be retrieved within the `constructor` since it's set after the `factory()` is called.\nconst InjectorNotifier: unique symbol = Symbol('InjectorNotifier');\n\ninterface PrototypeWithInjectorNotifier extends Object {\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n\nexport function ensureInjectorNotifierIsCaptured(\n target: PrototypeWithInjectorNotifier | PrivateInstance\n): ReplaySubject<boolean> {\n if (target[InjectorNotifier]) {\n return target[InjectorNotifier]!;\n } else {\n const injectorNotifier$ = new ReplaySubject<boolean>(1);\n Object.defineProperty(target, InjectorNotifier, {\n get: () => injectorNotifier$\n });\n return injectorNotifier$;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function ensureLocalInjectorCaptured(target: Object): void {\n if (FactoryHasBeenDecorated in target.constructor.prototype) {\n return;\n }\n\n const constructor: ConstructorWithDefinitionAndFactory = target.constructor;\n\n // The factory is set later by the Angular compiler in JIT mode, and we're not able to patch the factory now.\n // We can't use any asynchronous code like `Promise.resolve().then(...)` since this is not functional in unit\n // tests that are being run in `SyncTestZoneSpec`.\n // Given the following example:\n // @Component()\n // class BaseComponent {}\n // @Component()\n // class MainComponent extends BaseComponent {\n // @Select(AnimalsState) animals$: Observable<string[]>;\n // }\n // In this example, the factory will be defined for the `BaseComponent`, but will not be defined for the `MainComponent`.\n // If we try to decorate the factory immediately, we'll get `Cannot redefine property` exception when Angular will try to define\n // an original factory for the `MainComponent`.\n\n // Note: the factory is defined statically in the code in AOT mode.\n // AppComponent.ɵfac = function AppComponent_Factory(t) {\n // return new (t || AppComponent)();\n // };\n // __decorate([Select], AppComponent.prototype, 'animals$', void 0);\n\n const isJitModeOrIsAngularInTestMode =\n isAngularInTestMode() || !!(ɵglobal.ng && ɵglobal.ng.ɵcompilerFacade);\n\n // If we're in development mode AND we're running unit tests or there's a compiler facade exposed,\n // then patch `Object.defineProperty`. The compiler facade is exposed in JIT mode.\n if (ngDevMode && isJitModeOrIsAngularInTestMode) {\n patchObjectDefineProperty();\n } else {\n decorateFactory(constructor);\n }\n\n target.constructor.prototype[FactoryHasBeenDecorated] = true;\n}\n\nexport function localInject<T>(\n instance: PrivateInstance,\n token: InjectionToken<T> | Type<T>\n): T | null {\n const injector: Injector | undefined = instance[InjectorInstance];\n return injector ? injector.get(token) : null;\n}\n\nfunction decorateFactory(constructor: ConstructorWithDefinitionAndFactory): void {\n const factory = constructor[NG_FACTORY_DEF];\n\n if (typeof factory !== 'function') {\n return;\n }\n\n // Let's try to get any definition.\n // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first\n // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).\n const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;\n\n const decoratedFactory = () => {\n const instance = factory();\n // Caretaker note: `inject()` won't work here.\n // We can use the `directiveInject` only during the component\n // construction, since Angular captures the currently active injector.\n // We're not able to use this function inside the getter (when the `selectorId` property is\n // requested for the first time), since the currently active injector will be null.\n instance[InjectorInstance] = ɵɵdirectiveInject(\n // We're using `INJECTOR` token except of the `Injector` class since the compiler\n // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.\n // Caretaker note: that this is the same way of getting the injector.\n INJECTOR\n );\n\n // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.\n const injectorNotifier$ = instance[InjectorNotifier];\n if (injectorNotifier$) {\n injectorNotifier$.next(true);\n injectorNotifier$.complete();\n }\n\n return instance;\n };\n\n // If we've found any definition then it's enough to override the `def.factory` since Angular\n // code uses the `def.factory` and then fallbacks to `ɵfac`.\n if (def) {\n def.factory = decoratedFactory;\n }\n\n // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular\n // still uses the `ɵfac`.\n Object.defineProperty(constructor, NG_FACTORY_DEF, {\n get: () => decoratedFactory\n });\n}\n\n// Note: this function will be tree-shaken in production.\nconst patchObjectDefineProperty = (() => {\n let objectDefinePropertyPatched = false;\n return () => {\n if (objectDefinePropertyPatched) {\n return;\n }\n const defineProperty = Object.defineProperty;\n // We should not be patching globals, but there's no other way to know when it's appropriate\n // to decorate the original factory. There're different edge cases, e.g., when the class extends\n // another class, the factory will be defined for the base class but not for the child class.\n // The patching will be done only during the development and in JIT mode.\n Object.defineProperty = function<T>(\n object: T,\n propertyKey: PropertyKey,\n attributes: PropertyDescriptor & ThisType<any>\n ) {\n // Angular calls `Object.defineProperty(target, 'ɵfac', { get: ..., configurable: true })` when defining a factory function.\n // We only want to intercept `ɵfac` key.\n // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original\n // implementation and then decorate the factory.\n // // https://github.com/angular/angular/blob/3a60063a54d850c50ce962a8a39ce01cfee71398/packages/core/src/render3/jit/pipe.ts#L21-L39\n if (\n propertyKey !== NG_FACTORY_DEF ||\n // We also call `Object.defineProperty(target, 'ɵfac', ...)`, but we don't set `configurable` property.\n (propertyKey === NG_FACTORY_DEF && !attributes.configurable)\n ) {\n return defineProperty.call(this, object, propertyKey, attributes) as T;\n } else {\n // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original\n // implementation and then decorate the factory.\n defineProperty.call(this, object, propertyKey, attributes);\n decorateFactory((object as unknown) as ConstructorWithDefinitionAndFactory);\n return object;\n }\n };\n objectDefinePropertyPatched = true;\n };\n})();\n\n// We could've used `ɵɵFactoryDef` but we try to be backwards-compatible,\n// since it's not exported in older Angular versions.\ntype Factory = () => PrivateInstance;\n\n// We could've used `ɵɵInjectableDef`, `ɵɵPipeDef`, etc. We try to be backwards-compatible\n// since they're not exported in older Angular versions.\ninterface Definition {\n factory: Factory | null;\n}\n\ninterface ConstructorWithDefinitionAndFactory extends Function {\n // Provider definition for the `@Injectable()` class.\n ɵprov?: Definition;\n // Pipe definition for the `@Pipe()` class.\n ɵpipe?: Definition;\n // Component definition for the `@Component()` class.\n ɵcmp?: Definition;\n // Directive definition for the `@Directive()` class.\n ɵdir?: Definition;\n [NG_FACTORY_DEF]?: Factory;\n}\n\ninterface PrivateInstance {\n [InjectorInstance]?: Injector;\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n"]}
@@ -2,8 +2,9 @@
2
2
  * @fileoverview added by tsickle
3
3
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4
4
  */
5
- import { INJECTOR, ɵɵdirectiveInject, ɵglobal } from '@angular/core';
5
+ import { INJECTOR, ɵglobal, ɵɵdirectiveInject } from '@angular/core';
6
6
  import { ReplaySubject } from 'rxjs';
7
+ import { isAngularInTestMode } from './angular';
7
8
  // Angular doesn't export `NG_FACTORY_DEF`.
8
9
  /** @type {?} */
9
10
  const NG_FACTORY_DEF = 'ɵfac';
@@ -56,18 +57,33 @@ export function ensureLocalInjectorCaptured(target) {
56
57
  }
57
58
  /** @type {?} */
58
59
  const constructor = target.constructor;
59
- // Means we're in AOT mode.
60
- if (typeof constructor[NG_FACTORY_DEF] === 'function') {
61
- decorateFactory(constructor);
60
+ // The factory is set later by the Angular compiler in JIT mode, and we're not able to patch the factory now.
61
+ // We can't use any asynchronous code like `Promise.resolve().then(...)` since this is not functional in unit
62
+ // tests that are being run in `SyncTestZoneSpec`.
63
+ // Given the following example:
64
+ // @Component()
65
+ // class BaseComponent {}
66
+ // @Component()
67
+ // class MainComponent extends BaseComponent {
68
+ // @Select(AnimalsState) animals$: Observable<string[]>;
69
+ // }
70
+ // In this example, the factory will be defined for the `BaseComponent`, but will not be defined for the `MainComponent`.
71
+ // If we try to decorate the factory immediately, we'll get `Cannot redefine property` exception when Angular will try to define
72
+ // an original factory for the `MainComponent`.
73
+ // Note: the factory is defined statically in the code in AOT mode.
74
+ // AppComponent.ɵfac = function AppComponent_Factory(t) {
75
+ // return new (t || AppComponent)();
76
+ // };
77
+ // __decorate([Select], AppComponent.prototype, 'animals$', void 0);
78
+ /** @type {?} */
79
+ const isJitModeOrIsAngularInTestMode = isAngularInTestMode() || !!(ɵglobal.ng && ɵglobal.ng.ɵcompilerFacade);
80
+ // If we're in development mode AND we're running unit tests or there's a compiler facade exposed,
81
+ // then patch `Object.defineProperty`. The compiler facade is exposed in JIT mode.
82
+ if (ngDevMode && isJitModeOrIsAngularInTestMode) {
83
+ patchObjectDefineProperty();
62
84
  }
63
- else if (ngDevMode) {
64
- // We're running in JIT mode and that means we're not able to get the compiled definition
65
- // on the class inside the property decorator during the current message loop tick. We have
66
- // to wait for the next message loop tick. Note that this is safe since this Promise will be
67
- // resolved even before the `APP_INITIALIZER` is resolved.
68
- // The below code also will be executed only in development mode, since it's never recommended
69
- // to use the JIT compiler in production mode (by setting "aot: false").
70
- decorateFactoryLater(constructor);
85
+ else {
86
+ decorateFactory(constructor);
71
87
  }
72
88
  target.constructor.prototype[FactoryHasBeenDecorated] = true;
73
89
  }
@@ -137,36 +153,57 @@ function decorateFactory(constructor) {
137
153
  () => decoratedFactory)
138
154
  });
139
155
  }
140
- /**
141
- * @param {?} constructor
156
+ // Note: this function will be tree-shaken in production.
157
+ const ɵ0 = /**
142
158
  * @return {?}
143
159
  */
144
- function decorateFactoryLater(constructor) {
145
- // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.
146
- // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws
147
- // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call
148
- // Promise.then from within a sync test`.
149
- try {
150
- Promise.resolve().then((/**
160
+ () => {
161
+ /** @type {?} */
162
+ let objectDefinePropertyPatched = false;
163
+ return (/**
164
+ * @return {?}
165
+ */
166
+ () => {
167
+ if (objectDefinePropertyPatched) {
168
+ return;
169
+ }
170
+ /** @type {?} */
171
+ const defineProperty = Object.defineProperty;
172
+ // We should not be patching globals, but there's no other way to know when it's appropriate
173
+ // to decorate the original factory. There're different edge cases, e.g., when the class extends
174
+ // another class, the factory will be defined for the base class but not for the child class.
175
+ // The patching will be done only during the development and in JIT mode.
176
+ Object.defineProperty = (/**
177
+ * @template T
178
+ * @param {?} object
179
+ * @param {?} propertyKey
180
+ * @param {?} attributes
151
181
  * @return {?}
152
182
  */
153
- () => {
154
- decorateFactory(constructor);
155
- }));
156
- }
157
- catch (_a) {
158
- // This is kind of a "hack", but we try to be backwards-compatible,
159
- // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.
160
- ɵglobal.process &&
161
- ɵglobal.process.nextTick &&
162
- ɵglobal.process.nextTick((/**
163
- * @return {?}
164
- */
165
- () => {
166
- decorateFactory(constructor);
167
- }));
168
- }
169
- }
183
+ function (object, propertyKey, attributes) {
184
+ // Angular calls `Object.defineProperty(target, 'ɵfac', { get: ..., configurable: true })` when defining a factory function.
185
+ // We only want to intercept `ɵfac` key.
186
+ // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original
187
+ // implementation and then decorate the factory.
188
+ // // https://github.com/angular/angular/blob/3a60063a54d850c50ce962a8a39ce01cfee71398/packages/core/src/render3/jit/pipe.ts#L21-L39
189
+ if (propertyKey !== NG_FACTORY_DEF ||
190
+ // We also call `Object.defineProperty(target, 'ɵfac', ...)`, but we don't set `configurable` property.
191
+ (propertyKey === NG_FACTORY_DEF && !attributes.configurable)) {
192
+ return (/** @type {?} */ (defineProperty.call(this, object, propertyKey, attributes)));
193
+ }
194
+ else {
195
+ // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original
196
+ // implementation and then decorate the factory.
197
+ defineProperty.call(this, object, propertyKey, attributes);
198
+ decorateFactory((/** @type {?} */ (((/** @type {?} */ (object))))));
199
+ return object;
200
+ }
201
+ });
202
+ objectDefinePropertyPatched = true;
203
+ });
204
+ };
205
+ /** @type {?} */
206
+ const patchObjectDefineProperty = ((ɵ0))();
170
207
  /**
171
208
  * @record
172
209
  */
@@ -201,4 +238,5 @@ if (false) {
201
238
  /* Skipping unnamed member:
202
239
  [InjectorNotifier]?: ReplaySubject<boolean>;*/
203
240
  }
204
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjb3JhdG9yLWluamVjdG9yLWFkYXB0ZXIuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Abmd4cy9zdG9yZS9pbnRlcm5hbHMvIiwic291cmNlcyI6WyJkZWNvcmF0b3ItaW5qZWN0b3ItYWRhcHRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUdMLFFBQVEsRUFFUixpQkFBaUIsRUFDakIsT0FBTyxFQUNSLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxNQUFNLENBQUM7OztNQU8vQixjQUFjLEdBQUcsTUFBTTs7O01BR3ZCLG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ZWZgLCBldGMuIFdlIHRyeSB0byBiZSBiYWNrd2FyZHMtY29tcGF0aWJsZVxuLy8gc2luY2UgdGhleSdyZSBub3QgZXhwb3J0ZWQgaW4gb2xkZXIgQW5ndWxhciB2ZXJzaW9ucy5cbmludGVyZmFjZSBEZWZpbml0aW9uIHtcbiAgZmFjdG9yeTogRmFjdG9yeSB8IG51bGw7XG59XG5cbmludGVyZmFjZSBDb25zdHJ1Y3RvcldpdGhEZWZpbml0aW9uQW5kRmFjdG9yeSBleHRlbmRzIEZ1bmN0aW9uIHtcbiAgLy8gUHJvdmlkZXIgZGVmaW5pdGlvbiBmb3IgdGhlIGBASW5qZWN0YWJsZSgpYCBjbGFzcy5cbiAgybVwcm92PzogRGVmaW5pdGlvbjtcbiAgLy8gUGlwZSBkZWZpbml0aW9uIGZvciB0aGUgYEBQaXBlKClgIGNsYXNzLlxuICDJtXBpcGU/OiBEZWZpbml0aW9uO1xuICAvLyBDb21wb25lbnQgZGVmaW5pdGlvbiBmb3IgdGhlIGBAQ29tcG9uZW50KClgIGNsYXNzLlxuICDJtWNtcD86IERlZmluaXRpb247XG4gIC8vIERpcmVjdGl2ZSBkZWZpbml0aW9uIGZvciB0aGUgYEBEaXJlY3RpdmUoKWAgY2xhc3MuXG4gIMm1ZGlyPzogRGVmaW5pdGlvbjtcbiAgW05HX0ZBQ1RPUllfREVGXT86IEZhY3Rvcnk7XG59XG5cbmludGVyZmFjZSBQcml2YXRlSW5zdGFuY2Uge1xuICBbSW5qZWN0b3JJbnN0YW5jZV0/OiBJbmplY3RvcjtcbiAgW0luamVjdG9yTm90aWZpZXJdPzogUmVwbGF5U3ViamVjdDxib29sZWFuPjtcbn1cbiJdfQ==
@@ -2,8 +2,9 @@
2
2
  * @fileoverview added by tsickle
3
3
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4
4
  */
5
- import { INJECTOR, ɵɵdirectiveInject, ɵglobal } from '@angular/core';
5
+ import { INJECTOR, ɵglobal, ɵɵdirectiveInject } from '@angular/core';
6
6
  import { ReplaySubject } from 'rxjs';
7
+ import { isAngularInTestMode } from './angular';
7
8
  // Angular doesn't export `NG_FACTORY_DEF`.
8
9
  /** @type {?} */
9
10
  var NG_FACTORY_DEF = 'ɵfac';
@@ -56,18 +57,33 @@ export function ensureLocalInjectorCaptured(target) {
56
57
  }
57
58
  /** @type {?} */
58
59
  var constructor = target.constructor;
59
- // Means we're in AOT mode.
60
- if (typeof constructor[NG_FACTORY_DEF] === 'function') {
61
- decorateFactory(constructor);
60
+ // The factory is set later by the Angular compiler in JIT mode, and we're not able to patch the factory now.
61
+ // We can't use any asynchronous code like `Promise.resolve().then(...)` since this is not functional in unit
62
+ // tests that are being run in `SyncTestZoneSpec`.
63
+ // Given the following example:
64
+ // @Component()
65
+ // class BaseComponent {}
66
+ // @Component()
67
+ // class MainComponent extends BaseComponent {
68
+ // @Select(AnimalsState) animals$: Observable<string[]>;
69
+ // }
70
+ // In this example, the factory will be defined for the `BaseComponent`, but will not be defined for the `MainComponent`.
71
+ // If we try to decorate the factory immediately, we'll get `Cannot redefine property` exception when Angular will try to define
72
+ // an original factory for the `MainComponent`.
73
+ // Note: the factory is defined statically in the code in AOT mode.
74
+ // AppComponent.ɵfac = function AppComponent_Factory(t) {
75
+ // return new (t || AppComponent)();
76
+ // };
77
+ // __decorate([Select], AppComponent.prototype, 'animals$', void 0);
78
+ /** @type {?} */
79
+ var isJitModeOrIsAngularInTestMode = isAngularInTestMode() || !!(ɵglobal.ng && ɵglobal.ng.ɵcompilerFacade);
80
+ // If we're in development mode AND we're running unit tests or there's a compiler facade exposed,
81
+ // then patch `Object.defineProperty`. The compiler facade is exposed in JIT mode.
82
+ if (ngDevMode && isJitModeOrIsAngularInTestMode) {
83
+ patchObjectDefineProperty();
62
84
  }
63
- else if (ngDevMode) {
64
- // We're running in JIT mode and that means we're not able to get the compiled definition
65
- // on the class inside the property decorator during the current message loop tick. We have
66
- // to wait for the next message loop tick. Note that this is safe since this Promise will be
67
- // resolved even before the `APP_INITIALIZER` is resolved.
68
- // The below code also will be executed only in development mode, since it's never recommended
69
- // to use the JIT compiler in production mode (by setting "aot: false").
70
- decorateFactoryLater(constructor);
85
+ else {
86
+ decorateFactory(constructor);
71
87
  }
72
88
  target.constructor.prototype[FactoryHasBeenDecorated] = true;
73
89
  }
@@ -137,36 +153,57 @@ function decorateFactory(constructor) {
137
153
  function () { return decoratedFactory; })
138
154
  });
139
155
  }
140
- /**
141
- * @param {?} constructor
156
+ // Note: this function will be tree-shaken in production.
157
+ var ɵ0 = /**
142
158
  * @return {?}
143
159
  */
144
- function decorateFactoryLater(constructor) {
145
- // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.
146
- // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws
147
- // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call
148
- // Promise.then from within a sync test`.
149
- try {
150
- Promise.resolve().then((/**
160
+ function () {
161
+ /** @type {?} */
162
+ var objectDefinePropertyPatched = false;
163
+ return (/**
164
+ * @return {?}
165
+ */
166
+ function () {
167
+ if (objectDefinePropertyPatched) {
168
+ return;
169
+ }
170
+ /** @type {?} */
171
+ var defineProperty = Object.defineProperty;
172
+ // We should not be patching globals, but there's no other way to know when it's appropriate
173
+ // to decorate the original factory. There're different edge cases, e.g., when the class extends
174
+ // another class, the factory will be defined for the base class but not for the child class.
175
+ // The patching will be done only during the development and in JIT mode.
176
+ Object.defineProperty = (/**
177
+ * @template T
178
+ * @param {?} object
179
+ * @param {?} propertyKey
180
+ * @param {?} attributes
151
181
  * @return {?}
152
182
  */
153
- function () {
154
- decorateFactory(constructor);
155
- }));
156
- }
157
- catch (_a) {
158
- // This is kind of a "hack", but we try to be backwards-compatible,
159
- // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.
160
- ɵglobal.process &&
161
- ɵglobal.process.nextTick &&
162
- ɵglobal.process.nextTick((/**
163
- * @return {?}
164
- */
165
- function () {
166
- decorateFactory(constructor);
167
- }));
168
- }
169
- }
183
+ function (object, propertyKey, attributes) {
184
+ // Angular calls `Object.defineProperty(target, 'ɵfac', { get: ..., configurable: true })` when defining a factory function.
185
+ // We only want to intercept `ɵfac` key.
186
+ // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original
187
+ // implementation and then decorate the factory.
188
+ // // https://github.com/angular/angular/blob/3a60063a54d850c50ce962a8a39ce01cfee71398/packages/core/src/render3/jit/pipe.ts#L21-L39
189
+ if (propertyKey !== NG_FACTORY_DEF ||
190
+ // We also call `Object.defineProperty(target, 'ɵfac', ...)`, but we don't set `configurable` property.
191
+ (propertyKey === NG_FACTORY_DEF && !attributes.configurable)) {
192
+ return (/** @type {?} */ (defineProperty.call(this, object, propertyKey, attributes)));
193
+ }
194
+ else {
195
+ // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original
196
+ // implementation and then decorate the factory.
197
+ defineProperty.call(this, object, propertyKey, attributes);
198
+ decorateFactory((/** @type {?} */ (((/** @type {?} */ (object))))));
199
+ return object;
200
+ }
201
+ });
202
+ objectDefinePropertyPatched = true;
203
+ });
204
+ };
205
+ /** @type {?} */
206
+ var patchObjectDefineProperty = ((ɵ0))();
170
207
  /**
171
208
  * @record
172
209
  */
@@ -201,4 +238,5 @@ if (false) {
201
238
  /* Skipping unnamed member:
202
239
  [InjectorNotifier]?: ReplaySubject<boolean>;*/
203
240
  }
204
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjb3JhdG9yLWluamVjdG9yLWFkYXB0ZXIuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Abmd4cy9zdG9yZS9pbnRlcm5hbHMvIiwic291cmNlcyI6WyJkZWNvcmF0b3ItaW5qZWN0b3ItYWRhcHRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUdMLFFBQVEsRUFFUixpQkFBaUIsRUFDakIsT0FBTyxFQUNSLE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ɵglobal } from '@angular/core';
1
+ import { Injectable, InjectionToken, ɵglobal, ɵɵdirectiveInject, INJECTOR } from '@angular/core';
2
2
  import { ReplaySubject } from 'rxjs';
3
3
 
4
4
  /**
@@ -234,18 +234,33 @@ function ensureLocalInjectorCaptured(target) {
234
234
  }
235
235
  /** @type {?} */
236
236
  const constructor = target.constructor;
237
- // Means we're in AOT mode.
238
- if (typeof constructor[NG_FACTORY_DEF] === 'function') {
239
- decorateFactory(constructor);
237
+ // The factory is set later by the Angular compiler in JIT mode, and we're not able to patch the factory now.
238
+ // We can't use any asynchronous code like `Promise.resolve().then(...)` since this is not functional in unit
239
+ // tests that are being run in `SyncTestZoneSpec`.
240
+ // Given the following example:
241
+ // @Component()
242
+ // class BaseComponent {}
243
+ // @Component()
244
+ // class MainComponent extends BaseComponent {
245
+ // @Select(AnimalsState) animals$: Observable<string[]>;
246
+ // }
247
+ // In this example, the factory will be defined for the `BaseComponent`, but will not be defined for the `MainComponent`.
248
+ // If we try to decorate the factory immediately, we'll get `Cannot redefine property` exception when Angular will try to define
249
+ // an original factory for the `MainComponent`.
250
+ // Note: the factory is defined statically in the code in AOT mode.
251
+ // AppComponent.ɵfac = function AppComponent_Factory(t) {
252
+ // return new (t || AppComponent)();
253
+ // };
254
+ // __decorate([Select], AppComponent.prototype, 'animals$', void 0);
255
+ /** @type {?} */
256
+ const isJitModeOrIsAngularInTestMode = isAngularInTestMode() || !!(ɵglobal.ng && ɵglobal.ng.ɵcompilerFacade);
257
+ // If we're in development mode AND we're running unit tests or there's a compiler facade exposed,
258
+ // then patch `Object.defineProperty`. The compiler facade is exposed in JIT mode.
259
+ if (ngDevMode && isJitModeOrIsAngularInTestMode) {
260
+ patchObjectDefineProperty();
240
261
  }
241
- else if (ngDevMode) {
242
- // We're running in JIT mode and that means we're not able to get the compiled definition
243
- // on the class inside the property decorator during the current message loop tick. We have
244
- // to wait for the next message loop tick. Note that this is safe since this Promise will be
245
- // resolved even before the `APP_INITIALIZER` is resolved.
246
- // The below code also will be executed only in development mode, since it's never recommended
247
- // to use the JIT compiler in production mode (by setting "aot: false").
248
- decorateFactoryLater(constructor);
262
+ else {
263
+ decorateFactory(constructor);
249
264
  }
250
265
  target.constructor.prototype[FactoryHasBeenDecorated] = true;
251
266
  }
@@ -315,36 +330,57 @@ function decorateFactory(constructor) {
315
330
  () => decoratedFactory)
316
331
  });
317
332
  }
318
- /**
319
- * @param {?} constructor
333
+ // Note: this function will be tree-shaken in production.
334
+ const ɵ0 = /**
320
335
  * @return {?}
321
336
  */
322
- function decorateFactoryLater(constructor) {
323
- // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.
324
- // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws
325
- // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call
326
- // Promise.then from within a sync test`.
327
- try {
328
- Promise.resolve().then((/**
337
+ () => {
338
+ /** @type {?} */
339
+ let objectDefinePropertyPatched = false;
340
+ return (/**
341
+ * @return {?}
342
+ */
343
+ () => {
344
+ if (objectDefinePropertyPatched) {
345
+ return;
346
+ }
347
+ /** @type {?} */
348
+ const defineProperty = Object.defineProperty;
349
+ // We should not be patching globals, but there's no other way to know when it's appropriate
350
+ // to decorate the original factory. There're different edge cases, e.g., when the class extends
351
+ // another class, the factory will be defined for the base class but not for the child class.
352
+ // The patching will be done only during the development and in JIT mode.
353
+ Object.defineProperty = (/**
354
+ * @template T
355
+ * @param {?} object
356
+ * @param {?} propertyKey
357
+ * @param {?} attributes
329
358
  * @return {?}
330
359
  */
331
- () => {
332
- decorateFactory(constructor);
333
- }));
334
- }
335
- catch (_a) {
336
- // This is kind of a "hack", but we try to be backwards-compatible,
337
- // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.
338
- ɵglobal.process &&
339
- ɵglobal.process.nextTick &&
340
- ɵglobal.process.nextTick((/**
341
- * @return {?}
342
- */
343
- () => {
344
- decorateFactory(constructor);
345
- }));
346
- }
347
- }
360
+ function (object, propertyKey, attributes) {
361
+ // Angular calls `Object.defineProperty(target, 'ɵfac', { get: ..., configurable: true })` when defining a factory function.
362
+ // We only want to intercept `ɵfac` key.
363
+ // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original
364
+ // implementation and then decorate the factory.
365
+ // // https://github.com/angular/angular/blob/3a60063a54d850c50ce962a8a39ce01cfee71398/packages/core/src/render3/jit/pipe.ts#L21-L39
366
+ if (propertyKey !== NG_FACTORY_DEF ||
367
+ // We also call `Object.defineProperty(target, 'ɵfac', ...)`, but we don't set `configurable` property.
368
+ (propertyKey === NG_FACTORY_DEF && !attributes.configurable)) {
369
+ return (/** @type {?} */ (defineProperty.call(this, object, propertyKey, attributes)));
370
+ }
371
+ else {
372
+ // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original
373
+ // implementation and then decorate the factory.
374
+ defineProperty.call(this, object, propertyKey, attributes);
375
+ decorateFactory((/** @type {?} */ (((/** @type {?} */ (object))))));
376
+ return object;
377
+ }
378
+ });
379
+ objectDefinePropertyPatched = true;
380
+ });
381
+ };
382
+ /** @type {?} */
383
+ const patchObjectDefineProperty = ((ɵ0))();
348
384
  /**
349
385
  * @record
350
386
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ngxs-store-internals.js","sources":["ng://@ngxs/store/internals/angular.ts","ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts","ng://@ngxs/store/internals/decorator-injector-adapter.ts"],"sourcesContent":["declare const __karma__: unknown;\ndeclare const jasmine: unknown;\ndeclare const jest: unknown;\ndeclare const Mocha: unknown;\n\nexport function isAngularInTestMode(): boolean {\n // This is safe to check for these properties in the following way since `typeof` does not\n // throw an exception if the value does not exist in the scope.\n // We should not try to read these values from the global scope (e.g. `ɵglobal` from the `@angular/core`).\n // This is related to how these frameworks compile and execute modules. E.g. Jest wraps the module into\n // its internal code where `jest` variable exists in the scope. It cannot be read from the global scope, e.g.\n // this will return undefined `global.jest`, but `jest` will not equal undefined.\n return (\n typeof __karma__ !== 'undefined' ||\n typeof jasmine !== 'undefined' ||\n typeof jest !== 'undefined' ||\n typeof Mocha !== 'undefined'\n );\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable()\nexport class NgxsBootstrapper {\n /**\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\n */\n private bootstrap$ = new ReplaySubject<boolean>(1);\n\n get appBootstrapped$(): Observable<boolean> {\n return this.bootstrap$.asObservable();\n }\n\n /**\n * This event will be emitted after attaching `ComponentRef` of the root component\n * to the tree of views, that's a signal that application has been fully rendered\n */\n bootstrap(): void {\n this.bootstrap$.next(true);\n this.bootstrap$.complete();\n }\n}\n","function defaultEqualityCheck(a: any, b: any) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(\n equalityCheck: (a: any, b: any) => boolean,\n prev: IArguments | null,\n next: IArguments | null\n) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n const length = prev.length;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Memoize a function on its last inputs only.\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\n *\n * @ignore\n */\nexport function memoize<T extends (...args: any[]) => any>(\n func: T,\n equalityCheck = defaultEqualityCheck\n): T {\n let lastArgs: IArguments | null = null;\n let lastResult: any = null;\n // we reference arguments instead of spreading them for performance reasons\n function memoized() {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = (<Function>func).apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n }\n (<any>memoized).reset = function() {\n // The hidden (for now) ability to reset the memoization\n lastArgs = null;\n lastResult = null;\n };\n return memoized as T;\n}\n","import { InjectionToken } from '@angular/core';\nimport { PlainObject } from './symbols';\n\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\n\nexport class InitialState {\n private static value: PlainObject = {};\n\n public static set(state: PlainObject) {\n this.value = state;\n }\n\n public static pop(): PlainObject {\n const state: PlainObject = this.value;\n this.value = {};\n return state;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateContextFactory'\n);\n\n/**\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateFactory'\n);\n","import {\n InjectionToken,\n Injector,\n INJECTOR,\n Type,\n ɵɵdirectiveInject,\n ɵglobal\n} from '@angular/core';\nimport { ReplaySubject } from 'rxjs';\n\n// Will be provided through Terser global definitions by Angular CLI\n// during the production build. This is how Angular does tree-shaking internally.\ndeclare const ngDevMode: boolean;\n\n// Angular doesn't export `NG_FACTORY_DEF`.\nconst NG_FACTORY_DEF = 'ɵfac';\n\n// A `Symbol` which is used to save the `Injector` onto the class instance.\nconst InjectorInstance: unique symbol = Symbol('InjectorInstance');\n\n// A `Symbol` which is used to determine if factory has been decorated previously or not.\nconst FactoryHasBeenDecorated: unique symbol = Symbol('FactoryHasBeenDecorated');\n\n// A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot\n// be retrieved within the `constructor` since it's set after the `factory()` is called.\nconst InjectorNotifier: unique symbol = Symbol('InjectorNotifier');\n\ninterface PrototypeWithInjectorNotifier extends Object {\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n\nexport function ensureInjectorNotifierIsCaptured(\n target: PrototypeWithInjectorNotifier | PrivateInstance\n): ReplaySubject<boolean> {\n if (target[InjectorNotifier]) {\n return target[InjectorNotifier]!;\n } else {\n const injectorNotifier$ = new ReplaySubject<boolean>(1);\n Object.defineProperty(target, InjectorNotifier, {\n get: () => injectorNotifier$\n });\n return injectorNotifier$;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function ensureLocalInjectorCaptured(target: Object): void {\n if (FactoryHasBeenDecorated in target.constructor.prototype) {\n return;\n }\n\n const constructor: ConstructorWithDefinitionAndFactory = target.constructor;\n // Means we're in AOT mode.\n if (typeof constructor[NG_FACTORY_DEF] === 'function') {\n decorateFactory(constructor);\n } else if (ngDevMode) {\n // We're running in JIT mode and that means we're not able to get the compiled definition\n // on the class inside the property decorator during the current message loop tick. We have\n // to wait for the next message loop tick. Note that this is safe since this Promise will be\n // resolved even before the `APP_INITIALIZER` is resolved.\n // The below code also will be executed only in development mode, since it's never recommended\n // to use the JIT compiler in production mode (by setting \"aot: false\").\n decorateFactoryLater(constructor);\n }\n\n target.constructor.prototype[FactoryHasBeenDecorated] = true;\n}\n\nexport function localInject<T>(\n instance: PrivateInstance,\n token: InjectionToken<T> | Type<T>\n): T | null {\n const injector: Injector | undefined = instance[InjectorInstance];\n return injector ? injector.get(token) : null;\n}\n\nfunction decorateFactory(constructor: ConstructorWithDefinitionAndFactory): void {\n const factory = constructor[NG_FACTORY_DEF];\n\n if (typeof factory !== 'function') {\n return;\n }\n\n // Let's try to get any definition.\n // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first\n // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).\n const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;\n\n const decoratedFactory = () => {\n const instance = factory();\n // Caretaker note: `inject()` won't work here.\n // We can use the `directiveInject` only during the component\n // construction, since Angular captures the currently active injector.\n // We're not able to use this function inside the getter (when the `selectorId` property is\n // requested for the first time), since the currently active injector will be null.\n instance[InjectorInstance] = ɵɵdirectiveInject(\n // We're using `INJECTOR` token except of the `Injector` class since the compiler\n // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.\n // Caretaker note: that this is the same way of getting the injector.\n INJECTOR\n );\n\n // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.\n const injectorNotifier$ = instance[InjectorNotifier];\n if (injectorNotifier$) {\n injectorNotifier$.next(true);\n injectorNotifier$.complete();\n }\n\n return instance;\n };\n\n // If we've found any definition then it's enough to override the `def.factory` since Angular\n // code uses the `def.factory` and then fallbacks to `ɵfac`.\n if (def) {\n def.factory = decoratedFactory;\n }\n\n // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular\n // still uses the `ɵfac`.\n Object.defineProperty(constructor, NG_FACTORY_DEF, {\n get: () => decoratedFactory\n });\n}\n\nfunction decorateFactoryLater(constructor: ConstructorWithDefinitionAndFactory): void {\n // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.\n // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws\n // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call\n // Promise.then from within a sync test`.\n try {\n Promise.resolve().then(() => {\n decorateFactory(constructor);\n });\n } catch {\n // This is kind of a \"hack\", but we try to be backwards-compatible,\n // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.\n ɵglobal.process &&\n ɵglobal.process.nextTick &&\n ɵglobal.process.nextTick(() => {\n decorateFactory(constructor);\n });\n }\n}\n\n// We could've used `ɵɵFactoryDef` but we try to be backwards-compatible,\n// since it's not exported in older Angular versions.\ntype Factory = () => PrivateInstance;\n\n// We could've used `ɵɵInjectableDef`, `ɵɵPipeDef`, etc. We try to be backwards-compatible\n// since they're not exported in older Angular versions.\ninterface Definition {\n factory: Factory | null;\n}\n\ninterface ConstructorWithDefinitionAndFactory extends Function {\n // Provider definition for the `@Injectable()` class.\n ɵprov?: Definition;\n // Pipe definition for the `@Pipe()` class.\n ɵpipe?: Definition;\n // Component definition for the `@Component()` class.\n ɵcmp?: Definition;\n // Directive definition for the `@Directive()` class.\n ɵdir?: Definition;\n [NG_FACTORY_DEF]?: Factory;\n}\n\ninterface Private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jB,QAAQ,GAAG,OAAO,EAAE;;;;;;QAM1B,QAAQ,CAAC,gBAAgB,CAAC,GAAG,iBAAiB;;;;QAI5C,QAAQ,CACT,CAAC;;;cAGI,iBAAiB,GAAG,QAAQ,CAAC,gBAAgB,CAAC;QACpD,IAAI,iBAAiB,EAAE;YACrB,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC7B,iBAAiB,CAAC,QAAQ,EAAE,CAAC;SAC9B;QAED,OAAO,QAAQ,CAAC;KACjB,CAAA;;;IAID,IAAI,GAAG,EAAE;QACP,GAAG,CAAC,OAAO,GAAG,gBAAgB,CAAC;KAChC;;;IAID,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,cAAc,EAAE;QACjD,GAAG;;;QAAE,MAAM,gBAAgB,CAAA;KAC5B,CAAC,CAAC;CACJ;;;;;AAED,SAAS,oBAAoB,CAAC,WAAgD;;;;;IAK5E,IAAI;QACF,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI;;;QAAC;YACrB,eAAe,CAAC,WAAW,CAAC,CAAC;SAC9B,EAAC,CAAC;KACJ;IAAC,WAAM;;;QAGN,OAAO,CAAC,OAAO;YACb,OAAO,CAAC,OAAO,CAAC,QAAQ;YACxB,OAAO,CAAC,OAAO,CAAC,QAAQ;;;YAAC;gBACvB,eAAe,CAAC,WAAW,CAAC,CAAC;aAC9B,EAAC,CAAC;KACN;CACF;;;;AAQD,yBAEC;;;IADC,6BAAwB;;;;;AAG1B,kDAUC;;;IARC,oDAAmB;;IAEnB,oDAAmB;;IAEnB,mDAAkB;;IAElB,mDAAkB;;;;;;;AAIpB,8BAGC;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ngxs-store-internals.js","sources":["ng://@ngxs/store/internals/angular.ts","ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts","ng://@ngxs/store/internals/decorator-injector-adapter.ts"],"sourcesContent":["declare const __karma__: unknown;\ndeclare const jasmine: unknown;\ndeclare const jest: unknown;\ndeclare const Mocha: unknown;\n\nexport function isAngularInTestMode(): boolean {\n // This is safe to check for these properties in the following way since `typeof` does not\n // throw an exception if the value does not exist in the scope.\n // We should not try to read these values from the global scope (e.g. `ɵglobal` from the `@angular/core`).\n // This is related to how these frameworks compile and execute modules. E.g. Jest wraps the module into\n // its internal code where `jest` variable exists in the scope. It cannot be read from the global scope, e.g.\n // this will return undefined `global.jest`, but `jest` will not equal undefined.\n return (\n typeof __karma__ !== 'undefined' ||\n typeof jasmine !== 'undefined' ||\n typeof jest !== 'undefined' ||\n typeof Mocha !== 'undefined'\n );\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable()\nexport class NgxsBootstrapper {\n /**\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\n */\n private bootstrap$ = new ReplaySubject<boolean>(1);\n\n get appBootstrapped$(): Observable<boolean> {\n return this.bootstrap$.asObservable();\n }\n\n /**\n * This event will be emitted after attaching `ComponentRef` of the root component\n * to the tree of views, that's a signal that application has been fully rendered\n */\n bootstrap(): void {\n this.bootstrap$.next(true);\n this.bootstrap$.complete();\n }\n}\n","function defaultEqualityCheck(a: any, b: any) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(\n equalityCheck: (a: any, b: any) => boolean,\n prev: IArguments | null,\n next: IArguments | null\n) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n const length = prev.length;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Memoize a function on its last inputs only.\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\n *\n * @ignore\n */\nexport function memoize<T extends (...args: any[]) => any>(\n func: T,\n equalityCheck = defaultEqualityCheck\n): T {\n let lastArgs: IArguments | null = null;\n let lastResult: any = null;\n // we reference arguments instead of spreading them for performance reasons\n function memoized() {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = (<Function>func).apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n }\n (<any>memoized).reset = function() {\n // The hidden (for now) ability to reset the memoization\n lastArgs = null;\n lastResult = null;\n };\n return memoized as T;\n}\n","import { InjectionToken } from '@angular/core';\nimport { PlainObject } from './symbols';\n\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\n\nexport class InitialState {\n private static value: PlainObject = {};\n\n public static set(state: PlainObject) {\n this.value = state;\n }\n\n public static pop(): PlainObject {\n const state: PlainObject = this.value;\n this.value = {};\n return state;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateContextFactory'\n);\n\n/**\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateFactory'\n);\n","import {\n InjectionToken,\n Injector,\n INJECTOR,\n Type,\n ɵglobal,\n ɵɵdirectiveInject\n} from '@angular/core';\nimport { ReplaySubject } from 'rxjs';\n\nimport { isAngularInTestMode } from './angular';\n\n// Will be provided through Terser global definitions by Angular CLI\n// during the production build. This is how Angular does tree-shaking internally.\ndeclare const ngDevMode: boolean;\n\n// Angular doesn't export `NG_FACTORY_DEF`.\nconst NG_FACTORY_DEF = 'ɵfac';\n\n// A `Symbol` which is used to save the `Injector` onto the class instance.\nconst InjectorInstance: unique symbol = Symbol('InjectorInstance');\n\n// A `Symbol` which is used to determine if factory has been decorated previously or not.\nconst FactoryHasBeenDecorated: unique symbol = Symbol('FactoryHasBeenDecorated');\n\n// A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot\n// be retrieved within the `constructor` since it's set after the `factory()` is called.\nconst InjectorNotifier: unique symbol = Symbol('InjectorNotifier');\n\ninterface PrototypeWithInjectorNotifier extends Object {\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n\nexport function ensureInjectorNotifierIsCaptured(\n target: PrototypeWithInjectorNotifier | PrivateInstance\n): ReplaySubject<boolean> {\n if (target[InjectorNotifier]) {\n return target[InjectorNotifier]!;\n } else {\n const injectorNotifier$ = new ReplaySubject<boolean>(1);\n Object.defineProperty(target, InjectorNotifier, {\n get: () => injectorNotifier$\n });\n return injectorNotifier$;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function ensureLocalInjectorCaptured(target: Object): void {\n if (FactoryHasBeenDecorated in target.constructor.prototype) {\n return;\n }\n\n const constructor: ConstructorWithDefinitionAndFactory = target.constructor;\n\n // The factory is set later by the Angular compiler in JIT mode, and we're not able to patch the factory now.\n // We can't use any asynchronous code like `Promise.resolve().then(...)` since this is not functional in unit\n // tests that are being run in `SyncTestZoneSpec`.\n // Given the following example:\n // @Component()\n // class BaseComponent {}\n // @Component()\n // class MainComponent extends BaseComponent {\n // @Select(AnimalsState) animals$: Observable<string[]>;\n // }\n // In this example, the factory will be defined for the `BaseComponent`, but will not be defined for the `MainComponent`.\n // If we try to decorate the factory immediately, we'll get `Cannot redefine property` exception when Angular will try to define\n // an original factory for the `MainComponent`.\n\n // Note: the factory is defined statically in the code in AOT mode.\n // AppComponent.ɵfac = function AppComponent_Factory(t) {\n // return new (t || AppComponent)();\n // };\n // __decorate([Select], AppComponent.prototype, 'animals$', void 0);\n\n const isJitModeOrIsAngularInTestMode =\n isAngularInTestMode() || !!(ɵglobal.ng && ɵglobal.ng.ɵcompilerFacade);\n\n // If we're in development mode AND we're running unit tests or there's a compiler facade exposed,\n // then patch `Object.defineProperty`. The compiler facade is exposed in JIT mode.\n if (ngDevMode && isJitModeOrIsAngularInTestMode) {\n patchObjectDefineProperty();\n } else {\n decorateFactory(constructor);\n }\n\n target.constructor.prototype[FactoryHasBeenDecorated] = true;\n}\n\nexport function localInject<T>(\n instance: PrivateInstance,\n token: InjectionToken<T> | Type<T>\n): T | null {\n const injector: Injector | undefined = instance[InjectorInstance];\n return injector ? injector.get(token) : null;\n}\n\nfunction decorateFactory(constructor: ConstructorWithDefinitionAndFactory): void {\n const factory = constructor[NG_FACTORY_DEF];\n\n if (typeof factory !== 'function') {\n return;\n }\n\n // Let's try to get any definition.\n // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first\n // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).\n const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;\n\n const decoratedFactory = () => {\n const instance = factory();\n // Caretaker note: `inject()` won't work here.\n // We can use the `directiveInject` only during the component\n // construction, since Angular captures the currently active injector.\n // We're not able to use this function inside the getter (when the `selectorId` property is\n // requested for the first time), since the currently active injector will be null.\n instance[InjectorInstance] = ɵɵdirectiveInject(\n // We're using `INJECTOR` token except of the `Injector` class since the compiler\n // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.\n // Caretaker note: that this is the same way of getting the injector.\n INJECTOR\n );\n\n // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.\n const injectorNotifier$ = instance[InjectorNotifier];\n if (injectorNotifier$) {\n injectorNotifier$.next(true);\n injectorNotifier$.complete();\n }\n\n return instance;\n };\n\n // If we've found any definition then it's enough to override the `def.factory` since Angular\n // code uses the `def.factory` and then fallbacks to `ɵfac`.\n if (def) {\n def.factory = decoratedFactory;\n }\n\n // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular\n // still uses the `ɵfac`.\n Object.defineProperty(constructor, NG_FACTORY_DEF, {\n get: () => decoratedFactory\n });\n}\n\n// Note: this function will be tree-shaken in production.\nconst patchObjectDefineProperty = (() => {\n let objectDefinePropertyPatched = false;\n return () => {\n if (objectDefinePropertyPatched) {\n return;\n }\n const defineProperty = Object.defineProperty;\n // We should not be patching globals, but there's no other way to know when it's appropriate\n // to decorate the original factory. There're different edge cases, e.g., when the class extends\n // another class, the factory will be defined for the base class but not for the child class.\n // The patching will be done only during the development and in JIT mode.\n Object.defineProperty = function<T>(\n object: T,\n propertyKey: PropertyKey,\n attributes: PropertyDescriptor & ThisType<any>\n ) {\n // Angular calls `Object.defineProperty(target, 'ɵfac', { get: ..., configurable: true })` when defining a factory function.\n // We only want to intercept `ɵfac` key.\n // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original\n // implementation and then decorate the factory.\n // // https://github.com/angular/angular/blob/3a60063a54d850c50ce962a8a39ce01cfee71398/packages/core/src/render3/jit/pipe.ts#L21-L39\n if (\n propertyKey !== NG_FACTORY_DEF ||\n // We also call `Object.defineProperty(target, 'ɵfac', ...)`, but we don't set `configurable` property.\n (propertyKey === NG_FACTORY_DEF && !attributes.configurable)\n ) {\n return defineProperty.call(this, object, propertyKey, attributes) as T;\n } else {\n // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original\n // implementation and then decorate the factory.\n defineProperty.call(this, object, propertyKey, attributes);\n decorateFactory((object as unknown) as ConstructorWithDefinitionAndFactory);\n return object;\n }\n };\n objectDefinePropertyPatched = true;\n };\n})();\n\n// We could've used `ɵɵFactoryDef` but we try to be backwards-compatible,\n// since it's not exported in older Angular versions.\ntype Factory = () => PrivateInstance;\n\n// We could've used `ɵɵInjectableDef`, `ɵɵPipeDef`, etc. We try to be backwards-compatible\n// since they're not exported in older Angular versions.\ninterface Definition {\n factory: Factory | null;\n}\n\ninterface ConstructorWithDefinitionAndFactory extends Function {\n // Provider definition for the `@Injectable()` class.\n ɵprov?: Definition;\n // Pipe definition for the `@Pipe()` class.\n ɵpipe?: Definition;\n // Component definition for the `@Component()` class.\n ɵcmp?: Definition;\n // Directive definition for the `@Directive()` class.\n ɵdir?: Definition;\n [NG_FACTORY_DEF]?: Factory;\n}\n\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AG,IAAI,CAAC;KACpC,EAAC;CACH;;MArCK,yBAAyB,GAAG,QAqC9B;;;;AAQJ,yBAEC;;;IADC,6BAAwB;;;;;AAG1B,kDAUC;;;IARC,oDAAmB;;IAEnB,oDAAmB;;IAEnB,mDAAkB;;IAElB,mDAAkB;;;;;;;AAIpB,8BAGC;;;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { Injectable, InjectionToken, ɵɵdirectiveInject, INJECTOR, ɵglobal } from '@angular/core';
1
+ import { Injectable, InjectionToken, ɵglobal, ɵɵdirectiveInject, INJECTOR } from '@angular/core';
2
2
  import { ReplaySubject } from 'rxjs';
3
3
 
4
4
  /**
@@ -259,18 +259,33 @@ function ensureLocalInjectorCaptured(target) {
259
259
  }
260
260
  /** @type {?} */
261
261
  var constructor = target.constructor;
262
- // Means we're in AOT mode.
263
- if (typeof constructor[NG_FACTORY_DEF] === 'function') {
264
- decorateFactory(constructor);
262
+ // The factory is set later by the Angular compiler in JIT mode, and we're not able to patch the factory now.
263
+ // We can't use any asynchronous code like `Promise.resolve().then(...)` since this is not functional in unit
264
+ // tests that are being run in `SyncTestZoneSpec`.
265
+ // Given the following example:
266
+ // @Component()
267
+ // class BaseComponent {}
268
+ // @Component()
269
+ // class MainComponent extends BaseComponent {
270
+ // @Select(AnimalsState) animals$: Observable<string[]>;
271
+ // }
272
+ // In this example, the factory will be defined for the `BaseComponent`, but will not be defined for the `MainComponent`.
273
+ // If we try to decorate the factory immediately, we'll get `Cannot redefine property` exception when Angular will try to define
274
+ // an original factory for the `MainComponent`.
275
+ // Note: the factory is defined statically in the code in AOT mode.
276
+ // AppComponent.ɵfac = function AppComponent_Factory(t) {
277
+ // return new (t || AppComponent)();
278
+ // };
279
+ // __decorate([Select], AppComponent.prototype, 'animals$', void 0);
280
+ /** @type {?} */
281
+ var isJitModeOrIsAngularInTestMode = isAngularInTestMode() || !!(ɵglobal.ng && ɵglobal.ng.ɵcompilerFacade);
282
+ // If we're in development mode AND we're running unit tests or there's a compiler facade exposed,
283
+ // then patch `Object.defineProperty`. The compiler facade is exposed in JIT mode.
284
+ if (ngDevMode && isJitModeOrIsAngularInTestMode) {
285
+ patchObjectDefineProperty();
265
286
  }
266
- else if (ngDevMode) {
267
- // We're running in JIT mode and that means we're not able to get the compiled definition
268
- // on the class inside the property decorator during the current message loop tick. We have
269
- // to wait for the next message loop tick. Note that this is safe since this Promise will be
270
- // resolved even before the `APP_INITIALIZER` is resolved.
271
- // The below code also will be executed only in development mode, since it's never recommended
272
- // to use the JIT compiler in production mode (by setting "aot: false").
273
- decorateFactoryLater(constructor);
287
+ else {
288
+ decorateFactory(constructor);
274
289
  }
275
290
  target.constructor.prototype[FactoryHasBeenDecorated] = true;
276
291
  }
@@ -340,36 +355,57 @@ function decorateFactory(constructor) {
340
355
  function () { return decoratedFactory; })
341
356
  });
342
357
  }
343
- /**
344
- * @param {?} constructor
358
+ // Note: this function will be tree-shaken in production.
359
+ var ɵ0 = /**
345
360
  * @return {?}
346
361
  */
347
- function decorateFactoryLater(constructor) {
348
- // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.
349
- // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws
350
- // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call
351
- // Promise.then from within a sync test`.
352
- try {
353
- Promise.resolve().then((/**
362
+ function () {
363
+ /** @type {?} */
364
+ var objectDefinePropertyPatched = false;
365
+ return (/**
366
+ * @return {?}
367
+ */
368
+ function () {
369
+ if (objectDefinePropertyPatched) {
370
+ return;
371
+ }
372
+ /** @type {?} */
373
+ var defineProperty = Object.defineProperty;
374
+ // We should not be patching globals, but there's no other way to know when it's appropriate
375
+ // to decorate the original factory. There're different edge cases, e.g., when the class extends
376
+ // another class, the factory will be defined for the base class but not for the child class.
377
+ // The patching will be done only during the development and in JIT mode.
378
+ Object.defineProperty = (/**
379
+ * @template T
380
+ * @param {?} object
381
+ * @param {?} propertyKey
382
+ * @param {?} attributes
354
383
  * @return {?}
355
384
  */
356
- function () {
357
- decorateFactory(constructor);
358
- }));
359
- }
360
- catch (_a) {
361
- // This is kind of a "hack", but we try to be backwards-compatible,
362
- // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.
363
- ɵglobal.process &&
364
- ɵglobal.process.nextTick &&
365
- ɵglobal.process.nextTick((/**
366
- * @return {?}
367
- */
368
- function () {
369
- decorateFactory(constructor);
370
- }));
371
- }
372
- }
385
+ function (object, propertyKey, attributes) {
386
+ // Angular calls `Object.defineProperty(target, 'ɵfac', { get: ..., configurable: true })` when defining a factory function.
387
+ // We only want to intercept `ɵfac` key.
388
+ // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original
389
+ // implementation and then decorate the factory.
390
+ // // https://github.com/angular/angular/blob/3a60063a54d850c50ce962a8a39ce01cfee71398/packages/core/src/render3/jit/pipe.ts#L21-L39
391
+ if (propertyKey !== NG_FACTORY_DEF ||
392
+ // We also call `Object.defineProperty(target, 'ɵfac', ...)`, but we don't set `configurable` property.
393
+ (propertyKey === NG_FACTORY_DEF && !attributes.configurable)) {
394
+ return (/** @type {?} */ (defineProperty.call(this, object, propertyKey, attributes)));
395
+ }
396
+ else {
397
+ // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original
398
+ // implementation and then decorate the factory.
399
+ defineProperty.call(this, object, propertyKey, attributes);
400
+ decorateFactory((/** @type {?} */ (((/** @type {?} */ (object))))));
401
+ return object;
402
+ }
403
+ });
404
+ objectDefinePropertyPatched = true;
405
+ });
406
+ };
407
+ /** @type {?} */
408
+ var patchObjectDefineProperty = ((ɵ0))();
373
409
  /**
374
410
  * @record
375
411
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ngxs-store-internals.js","sources":["ng://@ngxs/store/internals/angular.ts","ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts","ng://@ngxs/store/internals/decorator-injector-adapter.ts"],"sourcesContent":["declare const __karma__: unknown;\ndeclare const jasmine: unknown;\ndeclare const jest: unknown;\ndeclare const Mocha: unknown;\n\nexport function isAngularInTestMode(): boolean {\n // This is safe to check for these properties in the following way since `typeof` does not\n // throw an exception if the value does not exist in the scope.\n // We should not try to read these values from the global scope (e.g. `ɵglobal` from the `@angular/core`).\n // This is related to how these frameworks compile and execute modules. E.g. Jest wraps the module into\n // its internal code where `jest` variable exists in the scope. It cannot be read from the global scope, e.g.\n // this will return undefined `global.jest`, but `jest` will not equal undefined.\n return (\n typeof __karma__ !== 'undefined' ||\n typeof jasmine !== 'undefined' ||\n typeof jest !== 'undefined' ||\n typeof Mocha !== 'undefined'\n );\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable()\nexport class NgxsBootstrapper {\n /**\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\n */\n private bootstrap$ = new ReplaySubject<boolean>(1);\n\n get appBootstrapped$(): Observable<boolean> {\n return this.bootstrap$.asObservable();\n }\n\n /**\n * This event will be emitted after attaching `ComponentRef` of the root component\n * to the tree of views, that's a signal that application has been fully rendered\n */\n bootstrap(): void {\n this.bootstrap$.next(true);\n this.bootstrap$.complete();\n }\n}\n","function defaultEqualityCheck(a: any, b: any) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(\n equalityCheck: (a: any, b: any) => boolean,\n prev: IArguments | null,\n next: IArguments | null\n) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n const length = prev.length;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Memoize a function on its last inputs only.\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\n *\n * @ignore\n */\nexport function memoize<T extends (...args: any[]) => any>(\n func: T,\n equalityCheck = defaultEqualityCheck\n): T {\n let lastArgs: IArguments | null = null;\n let lastResult: any = null;\n // we reference arguments instead of spreading them for performance reasons\n function memoized() {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = (<Function>func).apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n }\n (<any>memoized).reset = function() {\n // The hidden (for now) ability to reset the memoization\n lastArgs = null;\n lastResult = null;\n };\n return memoized as T;\n}\n","import { InjectionToken } from '@angular/core';\nimport { PlainObject } from './symbols';\n\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\n\nexport class InitialState {\n private static value: PlainObject = {};\n\n public static set(state: PlainObject) {\n this.value = state;\n }\n\n public static pop(): PlainObject {\n const state: PlainObject = this.value;\n this.value = {};\n return state;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateContextFactory'\n);\n\n/**\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateFactory'\n);\n","import {\n InjectionToken,\n Injector,\n INJECTOR,\n Type,\n ɵɵdirectiveInject,\n ɵglobal\n} from '@angular/core';\nimport { ReplaySubject } from 'rxjs';\n\n// Will be provided through Terser global definitions by Angular CLI\n// during the production build. This is how Angular does tree-shaking internally.\ndeclare const ngDevMode: boolean;\n\n// Angular doesn't export `NG_FACTORY_DEF`.\nconst NG_FACTORY_DEF = 'ɵfac';\n\n// A `Symbol` which is used to save the `Injector` onto the class instance.\nconst InjectorInstance: unique symbol = Symbol('InjectorInstance');\n\n// A `Symbol` which is used to determine if factory has been decorated previously or not.\nconst FactoryHasBeenDecorated: unique symbol = Symbol('FactoryHasBeenDecorated');\n\n// A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot\n// be retrieved within the `constructor` since it's set after the `factory()` is called.\nconst InjectorNotifier: unique symbol = Symbol('InjectorNotifier');\n\ninterface PrototypeWithInjectorNotifier extends Object {\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n\nexport function ensureInjectorNotifierIsCaptured(\n target: PrototypeWithInjectorNotifier | PrivateInstance\n): ReplaySubject<boolean> {\n if (target[InjectorNotifier]) {\n return target[InjectorNotifier]!;\n } else {\n const injectorNotifier$ = new ReplaySubject<boolean>(1);\n Object.defineProperty(target, InjectorNotifier, {\n get: () => injectorNotifier$\n });\n return injectorNotifier$;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function ensureLocalInjectorCaptured(target: Object): void {\n if (FactoryHasBeenDecorated in target.constructor.prototype) {\n return;\n }\n\n const constructor: ConstructorWithDefinitionAndFactory = target.constructor;\n // Means we're in AOT mode.\n if (typeof constructor[NG_FACTORY_DEF] === 'function') {\n decorateFactory(constructor);\n } else if (ngDevMode) {\n // We're running in JIT mode and that means we're not able to get the compiled definition\n // on the class inside the property decorator during the current message loop tick. We have\n // to wait for the next message loop tick. Note that this is safe since this Promise will be\n // resolved even before the `APP_INITIALIZER` is resolved.\n // The below code also will be executed only in development mode, since it's never recommended\n // to use the JIT compiler in production mode (by setting \"aot: false\").\n decorateFactoryLater(constructor);\n }\n\n target.constructor.prototype[FactoryHasBeenDecorated] = true;\n}\n\nexport function localInject<T>(\n instance: PrivateInstance,\n token: InjectionToken<T> | Type<T>\n): T | null {\n const injector: Injector | undefined = instance[InjectorInstance];\n return injector ? injector.get(token) : null;\n}\n\nfunction decorateFactory(constructor: ConstructorWithDefinitionAndFactory): void {\n const factory = constructor[NG_FACTORY_DEF];\n\n if (typeof factory !== 'function') {\n return;\n }\n\n // Let's try to get any definition.\n // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first\n // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).\n const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;\n\n const decoratedFactory = () => {\n const instance = factory();\n // Caretaker note: `inject()` won't work here.\n // We can use the `directiveInject` only during the component\n // construction, since Angular captures the currently active injector.\n // We're not able to use this function inside the getter (when the `selectorId` property is\n // requested for the first time), since the currently active injector will be null.\n instance[InjectorInstance] = ɵɵdirectiveInject(\n // We're using `INJECTOR` token except of the `Injector` class since the compiler\n // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.\n // Caretaker note: that this is the same way of getting the injector.\n INJECTOR\n );\n\n // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.\n const injectorNotifier$ = instance[InjectorNotifier];\n if (injectorNotifier$) {\n injectorNotifier$.next(true);\n injectorNotifier$.complete();\n }\n\n return instance;\n };\n\n // If we've found any definition then it's enough to override the `def.factory` since Angular\n // code uses the `def.factory` and then fallbacks to `ɵfac`.\n if (def) {\n def.factory = decoratedFactory;\n }\n\n // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular\n // still uses the `ɵfac`.\n Object.defineProperty(constructor, NG_FACTORY_DEF, {\n get: () => decoratedFactory\n });\n}\n\nfunction decorateFactoryLater(constructor: ConstructorWithDefinitionAndFactory): void {\n // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.\n // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws\n // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call\n // Promise.then from within a sync test`.\n try {\n Promise.resolve().then(() => {\n decorateFactory(constructor);\n });\n } catch {\n // This is kind of a \"hack\", but we try to be backwards-compatible,\n // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.\n ɵglobal.process &&\n ɵglobal.process.nextTick &&\n ɵglobal.process.nextTick(() => {\n decorateFactory(constructor);\n });\n }\n}\n\n// We could've used `ɵɵFactoryDef` but we try to be backwards-compatible,\n// since it's not exported in older Angular versions.\ntype Factory = () => PrivateInstance;\n\n// We could've used `ɵɵInjectableDef`, `ɵɵPipeDef`, etc. We try to be backwards-compatible\n// since they're not exported in older Angular versions.\ninterface Definition {\n factory: Factory | null;\n}\n\ninterface ConstructorWithDefinitionAndFactory extends Function {\n // Provider definition for the `@Injectable()` class.\n ɵprov?: Definition;\n // Pipe definition for the `@Pipe()` class.\n ɵpipe?: Definition;\n // Component definition for the `@Component()` class.\n ɵcmp?: Definition;\n // Directive definition for the `@Directive()` class.\n ɵdir?: Definition;\n [NG_FACTORY_DEF]?: Factory;\n}\n\ninterface PrivateInstance {\n [InjectorInstance]?: Injector;\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n"],"names":[],"mappings":";;;;;;;;;;AAKA,SAAgB,mBAAmB;;;;;;;IAOjC,QACE,OAAO,SAAS,KAAK,WAAW;QAChC,OAAO,OAAO,KAAK,WAAW;QAC9B,OAAO,IAAI,KAAK,WAAW;QAC3B,OAAO,KAAK,KAAK,WAAW,EAC5B;CACH;;;;;;AClBD;IAGA;;;;QAKU,eAAU,GAAG,IAAI,aAAa,CAAU,CAAC,CAAC,CAAC;KAcpD;IAZC,sBAAI,8CAAgB;;;;QAApB;YACE,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;SACvC;;;OAAA;;;;;;;;;;IAMD,oCAAS;;;;;IAAT;QACE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;KAC5B;;gBAlBF,UAAU;;IAmBX,uBAAC;CAnBD,IAmBC;;;;;;;IAdC,sCAAmD;;;;;;;;;;;;ACRrD,SAAS,oBAAoB,CAAC,CAAM,EAAE,CAAM;IAC1C,OAAO,CAAC,KAAK,CAAC,CAAC;CAChB;;;;;;;AAED,SAAS,0BAA0B,CACjC,aAA0C,EAC1C,IAAuB,EACvB,IAAuB;IAEvB,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,E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Ae,CAAC,WAAW,CAAC,CAAC;aAC9B,EAAC,CAAC;KACN;CACF;;;;AAQD,yBAEC;;;IADC,6BAAwB;;;;;AAG1B,kDAUC;;;IARC,oDAAmB;;IAEnB,oDAAmB;;IAEnB,mDAAkB;;IAElB,mDAAkB;;;;;;;AAIpB,8BAGC;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ngxs-store-internals.js","sources":["ng://@ngxs/store/internals/angular.ts","ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts","ng://@ngxs/store/internals/decorator-injector-adapter.ts"],"sourcesContent":["declare const __karma__: unknown;\ndeclare const jasmine: unknown;\ndeclare const jest: unknown;\ndeclare const Mocha: unknown;\n\nexport function isAngularInTestMode(): boolean {\n // This is safe to check for these properties in the following way since `typeof` does not\n // throw an exception if the value does not exist in the scope.\n // We should not try to read these values from the global scope (e.g. `ɵglobal` from the `@angular/core`).\n // This is related to how these frameworks compile and execute modules. E.g. Jest wraps the module into\n // its internal code where `jest` variable exists in the scope. It cannot be read from the global scope, e.g.\n // this will return undefined `global.jest`, but `jest` will not equal undefined.\n return (\n typeof __karma__ !== 'undefined' ||\n typeof jasmine !== 'undefined' ||\n typeof jest !== 'undefined' ||\n typeof Mocha !== 'undefined'\n );\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable()\nexport class NgxsBootstrapper {\n /**\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\n */\n private bootstrap$ = new ReplaySubject<boolean>(1);\n\n get appBootstrapped$(): Observable<boolean> {\n return this.bootstrap$.asObservable();\n }\n\n /**\n * This event will be emitted after attaching `ComponentRef` of the root component\n * to the tree of views, that's a signal that application has been fully rendered\n */\n bootstrap(): void {\n this.bootstrap$.next(true);\n this.bootstrap$.complete();\n }\n}\n","function defaultEqualityCheck(a: any, b: any) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(\n equalityCheck: (a: any, b: any) => boolean,\n prev: IArguments | null,\n next: IArguments | null\n) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n const length = prev.length;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Memoize a function on its last inputs only.\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\n *\n * @ignore\n */\nexport function memoize<T extends (...args: any[]) => any>(\n func: T,\n equalityCheck = defaultEqualityCheck\n): T {\n let lastArgs: IArguments | null = null;\n let lastResult: any = null;\n // we reference arguments instead of spreading them for performance reasons\n function memoized() {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = (<Function>func).apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n }\n (<any>memoized).reset = function() {\n // The hidden (for now) ability to reset the memoization\n lastArgs = null;\n lastResult = null;\n };\n return memoized as T;\n}\n","import { InjectionToken } from '@angular/core';\nimport { PlainObject } from './symbols';\n\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\n\nexport class InitialState {\n private static value: PlainObject = {};\n\n public static set(state: PlainObject) {\n this.value = state;\n }\n\n public static pop(): PlainObject {\n const state: PlainObject = this.value;\n this.value = {};\n return state;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateContextFactory'\n);\n\n/**\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateFactory'\n);\n","import {\n InjectionToken,\n Injector,\n INJECTOR,\n Type,\n ɵglobal,\n ɵɵdirectiveInject\n} from '@angular/core';\nimport { ReplaySubject } from 'rxjs';\n\nimport { isAngularInTestMode } from './angular';\n\n// Will be provided through Terser global definitions by Angular CLI\n// during the production build. This is how Angular does tree-shaking internally.\ndeclare const ngDevMode: boolean;\n\n// Angular doesn't export `NG_FACTORY_DEF`.\nconst NG_FACTORY_DEF = 'ɵfac';\n\n// A `Symbol` which is used to save the `Injector` onto the class instance.\nconst InjectorInstance: unique symbol = Symbol('InjectorInstance');\n\n// A `Symbol` which is used to determine if factory has been decorated previously or not.\nconst FactoryHasBeenDecorated: unique symbol = Symbol('FactoryHasBeenDecorated');\n\n// A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot\n// be retrieved within the `constructor` since it's set after the `factory()` is called.\nconst InjectorNotifier: unique symbol = Symbol('InjectorNotifier');\n\ninterface PrototypeWithInjectorNotifier extends Object {\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n\nexport function ensureInjectorNotifierIsCaptured(\n target: PrototypeWithInjectorNotifier | PrivateInstance\n): ReplaySubject<boolean> {\n if (target[InjectorNotifier]) {\n return target[InjectorNotifier]!;\n } else {\n const injectorNotifier$ = new ReplaySubject<boolean>(1);\n Object.defineProperty(target, InjectorNotifier, {\n get: () => injectorNotifier$\n });\n return injectorNotifier$;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function ensureLocalInjectorCaptured(target: Object): void {\n if (FactoryHasBeenDecorated in target.constructor.prototype) {\n return;\n }\n\n const constructor: ConstructorWithDefinitionAndFactory = target.constructor;\n\n // The factory is set later by the Angular compiler in JIT mode, and we're not able to patch the factory now.\n // We can't use any asynchronous code like `Promise.resolve().then(...)` since this is not functional in unit\n // tests that are being run in `SyncTestZoneSpec`.\n // Given the following example:\n // @Component()\n // class BaseComponent {}\n // @Component()\n // class MainComponent extends BaseComponent {\n // @Select(AnimalsState) animals$: Observable<string[]>;\n // }\n // In this example, the factory will be defined for the `BaseComponent`, but will not be defined for the `MainComponent`.\n // If we try to decorate the factory immediately, we'll get `Cannot redefine property` exception when Angular will try to define\n // an original factory for the `MainComponent`.\n\n // Note: the factory is defined statically in the code in AOT mode.\n // AppComponent.ɵfac = function AppComponent_Factory(t) {\n // return new (t || AppComponent)();\n // };\n // __decorate([Select], AppComponent.prototype, 'animals$', void 0);\n\n const isJitModeOrIsAngularInTestMode =\n isAngularInTestMode() || !!(ɵglobal.ng && ɵglobal.ng.ɵcompilerFacade);\n\n // If we're in development mode AND we're running unit tests or there's a compiler facade exposed,\n // then patch `Object.defineProperty`. The compiler facade is exposed in JIT mode.\n if (ngDevMode && isJitModeOrIsAngularInTestMode) {\n patchObjectDefineProperty();\n } else {\n decorateFactory(constructor);\n }\n\n target.constructor.prototype[FactoryHasBeenDecorated] = true;\n}\n\nexport function localInject<T>(\n instance: PrivateInstance,\n token: InjectionToken<T> | Type<T>\n): T | null {\n const injector: Injector | undefined = instance[InjectorInstance];\n return injector ? injector.get(token) : null;\n}\n\nfunction decorateFactory(constructor: ConstructorWithDefinitionAndFactory): void {\n const factory = constructor[NG_FACTORY_DEF];\n\n if (typeof factory !== 'function') {\n return;\n }\n\n // Let's try to get any definition.\n // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first\n // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).\n const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;\n\n const decoratedFactory = () => {\n const instance = factory();\n // Caretaker note: `inject()` won't work here.\n // We can use the `directiveInject` only during the component\n // construction, since Angular captures the currently active injector.\n // We're not able to use this function inside the getter (when the `selectorId` property is\n // requested for the first time), since the currently active injector will be null.\n instance[InjectorInstance] = ɵɵdirectiveInject(\n // We're using `INJECTOR` token except of the `Injector` class since the compiler\n // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.\n // Caretaker note: that this is the same way of getting the injector.\n INJECTOR\n );\n\n // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.\n const injectorNotifier$ = instance[InjectorNotifier];\n if (injectorNotifier$) {\n injectorNotifier$.next(true);\n injectorNotifier$.complete();\n }\n\n return instance;\n };\n\n // If we've found any definition then it's enough to override the `def.factory` since Angular\n // code uses the `def.factory` and then fallbacks to `ɵfac`.\n if (def) {\n def.factory = decoratedFactory;\n }\n\n // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular\n // still uses the `ɵfac`.\n Object.defineProperty(constructor, NG_FACTORY_DEF, {\n get: () => decoratedFactory\n });\n}\n\n// Note: this function will be tree-shaken in production.\nconst patchObjectDefineProperty = (() => {\n let objectDefinePropertyPatched = false;\n return () => {\n if (objectDefinePropertyPatched) {\n return;\n }\n const defineProperty = Object.defineProperty;\n // We should not be patching globals, but there's no other way to know when it's appropriate\n // to decorate the original factory. There're different edge cases, e.g., when the class extends\n // another class, the factory will be defined for the base class but not for the child class.\n // The patching will be done only during the development and in JIT mode.\n Object.defineProperty = function<T>(\n object: T,\n propertyKey: PropertyKey,\n attributes: PropertyDescriptor & ThisType<any>\n ) {\n // Angular calls `Object.defineProperty(target, 'ɵfac', { get: ..., configurable: true })` when defining a factory function.\n // We only want to intercept `ɵfac` key.\n // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original\n // implementation and then decorate the factory.\n // // https://github.com/angular/angular/blob/3a60063a54d850c50ce962a8a39ce01cfee71398/packages/core/src/render3/jit/pipe.ts#L21-L39\n if (\n propertyKey !== NG_FACTORY_DEF ||\n // We also call `Object.defineProperty(target, 'ɵfac', ...)`, but we don't set `configurable` property.\n (propertyKey === NG_FACTORY_DEF && !attributes.configurable)\n ) {\n return defineProperty.call(this, object, propertyKey, attributes) as T;\n } else {\n // If the property is `ɵfac` AND `configurable` equals `true`, then let's call the original\n // implementation and then decorate the factory.\n defineProperty.call(this, object, propertyKey, attributes);\n decorateFactory((object as unknown) as ConstructorWithDefinitionAndFactory);\n return object;\n }\n };\n objectDefinePropertyPatched = true;\n };\n})();\n\n// We could've used `ɵɵFactoryDef` but we try to be backwards-compatible,\n// since it's not exported in older Angular versions.\ntype Factory = () => PrivateInstance;\n\n// We could've used `ɵɵInjectableDef`, `ɵɵPipeDef`, etc. We try to be backwards-compatible\n// since they're not exported in older Angular versions.\ninterface Definition {\n factory: Factory | null;\n}\n\ninterface ConstructorWithDefinitionAndFactory extends Function {\n // Provider definition for the `@Injectable()` class.\n ɵprov?: Definition;\n // Pipe definition for the `@Pipe()` class.\n ɵpipe?: Definition;\n // Component definition for the `@Component()` class.\n ɵcmp?: Definition;\n // Directive definition for the `@Directive()` class.\n ɵdir?: Definition;\n [NG_FACTORY_DEF]?: Factory;\n}\n\ninterface PrivateInstance {\n [InjectorInstance]?: Injector;\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n"],"names":[],"mappings":";;;;;;;;;;AAKA,SAAgB,mBAAmB;;;;;;;IAOjC,QACE,OAAO,SAAS,KAAK,WAAW;QAChC,OAAO,OAAO,KAAK,WAAW;QAC9B,OAAO,IAAI,KAAK,WAAW;QAC3B,OAAO,KAAK,KAAK,WAAW,EAC5B;CACH;;;;;;AClBD;IAGA;;;;QAKU,eAAU,GAAG,IAAI,aAAa,CAAU,CAAC,CAAC,CAAC;KAcpD;IAZC,sBAAI,8CAAgB;;;;QAApB;YACE,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;SACvC;;;OAAA;;;;;;;;;;IAMD,oCAAS;;;;;IAAT;QACE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;KAC5B;;gBAlBF,UAAU;;IAmBX,uBAAC;CAnBD,IAmBC;;;;;;;IAdC,sCAAmD;;;;;;;;;;;;ACRrD,SAAS,oBAAoB,CAAC,CAAM,EAAE,CAAM;IAC1C,OAAO,CAAC,KAAK,CAAC,CAAC;CAChB;;;;;;;AAED,SAAS,0BAA0B,CACjC,aAA0C,EAC1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,OAAO;SACR;;YACK,cAAc,GAAG,MAAM,CAAC,cAAc;;;;;QAK5C,MAAM,CAAC,cAAc;;;;;;;QAAG,UACtB,MAAS,EACT,WAAwB,EACxB,UAA8C;;;;;;YAO9C,IACE,WAAW,KAAK,cAAc;;iBAE7B,WAAW,KAAK,cAAc,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAC5D;gBACA,0BAAO,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,GAAM;aACxE;iBAAM;;;gBAGL,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;gBAC3D,eAAe,wCAAE,MAAM,MAAoD,CAAC;gBAC5E,OAAO,MAAM,CAAC;aACf;SACF,CAAA,CAAC;QACF,2BAA2B,GAAG,IAAI,CAAC;KACpC,EAAC;CACH;;IArCK,yBAAyB,GAAG,QAqC9B;;;;AAQJ,yBAEC;;;IADC,6BAAwB;;;;;AAG1B,kDAUC;;;IARC,oDAAmB;;IAEnB,oDAAmB;;IAEnB,mDAAkB;;IAElB,mDAAkB;;;;;;;AAIpB,8BAGC;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "../../node_modules/ng-packagr/package.schema.json",
3
3
  "name": "@ngxs/store",
4
- "version": "3.7.4-dev.master-a69f8cc",
4
+ "version": "3.7.4-dev.master-310a613",
5
5
  "license": "MIT",
6
6
  "sideEffects": true,
7
7
  "peerDependencies": {