@ngxs/router-plugin 3.7.4 → 3.7.5

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ngxs/store'), require('@angular/router'), require('@angular/common'), require('@ngxs/store/internals'), require('rxjs'), require('rxjs/operators')) :
3
- typeof define === 'function' && define.amd ? define('@ngxs/router-plugin', ['exports', '@angular/core', '@ngxs/store', '@angular/router', '@angular/common', '@ngxs/store/internals', 'rxjs', 'rxjs/operators'], factory) :
4
- (global = global || self, factory((global.ngxs = global.ngxs || {}, global.ngxs['router-plugin'] = {}), global.ng.core, global['ngxs-store'], global.ng.router, global.ng.common, global['ngxs-store-internals'], global.rxjs, global.rxjs.operators));
5
- }(this, function (exports, core, store, router, common, internals, rxjs, operators) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ngxs/store'), require('@angular/router'), require('rxjs')) :
3
+ typeof define === 'function' && define.amd ? define('@ngxs/router-plugin', ['exports', '@angular/core', '@ngxs/store', '@angular/router', 'rxjs'], factory) :
4
+ (global = global || self, factory((global.ngxs = global.ngxs || {}, global.ngxs['router-plugin'] = {}), global.ng.core, global['ngxs-store'], global.ng.router, global.rxjs));
5
+ }(this, function (exports, core, store, router, rxjs) { 'use strict';
6
6
 
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -223,862 +223,759 @@
223
223
  return value;
224
224
  }
225
225
 
226
- /**
227
- * @fileoverview added by tsickle
228
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
229
- */
230
- /**
231
- * Public event api of the router
232
- */
233
- var /**
234
- * Public event api of the router
235
- */
236
- Navigate = /** @class */ (function () {
237
- function Navigate(path, queryParams, extras) {
238
- this.path = path;
239
- this.queryParams = queryParams;
240
- this.extras = extras;
241
- }
242
- Object.defineProperty(Navigate, "type", {
243
- get: /**
244
- * @return {?}
245
- */
246
- function () {
247
- // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
248
- return '[Router] Navigate';
249
- },
250
- enumerable: true,
251
- configurable: true
252
- });
253
- return Navigate;
254
- }());
255
- if (false) {
256
- /** @type {?} */
257
- Navigate.prototype.path;
258
- /** @type {?} */
259
- Navigate.prototype.queryParams;
260
- /** @type {?} */
261
- Navigate.prototype.extras;
262
- }
263
- /**
264
- *
265
- * Angular Routers internal state events
266
- *
267
- */
268
- /**
269
- * An action dispatched when the router navigates.
270
- * @template T
271
- */
272
- var /**
273
- *
274
- * Angular Routers internal state events
275
- *
276
- */
277
- /**
278
- * An action dispatched when the router navigates.
279
- * @template T
280
- */
281
- RouterNavigation = /** @class */ (function () {
282
- function RouterNavigation(routerState, event, trigger) {
283
- if (trigger === void 0) { trigger = 'none'; }
284
- this.routerState = routerState;
285
- this.event = event;
286
- this.trigger = trigger;
287
- }
288
- Object.defineProperty(RouterNavigation, "type", {
289
- get: /**
290
- * @return {?}
291
- */
292
- function () {
293
- // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
294
- return '[Router] RouterNavigation';
295
- },
296
- enumerable: true,
297
- configurable: true
298
- });
299
- return RouterNavigation;
300
- }());
301
- if (false) {
302
- /** @type {?} */
303
- RouterNavigation.prototype.routerState;
304
- /** @type {?} */
305
- RouterNavigation.prototype.event;
306
- /** @type {?} */
307
- RouterNavigation.prototype.trigger;
308
- }
309
- /**
310
- * An action dispatched when the router cancel navigation.
311
- * @template T, V
312
- */
313
- var /**
314
- * An action dispatched when the router cancel navigation.
315
- * @template T, V
316
- */
317
- RouterCancel = /** @class */ (function () {
318
- function RouterCancel(routerState, storeState, event, trigger) {
319
- if (trigger === void 0) { trigger = 'none'; }
320
- this.routerState = routerState;
321
- this.storeState = storeState;
322
- this.event = event;
323
- this.trigger = trigger;
324
- }
325
- Object.defineProperty(RouterCancel, "type", {
326
- get: /**
327
- * @return {?}
328
- */
329
- function () {
330
- // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
331
- return '[Router] RouterCancel';
332
- },
333
- enumerable: true,
334
- configurable: true
335
- });
336
- return RouterCancel;
337
- }());
338
- if (false) {
339
- /** @type {?} */
340
- RouterCancel.prototype.routerState;
341
- /** @type {?} */
342
- RouterCancel.prototype.storeState;
343
- /** @type {?} */
344
- RouterCancel.prototype.event;
345
- /** @type {?} */
346
- RouterCancel.prototype.trigger;
347
- }
348
- /**
349
- * An action dispatched when the router errors.
350
- * @template T, V
351
- */
352
- var /**
353
- * An action dispatched when the router errors.
354
- * @template T, V
355
- */
356
- RouterError = /** @class */ (function () {
357
- function RouterError(routerState, storeState, event, trigger) {
358
- if (trigger === void 0) { trigger = 'none'; }
359
- this.routerState = routerState;
360
- this.storeState = storeState;
361
- this.event = event;
362
- this.trigger = trigger;
363
- }
364
- Object.defineProperty(RouterError, "type", {
365
- get: /**
366
- * @return {?}
367
- */
368
- function () {
369
- // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
370
- return '[Router] RouterError';
371
- },
372
- enumerable: true,
373
- configurable: true
374
- });
375
- return RouterError;
376
- }());
377
- if (false) {
378
- /** @type {?} */
379
- RouterError.prototype.routerState;
380
- /** @type {?} */
381
- RouterError.prototype.storeState;
382
- /** @type {?} */
383
- RouterError.prototype.event;
384
- /** @type {?} */
385
- RouterError.prototype.trigger;
386
- }
387
- /**
388
- * An action dispatched when the `ResolveEnd` event is triggered.
389
- * @template T
390
- */
391
- var /**
392
- * An action dispatched when the `ResolveEnd` event is triggered.
393
- * @template T
394
- */
395
- RouterDataResolved = /** @class */ (function () {
396
- function RouterDataResolved(routerState, event, trigger) {
397
- if (trigger === void 0) { trigger = 'none'; }
398
- this.routerState = routerState;
399
- this.event = event;
400
- this.trigger = trigger;
401
- }
402
- Object.defineProperty(RouterDataResolved, "type", {
403
- get: /**
404
- * @return {?}
405
- */
406
- function () {
407
- // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
408
- return '[Router] RouterDataResolved';
409
- },
410
- enumerable: true,
411
- configurable: true
412
- });
413
- return RouterDataResolved;
414
- }());
415
- if (false) {
416
- /** @type {?} */
417
- RouterDataResolved.prototype.routerState;
418
- /** @type {?} */
419
- RouterDataResolved.prototype.event;
420
- /** @type {?} */
421
- RouterDataResolved.prototype.trigger;
226
+ /**
227
+ * @fileoverview added by tsickle
228
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
229
+ */
230
+ /**
231
+ * Public event api of the router
232
+ */
233
+ var /**
234
+ * Public event api of the router
235
+ */
236
+ Navigate = /** @class */ (function () {
237
+ function Navigate(path, queryParams, extras) {
238
+ this.path = path;
239
+ this.queryParams = queryParams;
240
+ this.extras = extras;
241
+ }
242
+ Object.defineProperty(Navigate, "type", {
243
+ get: /**
244
+ * @return {?}
245
+ */
246
+ function () {
247
+ // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
248
+ return '[Router] Navigate';
249
+ },
250
+ enumerable: true,
251
+ configurable: true
252
+ });
253
+ return Navigate;
254
+ }());
255
+ if (false) {
256
+ /** @type {?} */
257
+ Navigate.prototype.path;
258
+ /** @type {?} */
259
+ Navigate.prototype.queryParams;
260
+ /** @type {?} */
261
+ Navigate.prototype.extras;
262
+ }
263
+ /**
264
+ *
265
+ * Angular Routers internal state events
266
+ *
267
+ */
268
+ /**
269
+ * An action dispatched when the router navigates.
270
+ * @template T
271
+ */
272
+ var /**
273
+ *
274
+ * Angular Routers internal state events
275
+ *
276
+ */
277
+ /**
278
+ * An action dispatched when the router navigates.
279
+ * @template T
280
+ */
281
+ RouterNavigation = /** @class */ (function () {
282
+ function RouterNavigation(routerState, event, trigger) {
283
+ if (trigger === void 0) { trigger = 'none'; }
284
+ this.routerState = routerState;
285
+ this.event = event;
286
+ this.trigger = trigger;
287
+ }
288
+ Object.defineProperty(RouterNavigation, "type", {
289
+ get: /**
290
+ * @return {?}
291
+ */
292
+ function () {
293
+ // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
294
+ return '[Router] RouterNavigation';
295
+ },
296
+ enumerable: true,
297
+ configurable: true
298
+ });
299
+ return RouterNavigation;
300
+ }());
301
+ if (false) {
302
+ /** @type {?} */
303
+ RouterNavigation.prototype.routerState;
304
+ /** @type {?} */
305
+ RouterNavigation.prototype.event;
306
+ /** @type {?} */
307
+ RouterNavigation.prototype.trigger;
308
+ }
309
+ /**
310
+ * An action dispatched when the router cancel navigation.
311
+ * @template T, V
312
+ */
313
+ var /**
314
+ * An action dispatched when the router cancel navigation.
315
+ * @template T, V
316
+ */
317
+ RouterCancel = /** @class */ (function () {
318
+ function RouterCancel(routerState, storeState, event, trigger) {
319
+ if (trigger === void 0) { trigger = 'none'; }
320
+ this.routerState = routerState;
321
+ this.storeState = storeState;
322
+ this.event = event;
323
+ this.trigger = trigger;
324
+ }
325
+ Object.defineProperty(RouterCancel, "type", {
326
+ get: /**
327
+ * @return {?}
328
+ */
329
+ function () {
330
+ // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
331
+ return '[Router] RouterCancel';
332
+ },
333
+ enumerable: true,
334
+ configurable: true
335
+ });
336
+ return RouterCancel;
337
+ }());
338
+ if (false) {
339
+ /** @type {?} */
340
+ RouterCancel.prototype.routerState;
341
+ /** @type {?} */
342
+ RouterCancel.prototype.storeState;
343
+ /** @type {?} */
344
+ RouterCancel.prototype.event;
345
+ /** @type {?} */
346
+ RouterCancel.prototype.trigger;
347
+ }
348
+ /**
349
+ * An action dispatched when the router errors.
350
+ * @template T, V
351
+ */
352
+ var /**
353
+ * An action dispatched when the router errors.
354
+ * @template T, V
355
+ */
356
+ RouterError = /** @class */ (function () {
357
+ function RouterError(routerState, storeState, event, trigger) {
358
+ if (trigger === void 0) { trigger = 'none'; }
359
+ this.routerState = routerState;
360
+ this.storeState = storeState;
361
+ this.event = event;
362
+ this.trigger = trigger;
363
+ }
364
+ Object.defineProperty(RouterError, "type", {
365
+ get: /**
366
+ * @return {?}
367
+ */
368
+ function () {
369
+ // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
370
+ return '[Router] RouterError';
371
+ },
372
+ enumerable: true,
373
+ configurable: true
374
+ });
375
+ return RouterError;
376
+ }());
377
+ if (false) {
378
+ /** @type {?} */
379
+ RouterError.prototype.routerState;
380
+ /** @type {?} */
381
+ RouterError.prototype.storeState;
382
+ /** @type {?} */
383
+ RouterError.prototype.event;
384
+ /** @type {?} */
385
+ RouterError.prototype.trigger;
386
+ }
387
+ /**
388
+ * An action dispatched when the `ResolveEnd` event is triggered.
389
+ * @template T
390
+ */
391
+ var /**
392
+ * An action dispatched when the `ResolveEnd` event is triggered.
393
+ * @template T
394
+ */
395
+ RouterDataResolved = /** @class */ (function () {
396
+ function RouterDataResolved(routerState, event, trigger) {
397
+ if (trigger === void 0) { trigger = 'none'; }
398
+ this.routerState = routerState;
399
+ this.event = event;
400
+ this.trigger = trigger;
401
+ }
402
+ Object.defineProperty(RouterDataResolved, "type", {
403
+ get: /**
404
+ * @return {?}
405
+ */
406
+ function () {
407
+ // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
408
+ return '[Router] RouterDataResolved';
409
+ },
410
+ enumerable: true,
411
+ configurable: true
412
+ });
413
+ return RouterDataResolved;
414
+ }());
415
+ if (false) {
416
+ /** @type {?} */
417
+ RouterDataResolved.prototype.routerState;
418
+ /** @type {?} */
419
+ RouterDataResolved.prototype.event;
420
+ /** @type {?} */
421
+ RouterDataResolved.prototype.trigger;
422
422
  }
423
423
 
424
- /**
425
- * @fileoverview added by tsickle
426
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
427
- */
428
- /**
429
- * @abstract
430
- * @template T
431
- */
432
- var /**
433
- * @abstract
434
- * @template T
435
- */
436
- RouterStateSerializer = /** @class */ (function () {
437
- function RouterStateSerializer() {
438
- }
439
- return RouterStateSerializer;
440
- }());
441
- if (false) {
442
- /**
443
- * @abstract
444
- * @param {?} routerState
445
- * @return {?}
446
- */
447
- RouterStateSerializer.prototype.serialize = function (routerState) { };
448
- }
449
- /**
450
- * @record
451
- */
452
- function SerializedRouterStateSnapshot() { }
453
- if (false) {
454
- /** @type {?} */
455
- SerializedRouterStateSnapshot.prototype.root;
456
- /** @type {?} */
457
- SerializedRouterStateSnapshot.prototype.url;
458
- }
459
- var DefaultRouterStateSerializer = /** @class */ (function () {
460
- function DefaultRouterStateSerializer() {
461
- }
462
- /**
463
- * @param {?} routerState
464
- * @return {?}
465
- */
466
- DefaultRouterStateSerializer.prototype.serialize = /**
467
- * @param {?} routerState
468
- * @return {?}
469
- */
470
- function (routerState) {
471
- return {
472
- root: this.serializeRoute(routerState.root),
473
- url: routerState.url
474
- };
475
- };
476
- /**
477
- * @private
478
- * @param {?} route
479
- * @return {?}
480
- */
481
- DefaultRouterStateSerializer.prototype.serializeRoute = /**
482
- * @private
483
- * @param {?} route
484
- * @return {?}
485
- */
486
- function (route) {
487
- var _this = this;
488
- /** @type {?} */
489
- var children = route.children.map((/**
490
- * @param {?} c
491
- * @return {?}
492
- */
493
- function (c) { return _this.serializeRoute(c); }));
494
- return {
495
- url: route.url,
496
- params: route.params,
497
- queryParams: route.queryParams,
498
- fragment: route.fragment,
499
- data: route.data,
500
- outlet: route.outlet,
501
- component: null,
502
- routeConfig: null,
503
- root: (/** @type {?} */ (null)),
504
- parent: null,
505
- firstChild: children[0],
506
- children: children,
507
- pathFromRoot: (/** @type {?} */ (null)),
508
- paramMap: route.paramMap,
509
- queryParamMap: route.queryParamMap,
510
- toString: route.toString
511
- };
512
- };
513
- return DefaultRouterStateSerializer;
424
+ /**
425
+ * @fileoverview added by tsickle
426
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
427
+ */
428
+ /**
429
+ * @abstract
430
+ * @template T
431
+ */
432
+ var /**
433
+ * @abstract
434
+ * @template T
435
+ */
436
+ RouterStateSerializer = /** @class */ (function () {
437
+ function RouterStateSerializer() {
438
+ }
439
+ return RouterStateSerializer;
440
+ }());
441
+ if (false) {
442
+ /**
443
+ * @abstract
444
+ * @param {?} routerState
445
+ * @return {?}
446
+ */
447
+ RouterStateSerializer.prototype.serialize = function (routerState) { };
448
+ }
449
+ /**
450
+ * @record
451
+ */
452
+ function SerializedRouterStateSnapshot() { }
453
+ if (false) {
454
+ /** @type {?} */
455
+ SerializedRouterStateSnapshot.prototype.root;
456
+ /** @type {?} */
457
+ SerializedRouterStateSnapshot.prototype.url;
458
+ }
459
+ var DefaultRouterStateSerializer = /** @class */ (function () {
460
+ function DefaultRouterStateSerializer() {
461
+ }
462
+ /**
463
+ * @param {?} routerState
464
+ * @return {?}
465
+ */
466
+ DefaultRouterStateSerializer.prototype.serialize = /**
467
+ * @param {?} routerState
468
+ * @return {?}
469
+ */
470
+ function (routerState) {
471
+ return {
472
+ root: this.serializeRoute(routerState.root),
473
+ url: routerState.url
474
+ };
475
+ };
476
+ /**
477
+ * @private
478
+ * @param {?} route
479
+ * @return {?}
480
+ */
481
+ DefaultRouterStateSerializer.prototype.serializeRoute = /**
482
+ * @private
483
+ * @param {?} route
484
+ * @return {?}
485
+ */
486
+ function (route) {
487
+ var _this = this;
488
+ /** @type {?} */
489
+ var children = route.children.map((/**
490
+ * @param {?} c
491
+ * @return {?}
492
+ */
493
+ function (c) { return _this.serializeRoute(c); }));
494
+ return {
495
+ url: route.url,
496
+ params: route.params,
497
+ queryParams: route.queryParams,
498
+ fragment: route.fragment,
499
+ data: route.data,
500
+ outlet: route.outlet,
501
+ component: null,
502
+ routeConfig: null,
503
+ root: (/** @type {?} */ (null)),
504
+ parent: null,
505
+ firstChild: children[0],
506
+ children: children,
507
+ pathFromRoot: (/** @type {?} */ (null)),
508
+ paramMap: route.paramMap,
509
+ queryParamMap: route.queryParamMap,
510
+ toString: route.toString
511
+ };
512
+ };
513
+ return DefaultRouterStateSerializer;
514
514
  }());
515
515
 
516
- /**
517
- * @fileoverview added by tsickle
518
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
519
- */
520
- /**
521
- * @record
522
- * @template T
523
- */
524
- function RouterStateModel() { }
525
- if (false) {
526
- /** @type {?|undefined} */
527
- RouterStateModel.prototype.state;
528
- /** @type {?|undefined} */
529
- RouterStateModel.prototype.navigationId;
530
- /** @type {?} */
531
- RouterStateModel.prototype.trigger;
532
- }
533
- var RouterState = /** @class */ (function () {
534
- function RouterState(_store, _router, _serializer, _ngZone, _urlSerializer, _locationStrategy, _location) {
535
- this._store = _store;
536
- this._router = _router;
537
- this._serializer = _serializer;
538
- this._ngZone = _ngZone;
539
- this._urlSerializer = _urlSerializer;
540
- this._locationStrategy = _locationStrategy;
541
- this._location = _location;
542
- /**
543
- * Determines how navigation was performed by the `RouterState` itself
544
- * or outside via `new Navigate(...)`
545
- */
546
- this._trigger = 'none';
547
- /**
548
- * That's the serialized state from the `Router` class
549
- */
550
- this._routerState = null;
551
- /**
552
- * That's the value of the `RouterState` state
553
- */
554
- this._storeState = null;
555
- this._lastRoutesRecognized = (/** @type {?} */ (null));
556
- this._subscription = new rxjs.Subscription();
557
- this.setUpStoreListener();
558
- this.setUpRouterEventsListener();
559
- this.checkInitialNavigationOnce();
560
- }
561
- RouterState_1 = RouterState;
562
- /**
563
- * @template T
564
- * @param {?} state
565
- * @return {?}
566
- */
567
- RouterState.state = /**
568
- * @template T
569
- * @param {?} state
570
- * @return {?}
571
- */
572
- function (state) {
573
- return state && state.state;
574
- };
575
- /**
576
- * @param {?} state
577
- * @return {?}
578
- */
579
- RouterState.url = /**
580
- * @param {?} state
581
- * @return {?}
582
- */
583
- function (state) {
584
- return state && state.state && state.state.url;
585
- };
586
- /**
587
- * @return {?}
588
- */
589
- RouterState.prototype.ngOnDestroy = /**
590
- * @return {?}
591
- */
592
- function () {
593
- this._subscription.unsubscribe();
594
- };
595
- /**
596
- * @param {?} _
597
- * @param {?} action
598
- * @return {?}
599
- */
600
- RouterState.prototype.navigate = /**
601
- * @param {?} _
602
- * @param {?} action
603
- * @return {?}
604
- */
605
- function (_, action) {
606
- var _this = this;
607
- return this._ngZone.run((/**
608
- * @return {?}
609
- */
610
- function () {
611
- return _this._router.navigate(action.path, __assign({ queryParams: action.queryParams }, action.extras));
612
- }));
613
- };
614
- /**
615
- * @param {?} ctx
616
- * @param {?} action
617
- * @return {?}
618
- */
619
- RouterState.prototype.angularRouterAction = /**
620
- * @param {?} ctx
621
- * @param {?} action
622
- * @return {?}
623
- */
624
- function (ctx, action) {
625
- ctx.setState(__assign({}, ctx.getState(), { trigger: action.trigger, state: action.routerState, navigationId: action.event.id }));
626
- };
627
- /**
628
- * @private
629
- * @return {?}
630
- */
631
- RouterState.prototype.setUpStoreListener = /**
632
- * @private
633
- * @return {?}
634
- */
635
- function () {
636
- var _this = this;
637
- /** @type {?} */
638
- var subscription = this._store
639
- .select(RouterState_1)
640
- .subscribe((/**
641
- * @param {?} state
642
- * @return {?}
643
- */
644
- function (state) {
645
- _this.navigateIfNeeded(state);
646
- }));
647
- this._subscription.add(subscription);
648
- };
649
- /**
650
- * @private
651
- * @return {?}
652
- */
653
- RouterState.prototype.setUpRouterEventsListener = /**
654
- * @private
655
- * @return {?}
656
- */
657
- function () {
658
- var _this = this;
659
- /** @type {?} */
660
- var subscription = this._router.events.subscribe((/**
661
- * @param {?} event
662
- * @return {?}
663
- */
664
- function (event) {
665
- if (event instanceof router.NavigationStart) {
666
- _this.navigationStart();
667
- }
668
- else if (event instanceof router.RoutesRecognized) {
669
- _this._lastRoutesRecognized = event;
670
- }
671
- else if (event instanceof router.ResolveEnd) {
672
- _this.dispatchRouterDataResolved(event);
673
- }
674
- else if (event instanceof router.NavigationCancel) {
675
- _this.dispatchRouterCancel(event);
676
- _this.reset();
677
- }
678
- else if (event instanceof router.NavigationError) {
679
- _this.dispatchRouterError(event);
680
- _this.reset();
681
- }
682
- else if (event instanceof router.NavigationEnd) {
683
- _this.navigationEnd();
684
- _this.reset();
685
- }
686
- }));
687
- this._subscription.add(subscription);
688
- };
689
- /**
690
- * @private
691
- * @return {?}
692
- */
693
- RouterState.prototype.navigationStart = /**
694
- * @private
695
- * @return {?}
696
- */
697
- function () {
698
- this._routerState = this._serializer.serialize(this._router.routerState.snapshot);
699
- if (this._trigger !== 'none') {
700
- this._storeState = this._store.selectSnapshot(RouterState_1);
701
- }
702
- };
703
- /**
704
- * @private
705
- * @return {?}
706
- */
707
- RouterState.prototype.navigationEnd = /**
708
- * @private
709
- * @return {?}
710
- */
711
- function () {
712
- if (this.shouldDispatchRouterNavigation()) {
713
- this.dispatchRouterNavigation();
714
- }
715
- };
716
- /**
717
- * @private
718
- * @return {?}
719
- */
720
- RouterState.prototype.shouldDispatchRouterNavigation = /**
721
- * @private
722
- * @return {?}
723
- */
724
- function () {
725
- if (!this._storeState)
726
- return true;
727
- return this._trigger !== 'store';
728
- };
729
- /**
730
- * @private
731
- * @param {?} state
732
- * @return {?}
733
- */
734
- RouterState.prototype.navigateIfNeeded = /**
735
- * @private
736
- * @param {?} state
737
- * @return {?}
738
- */
739
- function (state) {
740
- var _this = this;
741
- /** @type {?} */
742
- var canSkipNavigation = !this._storeState ||
743
- !this._storeState.state ||
744
- !state ||
745
- state.trigger === 'router' ||
746
- this._router.url === this._storeState.state.url;
747
- if (canSkipNavigation) {
748
- return;
749
- }
750
- this._trigger = 'store';
751
- this._ngZone.run((/**
752
- * @return {?}
753
- */
754
- function () {
755
- _this._router.navigateByUrl((/** @type {?} */ ((/** @type {?} */ (_this._storeState)).state)).url);
756
- }));
757
- };
758
- /**
759
- * @private
760
- * @return {?}
761
- */
762
- RouterState.prototype.dispatchRouterNavigation = /**
763
- * @private
764
- * @return {?}
765
- */
766
- function () {
767
- /** @type {?} */
768
- var nextRouterState = this._serializer.serialize(this._lastRoutesRecognized.state);
769
- this.dispatchRouterAction(new RouterNavigation(nextRouterState, new router.RoutesRecognized(this._lastRoutesRecognized.id, this._lastRoutesRecognized.url, this._lastRoutesRecognized.urlAfterRedirects, nextRouterState), this._trigger));
770
- };
771
- /**
772
- * @private
773
- * @param {?} event
774
- * @return {?}
775
- */
776
- RouterState.prototype.dispatchRouterCancel = /**
777
- * @private
778
- * @param {?} event
779
- * @return {?}
780
- */
781
- function (event) {
782
- this.dispatchRouterAction(new RouterCancel((/** @type {?} */ (this._routerState)), this._storeState, event, this._trigger));
783
- };
784
- /**
785
- * @private
786
- * @param {?} event
787
- * @return {?}
788
- */
789
- RouterState.prototype.dispatchRouterError = /**
790
- * @private
791
- * @param {?} event
792
- * @return {?}
793
- */
794
- function (event) {
795
- this.dispatchRouterAction(new RouterError((/** @type {?} */ (this._routerState)), this._storeState, new router.NavigationError(event.id, event.url, "" + event), this._trigger));
796
- };
797
- /**
798
- * @private
799
- * @template T
800
- * @param {?} action
801
- * @return {?}
802
- */
803
- RouterState.prototype.dispatchRouterAction = /**
804
- * @private
805
- * @template T
806
- * @param {?} action
807
- * @return {?}
808
- */
809
- function (action) {
810
- this._trigger = 'router';
811
- try {
812
- this._store.dispatch(action);
813
- }
814
- finally {
815
- this._trigger = 'none';
816
- }
817
- };
818
- /**
819
- * @private
820
- * @param {?} event
821
- * @return {?}
822
- */
823
- RouterState.prototype.dispatchRouterDataResolved = /**
824
- * @private
825
- * @param {?} event
826
- * @return {?}
827
- */
828
- function (event) {
829
- /** @type {?} */
830
- var routerState = this._serializer.serialize(event.state);
831
- this.dispatchRouterAction(new RouterDataResolved(routerState, event, this._trigger));
832
- };
833
- /**
834
- * @private
835
- * @return {?}
836
- */
837
- RouterState.prototype.reset = /**
838
- * @private
839
- * @return {?}
840
- */
841
- function () {
842
- this._trigger = 'none';
843
- this._storeState = null;
844
- this._routerState = null;
845
- };
846
- /**
847
- * No sense to mess up the `setUpRouterEventsListener` method as we have
848
- * to perform this check only once and unsubscribe after the first event
849
- * is triggered
850
- */
851
- /**
852
- * No sense to mess up the `setUpRouterEventsListener` method as we have
853
- * to perform this check only once and unsubscribe after the first event
854
- * is triggered
855
- * @private
856
- * @return {?}
857
- */
858
- RouterState.prototype.checkInitialNavigationOnce = /**
859
- * No sense to mess up the `setUpRouterEventsListener` method as we have
860
- * to perform this check only once and unsubscribe after the first event
861
- * is triggered
862
- * @private
863
- * @return {?}
864
- */
865
- function () {
866
- var _this = this;
867
- // Caretaker note: we have still left the `typeof` condition in order to avoid
868
- // creating a breaking change for projects that still use the View Engine.
869
- if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
870
- // Angular is running tests in development mode thus we can be sure that this method will be
871
- // skipped in tests.
872
- internals.isAngularInTestMode()) {
873
- return;
874
- }
875
- /** @type {?} */
876
- var subscription = this._router.events
877
- .pipe(operators.first((/**
878
- * @param {?} event
879
- * @return {?}
880
- */
881
- function (event) { return event instanceof router.RoutesRecognized; })))
882
- .subscribe((/**
883
- * @param {?} __0
884
- * @return {?}
885
- */
886
- function (_a) {
887
- // `location.pathname` always equals manually entered URL in the address bar
888
- // e.g. `location.pathname === '/foo'`, but the `router` state has been initialized
889
- // with another URL (e.g. used in combination with `NgxsStoragePlugin`), thus the
890
- // `RouterNavigation` action will be dispatched and the user will be redirected to the
891
- // previously saved URL. We want to prevent such behavior, so we perform this check
892
- var url = _a.url;
893
- // `location.pathname` always equals manually entered URL in the address bar
894
- // e.g. `location.pathname === '/foo'`, but the `router` state has been initialized
895
- // with another URL (e.g. used in combination with `NgxsStoragePlugin`), thus the
896
- // `RouterNavigation` action will be dispatched and the user will be redirected to the
897
- // previously saved URL. We want to prevent such behavior, so we perform this check
898
- // `url` is a recognized URL by the Angular's router, while `currentUrl` is an actual URL
899
- // entered in the browser's address bar
900
- // `PathLocationStrategy.prototype.path()` returns a concatenation of
901
- // `PlatformLocation.pathname` and normalized `PlatformLocation.search`.
902
- // `Location.prototype.normalize` strips base href from the URL,
903
- // if `baseHref` (declared in angular.json) for example is `/en`
904
- // and the URL is `/test#anchor` - then `_locationStrategy.path(true)` will return `/en/test#anchor`,
905
- // but `/en/test#anchor` is not known to the Angular's router, so we have to strip `/en`
906
- // from the URL
907
- /** @type {?} */
908
- var currentUrl = _this._location.normalize(_this._locationStrategy.path(true));
909
- /** @type {?} */
910
- var currentUrlTree = _this._urlSerializer.parse(currentUrl);
911
- // We need to serialize the URL because in that example `/test/?redirect=https://google.com/`
912
- // Angular will recognize it as `/test?redirect=https:%2F%2Fwww.google.com%2F`
913
- // so we have to run the `currentUrl` via the `UrlSerializer` that will encode characters
914
- /** @type {?} */
915
- var currentSerializedUrl = _this._urlSerializer.serialize(currentUrlTree);
916
- // If URLs differ from each other - we've got to perform a redirect to the manually entered URL
917
- // in the address bar, as it must have a priority
918
- if (currentSerializedUrl !== url) {
919
- _this._router.navigateByUrl(currentUrl);
920
- }
921
- }));
922
- this._subscription.add(subscription);
923
- };
924
- var RouterState_1;
925
- RouterState.ctorParameters = function () { return [
926
- { type: store.Store },
927
- { type: router.Router },
928
- { type: RouterStateSerializer },
929
- { type: core.NgZone },
930
- { type: router.UrlSerializer },
931
- { type: common.LocationStrategy },
932
- { type: common.Location }
933
- ]; };
934
- RouterState.decorators = [
935
- { type: core.Injectable }
936
- ];
937
- /** @nocollapse */
938
- RouterState.ctorParameters = function () { return [
939
- { type: store.Store },
940
- { type: router.Router },
941
- { type: RouterStateSerializer },
942
- { type: core.NgZone },
943
- { type: router.UrlSerializer },
944
- { type: common.LocationStrategy },
945
- { type: common.Location }
946
- ]; };
947
- __decorate([
948
- store.Action(Navigate),
949
- __metadata("design:type", Function),
950
- __metadata("design:paramtypes", [Object, Navigate]),
951
- __metadata("design:returntype", void 0)
952
- ], RouterState.prototype, "navigate", null);
953
- __decorate([
954
- store.Action([RouterNavigation, RouterError, RouterCancel, RouterDataResolved]),
955
- __metadata("design:type", Function),
956
- __metadata("design:paramtypes", [Object, Object]),
957
- __metadata("design:returntype", void 0)
958
- ], RouterState.prototype, "angularRouterAction", null);
959
- __decorate([
960
- store.Selector(),
961
- __metadata("design:type", Function),
962
- __metadata("design:paramtypes", [Object]),
963
- __metadata("design:returntype", void 0)
964
- ], RouterState, "state", null);
965
- __decorate([
966
- store.Selector(),
967
- __metadata("design:type", Function),
968
- __metadata("design:paramtypes", [Object]),
969
- __metadata("design:returntype", Object)
970
- ], RouterState, "url", null);
971
- RouterState = RouterState_1 = __decorate([
972
- store.State({
973
- name: 'router',
974
- defaults: {
975
- state: undefined,
976
- navigationId: undefined,
977
- trigger: 'none'
978
- }
979
- }),
980
- __metadata("design:paramtypes", [store.Store,
981
- router.Router,
982
- RouterStateSerializer,
983
- core.NgZone,
984
- router.UrlSerializer,
985
- common.LocationStrategy,
986
- common.Location])
987
- ], RouterState);
988
- return RouterState;
989
- }());
990
- if (false) {
991
- /**
992
- * Determines how navigation was performed by the `RouterState` itself
993
- * or outside via `new Navigate(...)`
994
- * @type {?}
995
- * @private
996
- */
997
- RouterState.prototype._trigger;
998
- /**
999
- * That's the serialized state from the `Router` class
1000
- * @type {?}
1001
- * @private
1002
- */
1003
- RouterState.prototype._routerState;
1004
- /**
1005
- * That's the value of the `RouterState` state
1006
- * @type {?}
1007
- * @private
1008
- */
1009
- RouterState.prototype._storeState;
1010
- /**
1011
- * @type {?}
1012
- * @private
1013
- */
1014
- RouterState.prototype._lastRoutesRecognized;
1015
- /**
1016
- * @type {?}
1017
- * @private
1018
- */
1019
- RouterState.prototype._subscription;
1020
- /**
1021
- * @type {?}
1022
- * @private
1023
- */
1024
- RouterState.prototype._store;
1025
- /**
1026
- * @type {?}
1027
- * @private
1028
- */
1029
- RouterState.prototype._router;
1030
- /**
1031
- * @type {?}
1032
- * @private
1033
- */
1034
- RouterState.prototype._serializer;
1035
- /**
1036
- * @type {?}
1037
- * @private
1038
- */
1039
- RouterState.prototype._ngZone;
1040
- /**
1041
- * @type {?}
1042
- * @private
1043
- */
1044
- RouterState.prototype._urlSerializer;
1045
- /**
1046
- * @type {?}
1047
- * @private
1048
- */
1049
- RouterState.prototype._locationStrategy;
1050
- /**
1051
- * @type {?}
1052
- * @private
1053
- */
1054
- RouterState.prototype._location;
516
+ /**
517
+ * @fileoverview added by tsickle
518
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
519
+ */
520
+ /**
521
+ * @record
522
+ * @template T
523
+ */
524
+ function RouterStateModel() { }
525
+ if (false) {
526
+ /** @type {?|undefined} */
527
+ RouterStateModel.prototype.state;
528
+ /** @type {?|undefined} */
529
+ RouterStateModel.prototype.navigationId;
530
+ /** @type {?} */
531
+ RouterStateModel.prototype.trigger;
532
+ }
533
+ var RouterState = /** @class */ (function () {
534
+ function RouterState(_store, _router, _serializer, _ngZone) {
535
+ this._store = _store;
536
+ this._router = _router;
537
+ this._serializer = _serializer;
538
+ this._ngZone = _ngZone;
539
+ /**
540
+ * Determines how navigation was performed by the `RouterState` itself
541
+ * or outside via `new Navigate(...)`
542
+ */
543
+ this._trigger = 'none';
544
+ /**
545
+ * That's the serialized state from the `Router` class
546
+ */
547
+ this._routerState = null;
548
+ /**
549
+ * That's the value of the `RouterState` state
550
+ */
551
+ this._storeState = null;
552
+ this._lastRoutesRecognized = (/** @type {?} */ (null));
553
+ this._subscription = new rxjs.Subscription();
554
+ this.setUpStoreListener();
555
+ this.setUpRouterEventsListener();
556
+ }
557
+ RouterState_1 = RouterState;
558
+ /**
559
+ * @template T
560
+ * @param {?} state
561
+ * @return {?}
562
+ */
563
+ RouterState.state = /**
564
+ * @template T
565
+ * @param {?} state
566
+ * @return {?}
567
+ */
568
+ function (state) {
569
+ return state && state.state;
570
+ };
571
+ /**
572
+ * @param {?} state
573
+ * @return {?}
574
+ */
575
+ RouterState.url = /**
576
+ * @param {?} state
577
+ * @return {?}
578
+ */
579
+ function (state) {
580
+ return state && state.state && state.state.url;
581
+ };
582
+ /**
583
+ * @return {?}
584
+ */
585
+ RouterState.prototype.ngOnDestroy = /**
586
+ * @return {?}
587
+ */
588
+ function () {
589
+ this._subscription.unsubscribe();
590
+ };
591
+ /**
592
+ * @param {?} _
593
+ * @param {?} action
594
+ * @return {?}
595
+ */
596
+ RouterState.prototype.navigate = /**
597
+ * @param {?} _
598
+ * @param {?} action
599
+ * @return {?}
600
+ */
601
+ function (_, action) {
602
+ var _this = this;
603
+ return this._ngZone.run((/**
604
+ * @return {?}
605
+ */
606
+ function () {
607
+ return _this._router.navigate(action.path, __assign({ queryParams: action.queryParams }, action.extras));
608
+ }));
609
+ };
610
+ /**
611
+ * @param {?} ctx
612
+ * @param {?} action
613
+ * @return {?}
614
+ */
615
+ RouterState.prototype.angularRouterAction = /**
616
+ * @param {?} ctx
617
+ * @param {?} action
618
+ * @return {?}
619
+ */
620
+ function (ctx, action) {
621
+ ctx.setState(__assign({}, ctx.getState(), { trigger: action.trigger, state: action.routerState, navigationId: action.event.id }));
622
+ };
623
+ /**
624
+ * @private
625
+ * @return {?}
626
+ */
627
+ RouterState.prototype.setUpStoreListener = /**
628
+ * @private
629
+ * @return {?}
630
+ */
631
+ function () {
632
+ var _this = this;
633
+ /** @type {?} */
634
+ var subscription = this._store
635
+ .select(RouterState_1)
636
+ .subscribe((/**
637
+ * @param {?} state
638
+ * @return {?}
639
+ */
640
+ function (state) {
641
+ _this.navigateIfNeeded(state);
642
+ }));
643
+ this._subscription.add(subscription);
644
+ };
645
+ /**
646
+ * @private
647
+ * @return {?}
648
+ */
649
+ RouterState.prototype.setUpRouterEventsListener = /**
650
+ * @private
651
+ * @return {?}
652
+ */
653
+ function () {
654
+ var _this = this;
655
+ /** @type {?} */
656
+ var subscription = this._router.events.subscribe((/**
657
+ * @param {?} event
658
+ * @return {?}
659
+ */
660
+ function (event) {
661
+ if (event instanceof router.NavigationStart) {
662
+ _this.navigationStart();
663
+ }
664
+ else if (event instanceof router.RoutesRecognized) {
665
+ _this._lastRoutesRecognized = event;
666
+ }
667
+ else if (event instanceof router.ResolveEnd) {
668
+ _this.dispatchRouterDataResolved(event);
669
+ }
670
+ else if (event instanceof router.NavigationCancel) {
671
+ _this.dispatchRouterCancel(event);
672
+ _this.reset();
673
+ }
674
+ else if (event instanceof router.NavigationError) {
675
+ _this.dispatchRouterError(event);
676
+ _this.reset();
677
+ }
678
+ else if (event instanceof router.NavigationEnd) {
679
+ _this.navigationEnd();
680
+ _this.reset();
681
+ }
682
+ }));
683
+ this._subscription.add(subscription);
684
+ };
685
+ /**
686
+ * @private
687
+ * @return {?}
688
+ */
689
+ RouterState.prototype.navigationStart = /**
690
+ * @private
691
+ * @return {?}
692
+ */
693
+ function () {
694
+ this._routerState = this._serializer.serialize(this._router.routerState.snapshot);
695
+ if (this._trigger !== 'none') {
696
+ this._storeState = this._store.selectSnapshot(RouterState_1);
697
+ }
698
+ };
699
+ /**
700
+ * @private
701
+ * @return {?}
702
+ */
703
+ RouterState.prototype.navigationEnd = /**
704
+ * @private
705
+ * @return {?}
706
+ */
707
+ function () {
708
+ if (this.shouldDispatchRouterNavigation()) {
709
+ this.dispatchRouterNavigation();
710
+ }
711
+ };
712
+ /**
713
+ * @private
714
+ * @return {?}
715
+ */
716
+ RouterState.prototype.shouldDispatchRouterNavigation = /**
717
+ * @private
718
+ * @return {?}
719
+ */
720
+ function () {
721
+ if (!this._storeState)
722
+ return true;
723
+ return this._trigger !== 'store';
724
+ };
725
+ /**
726
+ * @private
727
+ * @param {?} state
728
+ * @return {?}
729
+ */
730
+ RouterState.prototype.navigateIfNeeded = /**
731
+ * @private
732
+ * @param {?} state
733
+ * @return {?}
734
+ */
735
+ function (state) {
736
+ var _this = this;
737
+ if (state && state.trigger === 'devtools') {
738
+ this._storeState = this._store.selectSnapshot(RouterState_1);
739
+ }
740
+ /** @type {?} */
741
+ var canSkipNavigation = !this._storeState ||
742
+ !this._storeState.state ||
743
+ !state ||
744
+ state.trigger === 'router' ||
745
+ this._router.url === this._storeState.state.url;
746
+ if (canSkipNavigation) {
747
+ return;
748
+ }
749
+ this._trigger = 'store';
750
+ this._ngZone.run((/**
751
+ * @return {?}
752
+ */
753
+ function () {
754
+ _this._router.navigateByUrl((/** @type {?} */ ((/** @type {?} */ (_this._storeState)).state)).url);
755
+ }));
756
+ };
757
+ /**
758
+ * @private
759
+ * @return {?}
760
+ */
761
+ RouterState.prototype.dispatchRouterNavigation = /**
762
+ * @private
763
+ * @return {?}
764
+ */
765
+ function () {
766
+ /** @type {?} */
767
+ var nextRouterState = this._serializer.serialize(this._lastRoutesRecognized.state);
768
+ this.dispatchRouterAction(new RouterNavigation(nextRouterState, new router.RoutesRecognized(this._lastRoutesRecognized.id, this._lastRoutesRecognized.url, this._lastRoutesRecognized.urlAfterRedirects, nextRouterState), this._trigger));
769
+ };
770
+ /**
771
+ * @private
772
+ * @param {?} event
773
+ * @return {?}
774
+ */
775
+ RouterState.prototype.dispatchRouterCancel = /**
776
+ * @private
777
+ * @param {?} event
778
+ * @return {?}
779
+ */
780
+ function (event) {
781
+ this.dispatchRouterAction(new RouterCancel((/** @type {?} */ (this._routerState)), this._storeState, event, this._trigger));
782
+ };
783
+ /**
784
+ * @private
785
+ * @param {?} event
786
+ * @return {?}
787
+ */
788
+ RouterState.prototype.dispatchRouterError = /**
789
+ * @private
790
+ * @param {?} event
791
+ * @return {?}
792
+ */
793
+ function (event) {
794
+ this.dispatchRouterAction(new RouterError((/** @type {?} */ (this._routerState)), this._storeState, new router.NavigationError(event.id, event.url, "" + event), this._trigger));
795
+ };
796
+ /**
797
+ * @private
798
+ * @template T
799
+ * @param {?} action
800
+ * @return {?}
801
+ */
802
+ RouterState.prototype.dispatchRouterAction = /**
803
+ * @private
804
+ * @template T
805
+ * @param {?} action
806
+ * @return {?}
807
+ */
808
+ function (action) {
809
+ this._trigger = 'router';
810
+ try {
811
+ this._store.dispatch(action);
812
+ }
813
+ finally {
814
+ this._trigger = 'none';
815
+ }
816
+ };
817
+ /**
818
+ * @private
819
+ * @param {?} event
820
+ * @return {?}
821
+ */
822
+ RouterState.prototype.dispatchRouterDataResolved = /**
823
+ * @private
824
+ * @param {?} event
825
+ * @return {?}
826
+ */
827
+ function (event) {
828
+ /** @type {?} */
829
+ var routerState = this._serializer.serialize(event.state);
830
+ this.dispatchRouterAction(new RouterDataResolved(routerState, event, this._trigger));
831
+ };
832
+ /**
833
+ * @private
834
+ * @return {?}
835
+ */
836
+ RouterState.prototype.reset = /**
837
+ * @private
838
+ * @return {?}
839
+ */
840
+ function () {
841
+ this._trigger = 'none';
842
+ this._storeState = null;
843
+ this._routerState = null;
844
+ };
845
+ var RouterState_1;
846
+ RouterState.ctorParameters = function () { return [
847
+ { type: store.Store },
848
+ { type: router.Router },
849
+ { type: RouterStateSerializer },
850
+ { type: core.NgZone }
851
+ ]; };
852
+ RouterState.decorators = [
853
+ { type: core.Injectable }
854
+ ];
855
+ /** @nocollapse */
856
+ RouterState.ctorParameters = function () { return [
857
+ { type: store.Store },
858
+ { type: router.Router },
859
+ { type: RouterStateSerializer },
860
+ { type: core.NgZone }
861
+ ]; };
862
+ __decorate([
863
+ store.Action(Navigate),
864
+ __metadata("design:type", Function),
865
+ __metadata("design:paramtypes", [Object, Navigate]),
866
+ __metadata("design:returntype", void 0)
867
+ ], RouterState.prototype, "navigate", null);
868
+ __decorate([
869
+ store.Action([RouterNavigation, RouterError, RouterCancel, RouterDataResolved]),
870
+ __metadata("design:type", Function),
871
+ __metadata("design:paramtypes", [Object, Object]),
872
+ __metadata("design:returntype", void 0)
873
+ ], RouterState.prototype, "angularRouterAction", null);
874
+ __decorate([
875
+ store.Selector(),
876
+ __metadata("design:type", Function),
877
+ __metadata("design:paramtypes", [Object]),
878
+ __metadata("design:returntype", void 0)
879
+ ], RouterState, "state", null);
880
+ __decorate([
881
+ store.Selector(),
882
+ __metadata("design:type", Function),
883
+ __metadata("design:paramtypes", [Object]),
884
+ __metadata("design:returntype", Object)
885
+ ], RouterState, "url", null);
886
+ RouterState = RouterState_1 = __decorate([
887
+ store.State({
888
+ name: 'router',
889
+ defaults: {
890
+ state: undefined,
891
+ navigationId: undefined,
892
+ trigger: 'none'
893
+ }
894
+ }),
895
+ __metadata("design:paramtypes", [store.Store,
896
+ router.Router,
897
+ RouterStateSerializer,
898
+ core.NgZone])
899
+ ], RouterState);
900
+ return RouterState;
901
+ }());
902
+ if (false) {
903
+ /**
904
+ * Determines how navigation was performed by the `RouterState` itself
905
+ * or outside via `new Navigate(...)`
906
+ * @type {?}
907
+ * @private
908
+ */
909
+ RouterState.prototype._trigger;
910
+ /**
911
+ * That's the serialized state from the `Router` class
912
+ * @type {?}
913
+ * @private
914
+ */
915
+ RouterState.prototype._routerState;
916
+ /**
917
+ * That's the value of the `RouterState` state
918
+ * @type {?}
919
+ * @private
920
+ */
921
+ RouterState.prototype._storeState;
922
+ /**
923
+ * @type {?}
924
+ * @private
925
+ */
926
+ RouterState.prototype._lastRoutesRecognized;
927
+ /**
928
+ * @type {?}
929
+ * @private
930
+ */
931
+ RouterState.prototype._subscription;
932
+ /**
933
+ * @type {?}
934
+ * @private
935
+ */
936
+ RouterState.prototype._store;
937
+ /**
938
+ * @type {?}
939
+ * @private
940
+ */
941
+ RouterState.prototype._router;
942
+ /**
943
+ * @type {?}
944
+ * @private
945
+ */
946
+ RouterState.prototype._serializer;
947
+ /**
948
+ * @type {?}
949
+ * @private
950
+ */
951
+ RouterState.prototype._ngZone;
1055
952
  }
1056
953
 
1057
- /**
1058
- * @fileoverview added by tsickle
1059
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1060
- */
1061
- var NgxsRouterPluginModule = /** @class */ (function () {
1062
- function NgxsRouterPluginModule() {
1063
- }
1064
- /**
1065
- * @return {?}
1066
- */
1067
- NgxsRouterPluginModule.forRoot = /**
1068
- * @return {?}
1069
- */
1070
- function () {
1071
- return {
1072
- ngModule: NgxsRouterPluginModule,
1073
- providers: [{ provide: RouterStateSerializer, useClass: DefaultRouterStateSerializer }]
1074
- };
1075
- };
1076
- NgxsRouterPluginModule.decorators = [
1077
- { type: core.NgModule, args: [{
1078
- imports: [store.NgxsModule.forFeature([RouterState])]
1079
- },] }
1080
- ];
1081
- return NgxsRouterPluginModule;
954
+ /**
955
+ * @fileoverview added by tsickle
956
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
957
+ */
958
+ var NgxsRouterPluginModule = /** @class */ (function () {
959
+ function NgxsRouterPluginModule() {
960
+ }
961
+ /**
962
+ * @return {?}
963
+ */
964
+ NgxsRouterPluginModule.forRoot = /**
965
+ * @return {?}
966
+ */
967
+ function () {
968
+ return {
969
+ ngModule: NgxsRouterPluginModule,
970
+ providers: [{ provide: RouterStateSerializer, useClass: DefaultRouterStateSerializer }]
971
+ };
972
+ };
973
+ NgxsRouterPluginModule.decorators = [
974
+ { type: core.NgModule, args: [{
975
+ imports: [store.NgxsModule.forFeature([RouterState])]
976
+ },] }
977
+ ];
978
+ return NgxsRouterPluginModule;
1082
979
  }());
1083
980
 
1084
981
  exports.DefaultRouterStateSerializer = DefaultRouterStateSerializer;