@ngxs/router-plugin 3.7.3 → 3.7.4-dev.master-327646e

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.
@@ -4,851 +4,880 @@ import { __assign, __decorate, __metadata } from 'tslib';
4
4
  import { NavigationStart, RoutesRecognized, ResolveEnd, NavigationCancel, NavigationError, NavigationEnd, Router, UrlSerializer } from '@angular/router';
5
5
  import { LocationStrategy, Location } from '@angular/common';
6
6
  import { isAngularInTestMode } from '@ngxs/store/internals';
7
+ import { Subscription } from 'rxjs';
7
8
  import { first } from 'rxjs/operators';
8
9
 
9
- /**
10
- * @fileoverview added by tsickle
11
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
12
- */
13
- /**
14
- * Public event api of the router
15
- */
16
- var /**
17
- * Public event api of the router
18
- */
19
- Navigate = /** @class */ (function () {
20
- function Navigate(path, queryParams, extras) {
21
- this.path = path;
22
- this.queryParams = queryParams;
23
- this.extras = extras;
24
- }
25
- Object.defineProperty(Navigate, "type", {
26
- get: /**
27
- * @return {?}
28
- */
29
- function () {
30
- // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
31
- return '[Router] Navigate';
32
- },
33
- enumerable: true,
34
- configurable: true
35
- });
36
- return Navigate;
37
- }());
38
- if (false) {
39
- /** @type {?} */
40
- Navigate.prototype.path;
41
- /** @type {?} */
42
- Navigate.prototype.queryParams;
43
- /** @type {?} */
44
- Navigate.prototype.extras;
45
- }
46
- /**
47
- *
48
- * Angular Routers internal state events
49
- *
50
- */
51
- /**
52
- * An action dispatched when the router navigates.
53
- * @template T
54
- */
55
- var /**
56
- *
57
- * Angular Routers internal state events
58
- *
59
- */
60
- /**
61
- * An action dispatched when the router navigates.
62
- * @template T
63
- */
64
- RouterNavigation = /** @class */ (function () {
65
- function RouterNavigation(routerState, event, trigger) {
66
- if (trigger === void 0) { trigger = 'none'; }
67
- this.routerState = routerState;
68
- this.event = event;
69
- this.trigger = trigger;
70
- }
71
- Object.defineProperty(RouterNavigation, "type", {
72
- get: /**
73
- * @return {?}
74
- */
75
- function () {
76
- // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
77
- return '[Router] RouterNavigation';
78
- },
79
- enumerable: true,
80
- configurable: true
81
- });
82
- return RouterNavigation;
83
- }());
84
- if (false) {
85
- /** @type {?} */
86
- RouterNavigation.prototype.routerState;
87
- /** @type {?} */
88
- RouterNavigation.prototype.event;
89
- /** @type {?} */
90
- RouterNavigation.prototype.trigger;
91
- }
92
- /**
93
- * An action dispatched when the router cancel navigation.
94
- * @template T, V
95
- */
96
- var /**
97
- * An action dispatched when the router cancel navigation.
98
- * @template T, V
99
- */
100
- RouterCancel = /** @class */ (function () {
101
- function RouterCancel(routerState, storeState, event, trigger) {
102
- if (trigger === void 0) { trigger = 'none'; }
103
- this.routerState = routerState;
104
- this.storeState = storeState;
105
- this.event = event;
106
- this.trigger = trigger;
107
- }
108
- Object.defineProperty(RouterCancel, "type", {
109
- get: /**
110
- * @return {?}
111
- */
112
- function () {
113
- // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
114
- return '[Router] RouterCancel';
115
- },
116
- enumerable: true,
117
- configurable: true
118
- });
119
- return RouterCancel;
120
- }());
121
- if (false) {
122
- /** @type {?} */
123
- RouterCancel.prototype.routerState;
124
- /** @type {?} */
125
- RouterCancel.prototype.storeState;
126
- /** @type {?} */
127
- RouterCancel.prototype.event;
128
- /** @type {?} */
129
- RouterCancel.prototype.trigger;
130
- }
131
- /**
132
- * An action dispatched when the router errors.
133
- * @template T, V
134
- */
135
- var /**
136
- * An action dispatched when the router errors.
137
- * @template T, V
138
- */
139
- RouterError = /** @class */ (function () {
140
- function RouterError(routerState, storeState, event, trigger) {
141
- if (trigger === void 0) { trigger = 'none'; }
142
- this.routerState = routerState;
143
- this.storeState = storeState;
144
- this.event = event;
145
- this.trigger = trigger;
146
- }
147
- Object.defineProperty(RouterError, "type", {
148
- get: /**
149
- * @return {?}
150
- */
151
- function () {
152
- // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
153
- return '[Router] RouterError';
154
- },
155
- enumerable: true,
156
- configurable: true
157
- });
158
- return RouterError;
159
- }());
160
- if (false) {
161
- /** @type {?} */
162
- RouterError.prototype.routerState;
163
- /** @type {?} */
164
- RouterError.prototype.storeState;
165
- /** @type {?} */
166
- RouterError.prototype.event;
167
- /** @type {?} */
168
- RouterError.prototype.trigger;
169
- }
170
- /**
171
- * An action dispatched when the `ResolveEnd` event is triggered.
172
- * @template T
173
- */
174
- var /**
175
- * An action dispatched when the `ResolveEnd` event is triggered.
176
- * @template T
177
- */
178
- RouterDataResolved = /** @class */ (function () {
179
- function RouterDataResolved(routerState, event, trigger) {
180
- if (trigger === void 0) { trigger = 'none'; }
181
- this.routerState = routerState;
182
- this.event = event;
183
- this.trigger = trigger;
184
- }
185
- Object.defineProperty(RouterDataResolved, "type", {
186
- get: /**
187
- * @return {?}
188
- */
189
- function () {
190
- // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
191
- return '[Router] RouterDataResolved';
192
- },
193
- enumerable: true,
194
- configurable: true
195
- });
196
- return RouterDataResolved;
197
- }());
198
- if (false) {
199
- /** @type {?} */
200
- RouterDataResolved.prototype.routerState;
201
- /** @type {?} */
202
- RouterDataResolved.prototype.event;
203
- /** @type {?} */
204
- RouterDataResolved.prototype.trigger;
10
+ /**
11
+ * @fileoverview added by tsickle
12
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
13
+ */
14
+ /**
15
+ * Public event api of the router
16
+ */
17
+ var /**
18
+ * Public event api of the router
19
+ */
20
+ Navigate = /** @class */ (function () {
21
+ function Navigate(path, queryParams, extras) {
22
+ this.path = path;
23
+ this.queryParams = queryParams;
24
+ this.extras = extras;
25
+ }
26
+ Object.defineProperty(Navigate, "type", {
27
+ get: /**
28
+ * @return {?}
29
+ */
30
+ function () {
31
+ // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
32
+ return '[Router] Navigate';
33
+ },
34
+ enumerable: true,
35
+ configurable: true
36
+ });
37
+ return Navigate;
38
+ }());
39
+ if (false) {
40
+ /** @type {?} */
41
+ Navigate.prototype.path;
42
+ /** @type {?} */
43
+ Navigate.prototype.queryParams;
44
+ /** @type {?} */
45
+ Navigate.prototype.extras;
46
+ }
47
+ /**
48
+ *
49
+ * Angular Routers internal state events
50
+ *
51
+ */
52
+ /**
53
+ * An action dispatched when the router navigates.
54
+ * @template T
55
+ */
56
+ var /**
57
+ *
58
+ * Angular Routers internal state events
59
+ *
60
+ */
61
+ /**
62
+ * An action dispatched when the router navigates.
63
+ * @template T
64
+ */
65
+ RouterNavigation = /** @class */ (function () {
66
+ function RouterNavigation(routerState, event, trigger) {
67
+ if (trigger === void 0) { trigger = 'none'; }
68
+ this.routerState = routerState;
69
+ this.event = event;
70
+ this.trigger = trigger;
71
+ }
72
+ Object.defineProperty(RouterNavigation, "type", {
73
+ get: /**
74
+ * @return {?}
75
+ */
76
+ function () {
77
+ // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
78
+ return '[Router] RouterNavigation';
79
+ },
80
+ enumerable: true,
81
+ configurable: true
82
+ });
83
+ return RouterNavigation;
84
+ }());
85
+ if (false) {
86
+ /** @type {?} */
87
+ RouterNavigation.prototype.routerState;
88
+ /** @type {?} */
89
+ RouterNavigation.prototype.event;
90
+ /** @type {?} */
91
+ RouterNavigation.prototype.trigger;
92
+ }
93
+ /**
94
+ * An action dispatched when the router cancel navigation.
95
+ * @template T, V
96
+ */
97
+ var /**
98
+ * An action dispatched when the router cancel navigation.
99
+ * @template T, V
100
+ */
101
+ RouterCancel = /** @class */ (function () {
102
+ function RouterCancel(routerState, storeState, event, trigger) {
103
+ if (trigger === void 0) { trigger = 'none'; }
104
+ this.routerState = routerState;
105
+ this.storeState = storeState;
106
+ this.event = event;
107
+ this.trigger = trigger;
108
+ }
109
+ Object.defineProperty(RouterCancel, "type", {
110
+ get: /**
111
+ * @return {?}
112
+ */
113
+ function () {
114
+ // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
115
+ return '[Router] RouterCancel';
116
+ },
117
+ enumerable: true,
118
+ configurable: true
119
+ });
120
+ return RouterCancel;
121
+ }());
122
+ if (false) {
123
+ /** @type {?} */
124
+ RouterCancel.prototype.routerState;
125
+ /** @type {?} */
126
+ RouterCancel.prototype.storeState;
127
+ /** @type {?} */
128
+ RouterCancel.prototype.event;
129
+ /** @type {?} */
130
+ RouterCancel.prototype.trigger;
131
+ }
132
+ /**
133
+ * An action dispatched when the router errors.
134
+ * @template T, V
135
+ */
136
+ var /**
137
+ * An action dispatched when the router errors.
138
+ * @template T, V
139
+ */
140
+ RouterError = /** @class */ (function () {
141
+ function RouterError(routerState, storeState, event, trigger) {
142
+ if (trigger === void 0) { trigger = 'none'; }
143
+ this.routerState = routerState;
144
+ this.storeState = storeState;
145
+ this.event = event;
146
+ this.trigger = trigger;
147
+ }
148
+ Object.defineProperty(RouterError, "type", {
149
+ get: /**
150
+ * @return {?}
151
+ */
152
+ function () {
153
+ // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
154
+ return '[Router] RouterError';
155
+ },
156
+ enumerable: true,
157
+ configurable: true
158
+ });
159
+ return RouterError;
160
+ }());
161
+ if (false) {
162
+ /** @type {?} */
163
+ RouterError.prototype.routerState;
164
+ /** @type {?} */
165
+ RouterError.prototype.storeState;
166
+ /** @type {?} */
167
+ RouterError.prototype.event;
168
+ /** @type {?} */
169
+ RouterError.prototype.trigger;
170
+ }
171
+ /**
172
+ * An action dispatched when the `ResolveEnd` event is triggered.
173
+ * @template T
174
+ */
175
+ var /**
176
+ * An action dispatched when the `ResolveEnd` event is triggered.
177
+ * @template T
178
+ */
179
+ RouterDataResolved = /** @class */ (function () {
180
+ function RouterDataResolved(routerState, event, trigger) {
181
+ if (trigger === void 0) { trigger = 'none'; }
182
+ this.routerState = routerState;
183
+ this.event = event;
184
+ this.trigger = trigger;
185
+ }
186
+ Object.defineProperty(RouterDataResolved, "type", {
187
+ get: /**
188
+ * @return {?}
189
+ */
190
+ function () {
191
+ // NOTE: Not necessary to declare the type in this way in your code. See https://github.com/ngxs/store/pull/644#issuecomment-436003138
192
+ return '[Router] RouterDataResolved';
193
+ },
194
+ enumerable: true,
195
+ configurable: true
196
+ });
197
+ return RouterDataResolved;
198
+ }());
199
+ if (false) {
200
+ /** @type {?} */
201
+ RouterDataResolved.prototype.routerState;
202
+ /** @type {?} */
203
+ RouterDataResolved.prototype.event;
204
+ /** @type {?} */
205
+ RouterDataResolved.prototype.trigger;
205
206
  }
206
207
 
207
- /**
208
- * @fileoverview added by tsickle
209
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
210
- */
211
- /**
212
- * @abstract
213
- * @template T
214
- */
215
- var /**
216
- * @abstract
217
- * @template T
218
- */
219
- RouterStateSerializer = /** @class */ (function () {
220
- function RouterStateSerializer() {
221
- }
222
- return RouterStateSerializer;
223
- }());
224
- if (false) {
225
- /**
226
- * @abstract
227
- * @param {?} routerState
228
- * @return {?}
229
- */
230
- RouterStateSerializer.prototype.serialize = function (routerState) { };
231
- }
232
- /**
233
- * @record
234
- */
235
- function SerializedRouterStateSnapshot() { }
236
- if (false) {
237
- /** @type {?} */
238
- SerializedRouterStateSnapshot.prototype.root;
239
- /** @type {?} */
240
- SerializedRouterStateSnapshot.prototype.url;
241
- }
242
- var DefaultRouterStateSerializer = /** @class */ (function () {
243
- function DefaultRouterStateSerializer() {
244
- }
245
- /**
246
- * @param {?} routerState
247
- * @return {?}
248
- */
249
- DefaultRouterStateSerializer.prototype.serialize = /**
250
- * @param {?} routerState
251
- * @return {?}
252
- */
253
- function (routerState) {
254
- return {
255
- root: this.serializeRoute(routerState.root),
256
- url: routerState.url
257
- };
258
- };
259
- /**
260
- * @private
261
- * @param {?} route
262
- * @return {?}
263
- */
264
- DefaultRouterStateSerializer.prototype.serializeRoute = /**
265
- * @private
266
- * @param {?} route
267
- * @return {?}
268
- */
269
- function (route) {
270
- var _this = this;
271
- /** @type {?} */
272
- var children = route.children.map((/**
273
- * @param {?} c
274
- * @return {?}
275
- */
276
- function (c) { return _this.serializeRoute(c); }));
277
- return {
278
- url: route.url,
279
- params: route.params,
280
- queryParams: route.queryParams,
281
- fragment: route.fragment,
282
- data: route.data,
283
- outlet: route.outlet,
284
- component: null,
285
- routeConfig: null,
286
- root: (/** @type {?} */ (null)),
287
- parent: null,
288
- firstChild: children[0],
289
- children: children,
290
- pathFromRoot: (/** @type {?} */ (null)),
291
- paramMap: route.paramMap,
292
- queryParamMap: route.queryParamMap,
293
- toString: route.toString
294
- };
295
- };
296
- return DefaultRouterStateSerializer;
208
+ /**
209
+ * @fileoverview added by tsickle
210
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
211
+ */
212
+ /**
213
+ * @abstract
214
+ * @template T
215
+ */
216
+ var /**
217
+ * @abstract
218
+ * @template T
219
+ */
220
+ RouterStateSerializer = /** @class */ (function () {
221
+ function RouterStateSerializer() {
222
+ }
223
+ return RouterStateSerializer;
224
+ }());
225
+ if (false) {
226
+ /**
227
+ * @abstract
228
+ * @param {?} routerState
229
+ * @return {?}
230
+ */
231
+ RouterStateSerializer.prototype.serialize = function (routerState) { };
232
+ }
233
+ /**
234
+ * @record
235
+ */
236
+ function SerializedRouterStateSnapshot() { }
237
+ if (false) {
238
+ /** @type {?} */
239
+ SerializedRouterStateSnapshot.prototype.root;
240
+ /** @type {?} */
241
+ SerializedRouterStateSnapshot.prototype.url;
242
+ }
243
+ var DefaultRouterStateSerializer = /** @class */ (function () {
244
+ function DefaultRouterStateSerializer() {
245
+ }
246
+ /**
247
+ * @param {?} routerState
248
+ * @return {?}
249
+ */
250
+ DefaultRouterStateSerializer.prototype.serialize = /**
251
+ * @param {?} routerState
252
+ * @return {?}
253
+ */
254
+ function (routerState) {
255
+ return {
256
+ root: this.serializeRoute(routerState.root),
257
+ url: routerState.url
258
+ };
259
+ };
260
+ /**
261
+ * @private
262
+ * @param {?} route
263
+ * @return {?}
264
+ */
265
+ DefaultRouterStateSerializer.prototype.serializeRoute = /**
266
+ * @private
267
+ * @param {?} route
268
+ * @return {?}
269
+ */
270
+ function (route) {
271
+ var _this = this;
272
+ /** @type {?} */
273
+ var children = route.children.map((/**
274
+ * @param {?} c
275
+ * @return {?}
276
+ */
277
+ function (c) { return _this.serializeRoute(c); }));
278
+ return {
279
+ url: route.url,
280
+ params: route.params,
281
+ queryParams: route.queryParams,
282
+ fragment: route.fragment,
283
+ data: route.data,
284
+ outlet: route.outlet,
285
+ component: null,
286
+ routeConfig: null,
287
+ root: (/** @type {?} */ (null)),
288
+ parent: null,
289
+ firstChild: children[0],
290
+ children: children,
291
+ pathFromRoot: (/** @type {?} */ (null)),
292
+ paramMap: route.paramMap,
293
+ queryParamMap: route.queryParamMap,
294
+ toString: route.toString
295
+ };
296
+ };
297
+ return DefaultRouterStateSerializer;
297
298
  }());
298
299
 
299
- /**
300
- * @fileoverview added by tsickle
301
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
302
- */
303
- /**
304
- * @record
305
- * @template T
306
- */
307
- function RouterStateModel() { }
308
- if (false) {
309
- /** @type {?|undefined} */
310
- RouterStateModel.prototype.state;
311
- /** @type {?|undefined} */
312
- RouterStateModel.prototype.navigationId;
313
- /** @type {?} */
314
- RouterStateModel.prototype.trigger;
315
- }
316
- var RouterState = /** @class */ (function () {
317
- function RouterState(_store, _router, _serializer, _ngZone, _urlSerializer, _locationStrategy, _location) {
318
- this._store = _store;
319
- this._router = _router;
320
- this._serializer = _serializer;
321
- this._ngZone = _ngZone;
322
- this._urlSerializer = _urlSerializer;
323
- this._locationStrategy = _locationStrategy;
324
- this._location = _location;
325
- /**
326
- * Determines how navigation was performed by the `RouterState` itself
327
- * or outside via `new Navigate(...)`
328
- */
329
- this._trigger = 'none';
330
- /**
331
- * That's the serialized state from the `Router` class
332
- */
333
- this._routerState = null;
334
- /**
335
- * That's the value of the `RouterState` state
336
- */
337
- this._storeState = null;
338
- this._lastRoutesRecognized = (/** @type {?} */ (null));
339
- this.setUpStoreListener();
340
- this.setUpRouterEventsListener();
341
- this.checkInitialNavigationOnce();
342
- }
343
- RouterState_1 = RouterState;
344
- /**
345
- * @template T
346
- * @param {?} state
347
- * @return {?}
348
- */
349
- RouterState.state = /**
350
- * @template T
351
- * @param {?} state
352
- * @return {?}
353
- */
354
- function (state) {
355
- return state && state.state;
356
- };
357
- /**
358
- * @param {?} state
359
- * @return {?}
360
- */
361
- RouterState.url = /**
362
- * @param {?} state
363
- * @return {?}
364
- */
365
- function (state) {
366
- return state && state.state && state.state.url;
367
- };
368
- /**
369
- * @param {?} _
370
- * @param {?} action
371
- * @return {?}
372
- */
373
- RouterState.prototype.navigate = /**
374
- * @param {?} _
375
- * @param {?} action
376
- * @return {?}
377
- */
378
- function (_, action) {
379
- var _this = this;
380
- return this._ngZone.run((/**
381
- * @return {?}
382
- */
383
- function () {
384
- return _this._router.navigate(action.path, __assign({ queryParams: action.queryParams }, action.extras));
385
- }));
386
- };
387
- /**
388
- * @param {?} ctx
389
- * @param {?} action
390
- * @return {?}
391
- */
392
- RouterState.prototype.angularRouterAction = /**
393
- * @param {?} ctx
394
- * @param {?} action
395
- * @return {?}
396
- */
397
- function (ctx, action) {
398
- ctx.setState(__assign({}, ctx.getState(), { trigger: action.trigger, state: action.routerState, navigationId: action.event.id }));
399
- };
400
- /**
401
- * @private
402
- * @return {?}
403
- */
404
- RouterState.prototype.setUpStoreListener = /**
405
- * @private
406
- * @return {?}
407
- */
408
- function () {
409
- var _this = this;
410
- this._store.select(RouterState_1).subscribe((/**
411
- * @param {?} state
412
- * @return {?}
413
- */
414
- function (state) {
415
- _this.navigateIfNeeded(state);
416
- }));
417
- };
418
- /**
419
- * @private
420
- * @return {?}
421
- */
422
- RouterState.prototype.setUpRouterEventsListener = /**
423
- * @private
424
- * @return {?}
425
- */
426
- function () {
427
- var _this = this;
428
- this._router.events.subscribe((/**
429
- * @param {?} event
430
- * @return {?}
431
- */
432
- function (event) {
433
- if (event instanceof NavigationStart) {
434
- _this.navigationStart();
435
- }
436
- else if (event instanceof RoutesRecognized) {
437
- _this._lastRoutesRecognized = event;
438
- }
439
- else if (event instanceof ResolveEnd) {
440
- _this.dispatchRouterDataResolved(event);
441
- }
442
- else if (event instanceof NavigationCancel) {
443
- _this.dispatchRouterCancel(event);
444
- _this.reset();
445
- }
446
- else if (event instanceof NavigationError) {
447
- _this.dispatchRouterError(event);
448
- _this.reset();
449
- }
450
- else if (event instanceof NavigationEnd) {
451
- _this.navigationEnd();
452
- _this.reset();
453
- }
454
- }));
455
- };
456
- /**
457
- * @private
458
- * @return {?}
459
- */
460
- RouterState.prototype.navigationStart = /**
461
- * @private
462
- * @return {?}
463
- */
464
- function () {
465
- this._routerState = this._serializer.serialize(this._router.routerState.snapshot);
466
- if (this._trigger !== 'none') {
467
- this._storeState = this._store.selectSnapshot(RouterState_1);
468
- }
469
- };
470
- /**
471
- * @private
472
- * @return {?}
473
- */
474
- RouterState.prototype.navigationEnd = /**
475
- * @private
476
- * @return {?}
477
- */
478
- function () {
479
- if (this.shouldDispatchRouterNavigation()) {
480
- this.dispatchRouterNavigation();
481
- }
482
- };
483
- /**
484
- * @private
485
- * @return {?}
486
- */
487
- RouterState.prototype.shouldDispatchRouterNavigation = /**
488
- * @private
489
- * @return {?}
490
- */
491
- function () {
492
- if (!this._storeState)
493
- return true;
494
- return this._trigger !== 'store';
495
- };
496
- /**
497
- * @private
498
- * @param {?} state
499
- * @return {?}
500
- */
501
- RouterState.prototype.navigateIfNeeded = /**
502
- * @private
503
- * @param {?} state
504
- * @return {?}
505
- */
506
- function (state) {
507
- var _this = this;
508
- /** @type {?} */
509
- var canSkipNavigation = !this._storeState ||
510
- !this._storeState.state ||
511
- !state ||
512
- state.trigger === 'router' ||
513
- this._router.url === this._storeState.state.url;
514
- if (canSkipNavigation) {
515
- return;
516
- }
517
- this._trigger = 'store';
518
- this._ngZone.run((/**
519
- * @return {?}
520
- */
521
- function () {
522
- _this._router.navigateByUrl((/** @type {?} */ ((/** @type {?} */ (_this._storeState)).state)).url);
523
- }));
524
- };
525
- /**
526
- * @private
527
- * @return {?}
528
- */
529
- RouterState.prototype.dispatchRouterNavigation = /**
530
- * @private
531
- * @return {?}
532
- */
533
- function () {
534
- /** @type {?} */
535
- var nextRouterState = this._serializer.serialize(this._lastRoutesRecognized.state);
536
- this.dispatchRouterAction(new RouterNavigation(nextRouterState, new RoutesRecognized(this._lastRoutesRecognized.id, this._lastRoutesRecognized.url, this._lastRoutesRecognized.urlAfterRedirects, nextRouterState), this._trigger));
537
- };
538
- /**
539
- * @private
540
- * @param {?} event
541
- * @return {?}
542
- */
543
- RouterState.prototype.dispatchRouterCancel = /**
544
- * @private
545
- * @param {?} event
546
- * @return {?}
547
- */
548
- function (event) {
549
- this.dispatchRouterAction(new RouterCancel((/** @type {?} */ (this._routerState)), this._storeState, event, this._trigger));
550
- };
551
- /**
552
- * @private
553
- * @param {?} event
554
- * @return {?}
555
- */
556
- RouterState.prototype.dispatchRouterError = /**
557
- * @private
558
- * @param {?} event
559
- * @return {?}
560
- */
561
- function (event) {
562
- this.dispatchRouterAction(new RouterError((/** @type {?} */ (this._routerState)), this._storeState, new NavigationError(event.id, event.url, "" + event), this._trigger));
563
- };
564
- /**
565
- * @private
566
- * @template T
567
- * @param {?} action
568
- * @return {?}
569
- */
570
- RouterState.prototype.dispatchRouterAction = /**
571
- * @private
572
- * @template T
573
- * @param {?} action
574
- * @return {?}
575
- */
576
- function (action) {
577
- this._trigger = 'router';
578
- try {
579
- this._store.dispatch(action);
580
- }
581
- finally {
582
- this._trigger = 'none';
583
- }
584
- };
585
- /**
586
- * @private
587
- * @param {?} event
588
- * @return {?}
589
- */
590
- RouterState.prototype.dispatchRouterDataResolved = /**
591
- * @private
592
- * @param {?} event
593
- * @return {?}
594
- */
595
- function (event) {
596
- /** @type {?} */
597
- var routerState = this._serializer.serialize(event.state);
598
- this.dispatchRouterAction(new RouterDataResolved(routerState, event, this._trigger));
599
- };
600
- /**
601
- * @private
602
- * @return {?}
603
- */
604
- RouterState.prototype.reset = /**
605
- * @private
606
- * @return {?}
607
- */
608
- function () {
609
- this._trigger = 'none';
610
- this._storeState = null;
611
- this._routerState = null;
612
- };
613
- /**
614
- * No sense to mess up the `setUpRouterEventsListener` method as we have
615
- * to perform this check only once and unsubscribe after the first event
616
- * is triggered
617
- */
618
- /**
619
- * No sense to mess up the `setUpRouterEventsListener` method as we have
620
- * to perform this check only once and unsubscribe after the first event
621
- * is triggered
622
- * @private
623
- * @return {?}
624
- */
625
- RouterState.prototype.checkInitialNavigationOnce = /**
626
- * No sense to mess up the `setUpRouterEventsListener` method as we have
627
- * to perform this check only once and unsubscribe after the first event
628
- * is triggered
629
- * @private
630
- * @return {?}
631
- */
632
- function () {
633
- var _this = this;
634
- if (isAngularInTestMode()) {
635
- return;
636
- }
637
- this._router.events
638
- .pipe(first((/**
639
- * @param {?} event
640
- * @return {?}
641
- */
642
- function (event) { return event instanceof RoutesRecognized; })))
643
- .subscribe((/**
644
- * @param {?} __0
645
- * @return {?}
646
- */
647
- function (_a) {
648
- // `location.pathname` always equals manually entered URL in the address bar
649
- // e.g. `location.pathname === '/foo'`, but the `router` state has been initialized
650
- // with another URL (e.g. used in combination with `NgxsStoragePlugin`), thus the
651
- // `RouterNavigation` action will be dispatched and the user will be redirected to the
652
- // previously saved URL. We want to prevent such behavior, so we perform this check
653
- var url = _a.url;
654
- // `location.pathname` always equals manually entered URL in the address bar
655
- // e.g. `location.pathname === '/foo'`, but the `router` state has been initialized
656
- // with another URL (e.g. used in combination with `NgxsStoragePlugin`), thus the
657
- // `RouterNavigation` action will be dispatched and the user will be redirected to the
658
- // previously saved URL. We want to prevent such behavior, so we perform this check
659
- // `url` is a recognized URL by the Angular's router, while `currentUrl` is an actual URL
660
- // entered in the browser's address bar
661
- // `PathLocationStrategy.prototype.path()` returns a concatenation of
662
- // `PlatformLocation.pathname` and normalized `PlatformLocation.search`.
663
- // `Location.prototype.normalize` strips base href from the URL,
664
- // if `baseHref` (declared in angular.json) for example is `/en`
665
- // and the URL is `/test#anchor` - then `_locationStrategy.path(true)` will return `/en/test#anchor`,
666
- // but `/en/test#anchor` is not known to the Angular's router, so we have to strip `/en`
667
- // from the URL
668
- /** @type {?} */
669
- var currentUrl = _this._location.normalize(_this._locationStrategy.path(true));
670
- /** @type {?} */
671
- var currentUrlTree = _this._urlSerializer.parse(currentUrl);
672
- // We need to serialize the URL because in that example `/test/?redirect=https://google.com/`
673
- // Angular will recognize it as `/test?redirect=https:%2F%2Fwww.google.com%2F`
674
- // so we have to run the `currentUrl` via the `UrlSerializer` that will encode characters
675
- /** @type {?} */
676
- var currentSerializedUrl = _this._urlSerializer.serialize(currentUrlTree);
677
- // If URLs differ from each other - we've got to perform a redirect to the manually entered URL
678
- // in the address bar, as it must have a priority
679
- if (currentSerializedUrl !== url) {
680
- _this._router.navigateByUrl(currentUrl);
681
- }
682
- }));
683
- };
684
- var RouterState_1;
685
- RouterState.ctorParameters = function () { return [
686
- { type: Store },
687
- { type: Router },
688
- { type: RouterStateSerializer },
689
- { type: NgZone },
690
- { type: UrlSerializer },
691
- { type: LocationStrategy },
692
- { type: Location }
693
- ]; };
694
- RouterState.decorators = [
695
- { type: Injectable }
696
- ];
697
- /** @nocollapse */
698
- RouterState.ctorParameters = function () { return [
699
- { type: Store },
700
- { type: Router },
701
- { type: RouterStateSerializer },
702
- { type: NgZone },
703
- { type: UrlSerializer },
704
- { type: LocationStrategy },
705
- { type: Location }
706
- ]; };
707
- __decorate([
708
- Action(Navigate),
709
- __metadata("design:type", Function),
710
- __metadata("design:paramtypes", [Object, Navigate]),
711
- __metadata("design:returntype", void 0)
712
- ], RouterState.prototype, "navigate", null);
713
- __decorate([
714
- Action([RouterNavigation, RouterError, RouterCancel, RouterDataResolved]),
715
- __metadata("design:type", Function),
716
- __metadata("design:paramtypes", [Object, Object]),
717
- __metadata("design:returntype", void 0)
718
- ], RouterState.prototype, "angularRouterAction", null);
719
- __decorate([
720
- Selector(),
721
- __metadata("design:type", Function),
722
- __metadata("design:paramtypes", [Object]),
723
- __metadata("design:returntype", void 0)
724
- ], RouterState, "state", null);
725
- __decorate([
726
- Selector(),
727
- __metadata("design:type", Function),
728
- __metadata("design:paramtypes", [Object]),
729
- __metadata("design:returntype", Object)
730
- ], RouterState, "url", null);
731
- RouterState = RouterState_1 = __decorate([
732
- State({
733
- name: 'router',
734
- defaults: {
735
- state: undefined,
736
- navigationId: undefined,
737
- trigger: 'none'
738
- }
739
- }),
740
- __metadata("design:paramtypes", [Store,
741
- Router,
742
- RouterStateSerializer,
743
- NgZone,
744
- UrlSerializer,
745
- LocationStrategy,
746
- Location])
747
- ], RouterState);
748
- return RouterState;
749
- }());
750
- if (false) {
751
- /**
752
- * Determines how navigation was performed by the `RouterState` itself
753
- * or outside via `new Navigate(...)`
754
- * @type {?}
755
- * @private
756
- */
757
- RouterState.prototype._trigger;
758
- /**
759
- * That's the serialized state from the `Router` class
760
- * @type {?}
761
- * @private
762
- */
763
- RouterState.prototype._routerState;
764
- /**
765
- * That's the value of the `RouterState` state
766
- * @type {?}
767
- * @private
768
- */
769
- RouterState.prototype._storeState;
770
- /**
771
- * @type {?}
772
- * @private
773
- */
774
- RouterState.prototype._lastRoutesRecognized;
775
- /**
776
- * @type {?}
777
- * @private
778
- */
779
- RouterState.prototype._store;
780
- /**
781
- * @type {?}
782
- * @private
783
- */
784
- RouterState.prototype._router;
785
- /**
786
- * @type {?}
787
- * @private
788
- */
789
- RouterState.prototype._serializer;
790
- /**
791
- * @type {?}
792
- * @private
793
- */
794
- RouterState.prototype._ngZone;
795
- /**
796
- * @type {?}
797
- * @private
798
- */
799
- RouterState.prototype._urlSerializer;
800
- /**
801
- * @type {?}
802
- * @private
803
- */
804
- RouterState.prototype._locationStrategy;
805
- /**
806
- * @type {?}
807
- * @private
808
- */
809
- RouterState.prototype._location;
300
+ /**
301
+ * @fileoverview added by tsickle
302
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
303
+ */
304
+ /**
305
+ * @record
306
+ * @template T
307
+ */
308
+ function RouterStateModel() { }
309
+ if (false) {
310
+ /** @type {?|undefined} */
311
+ RouterStateModel.prototype.state;
312
+ /** @type {?|undefined} */
313
+ RouterStateModel.prototype.navigationId;
314
+ /** @type {?} */
315
+ RouterStateModel.prototype.trigger;
316
+ }
317
+ var RouterState = /** @class */ (function () {
318
+ function RouterState(_store, _router, _serializer, _ngZone, _urlSerializer, _locationStrategy, _location) {
319
+ this._store = _store;
320
+ this._router = _router;
321
+ this._serializer = _serializer;
322
+ this._ngZone = _ngZone;
323
+ this._urlSerializer = _urlSerializer;
324
+ this._locationStrategy = _locationStrategy;
325
+ this._location = _location;
326
+ /**
327
+ * Determines how navigation was performed by the `RouterState` itself
328
+ * or outside via `new Navigate(...)`
329
+ */
330
+ this._trigger = 'none';
331
+ /**
332
+ * That's the serialized state from the `Router` class
333
+ */
334
+ this._routerState = null;
335
+ /**
336
+ * That's the value of the `RouterState` state
337
+ */
338
+ this._storeState = null;
339
+ this._lastRoutesRecognized = (/** @type {?} */ (null));
340
+ this._subscription = new Subscription();
341
+ this.setUpStoreListener();
342
+ this.setUpRouterEventsListener();
343
+ this.checkInitialNavigationOnce();
344
+ }
345
+ RouterState_1 = RouterState;
346
+ /**
347
+ * @template T
348
+ * @param {?} state
349
+ * @return {?}
350
+ */
351
+ RouterState.state = /**
352
+ * @template T
353
+ * @param {?} state
354
+ * @return {?}
355
+ */
356
+ function (state) {
357
+ return state && state.state;
358
+ };
359
+ /**
360
+ * @param {?} state
361
+ * @return {?}
362
+ */
363
+ RouterState.url = /**
364
+ * @param {?} state
365
+ * @return {?}
366
+ */
367
+ function (state) {
368
+ return state && state.state && state.state.url;
369
+ };
370
+ /**
371
+ * @return {?}
372
+ */
373
+ RouterState.prototype.ngOnDestroy = /**
374
+ * @return {?}
375
+ */
376
+ function () {
377
+ this._subscription.unsubscribe();
378
+ };
379
+ /**
380
+ * @param {?} _
381
+ * @param {?} action
382
+ * @return {?}
383
+ */
384
+ RouterState.prototype.navigate = /**
385
+ * @param {?} _
386
+ * @param {?} action
387
+ * @return {?}
388
+ */
389
+ function (_, action) {
390
+ var _this = this;
391
+ return this._ngZone.run((/**
392
+ * @return {?}
393
+ */
394
+ function () {
395
+ return _this._router.navigate(action.path, __assign({ queryParams: action.queryParams }, action.extras));
396
+ }));
397
+ };
398
+ /**
399
+ * @param {?} ctx
400
+ * @param {?} action
401
+ * @return {?}
402
+ */
403
+ RouterState.prototype.angularRouterAction = /**
404
+ * @param {?} ctx
405
+ * @param {?} action
406
+ * @return {?}
407
+ */
408
+ function (ctx, action) {
409
+ ctx.setState(__assign({}, ctx.getState(), { trigger: action.trigger, state: action.routerState, navigationId: action.event.id }));
410
+ };
411
+ /**
412
+ * @private
413
+ * @return {?}
414
+ */
415
+ RouterState.prototype.setUpStoreListener = /**
416
+ * @private
417
+ * @return {?}
418
+ */
419
+ function () {
420
+ var _this = this;
421
+ /** @type {?} */
422
+ var subscription = this._store
423
+ .select(RouterState_1)
424
+ .subscribe((/**
425
+ * @param {?} state
426
+ * @return {?}
427
+ */
428
+ function (state) {
429
+ _this.navigateIfNeeded(state);
430
+ }));
431
+ this._subscription.add(subscription);
432
+ };
433
+ /**
434
+ * @private
435
+ * @return {?}
436
+ */
437
+ RouterState.prototype.setUpRouterEventsListener = /**
438
+ * @private
439
+ * @return {?}
440
+ */
441
+ function () {
442
+ var _this = this;
443
+ /** @type {?} */
444
+ var subscription = this._router.events.subscribe((/**
445
+ * @param {?} event
446
+ * @return {?}
447
+ */
448
+ function (event) {
449
+ if (event instanceof NavigationStart) {
450
+ _this.navigationStart();
451
+ }
452
+ else if (event instanceof RoutesRecognized) {
453
+ _this._lastRoutesRecognized = event;
454
+ }
455
+ else if (event instanceof ResolveEnd) {
456
+ _this.dispatchRouterDataResolved(event);
457
+ }
458
+ else if (event instanceof NavigationCancel) {
459
+ _this.dispatchRouterCancel(event);
460
+ _this.reset();
461
+ }
462
+ else if (event instanceof NavigationError) {
463
+ _this.dispatchRouterError(event);
464
+ _this.reset();
465
+ }
466
+ else if (event instanceof NavigationEnd) {
467
+ _this.navigationEnd();
468
+ _this.reset();
469
+ }
470
+ }));
471
+ this._subscription.add(subscription);
472
+ };
473
+ /**
474
+ * @private
475
+ * @return {?}
476
+ */
477
+ RouterState.prototype.navigationStart = /**
478
+ * @private
479
+ * @return {?}
480
+ */
481
+ function () {
482
+ this._routerState = this._serializer.serialize(this._router.routerState.snapshot);
483
+ if (this._trigger !== 'none') {
484
+ this._storeState = this._store.selectSnapshot(RouterState_1);
485
+ }
486
+ };
487
+ /**
488
+ * @private
489
+ * @return {?}
490
+ */
491
+ RouterState.prototype.navigationEnd = /**
492
+ * @private
493
+ * @return {?}
494
+ */
495
+ function () {
496
+ if (this.shouldDispatchRouterNavigation()) {
497
+ this.dispatchRouterNavigation();
498
+ }
499
+ };
500
+ /**
501
+ * @private
502
+ * @return {?}
503
+ */
504
+ RouterState.prototype.shouldDispatchRouterNavigation = /**
505
+ * @private
506
+ * @return {?}
507
+ */
508
+ function () {
509
+ if (!this._storeState)
510
+ return true;
511
+ return this._trigger !== 'store';
512
+ };
513
+ /**
514
+ * @private
515
+ * @param {?} state
516
+ * @return {?}
517
+ */
518
+ RouterState.prototype.navigateIfNeeded = /**
519
+ * @private
520
+ * @param {?} state
521
+ * @return {?}
522
+ */
523
+ function (state) {
524
+ var _this = this;
525
+ /** @type {?} */
526
+ var canSkipNavigation = !this._storeState ||
527
+ !this._storeState.state ||
528
+ !state ||
529
+ state.trigger === 'router' ||
530
+ this._router.url === this._storeState.state.url;
531
+ if (canSkipNavigation) {
532
+ return;
533
+ }
534
+ this._trigger = 'store';
535
+ this._ngZone.run((/**
536
+ * @return {?}
537
+ */
538
+ function () {
539
+ _this._router.navigateByUrl((/** @type {?} */ ((/** @type {?} */ (_this._storeState)).state)).url);
540
+ }));
541
+ };
542
+ /**
543
+ * @private
544
+ * @return {?}
545
+ */
546
+ RouterState.prototype.dispatchRouterNavigation = /**
547
+ * @private
548
+ * @return {?}
549
+ */
550
+ function () {
551
+ /** @type {?} */
552
+ var nextRouterState = this._serializer.serialize(this._lastRoutesRecognized.state);
553
+ this.dispatchRouterAction(new RouterNavigation(nextRouterState, new RoutesRecognized(this._lastRoutesRecognized.id, this._lastRoutesRecognized.url, this._lastRoutesRecognized.urlAfterRedirects, nextRouterState), this._trigger));
554
+ };
555
+ /**
556
+ * @private
557
+ * @param {?} event
558
+ * @return {?}
559
+ */
560
+ RouterState.prototype.dispatchRouterCancel = /**
561
+ * @private
562
+ * @param {?} event
563
+ * @return {?}
564
+ */
565
+ function (event) {
566
+ this.dispatchRouterAction(new RouterCancel((/** @type {?} */ (this._routerState)), this._storeState, event, this._trigger));
567
+ };
568
+ /**
569
+ * @private
570
+ * @param {?} event
571
+ * @return {?}
572
+ */
573
+ RouterState.prototype.dispatchRouterError = /**
574
+ * @private
575
+ * @param {?} event
576
+ * @return {?}
577
+ */
578
+ function (event) {
579
+ this.dispatchRouterAction(new RouterError((/** @type {?} */ (this._routerState)), this._storeState, new NavigationError(event.id, event.url, "" + event), this._trigger));
580
+ };
581
+ /**
582
+ * @private
583
+ * @template T
584
+ * @param {?} action
585
+ * @return {?}
586
+ */
587
+ RouterState.prototype.dispatchRouterAction = /**
588
+ * @private
589
+ * @template T
590
+ * @param {?} action
591
+ * @return {?}
592
+ */
593
+ function (action) {
594
+ this._trigger = 'router';
595
+ try {
596
+ this._store.dispatch(action);
597
+ }
598
+ finally {
599
+ this._trigger = 'none';
600
+ }
601
+ };
602
+ /**
603
+ * @private
604
+ * @param {?} event
605
+ * @return {?}
606
+ */
607
+ RouterState.prototype.dispatchRouterDataResolved = /**
608
+ * @private
609
+ * @param {?} event
610
+ * @return {?}
611
+ */
612
+ function (event) {
613
+ /** @type {?} */
614
+ var routerState = this._serializer.serialize(event.state);
615
+ this.dispatchRouterAction(new RouterDataResolved(routerState, event, this._trigger));
616
+ };
617
+ /**
618
+ * @private
619
+ * @return {?}
620
+ */
621
+ RouterState.prototype.reset = /**
622
+ * @private
623
+ * @return {?}
624
+ */
625
+ function () {
626
+ this._trigger = 'none';
627
+ this._storeState = null;
628
+ this._routerState = null;
629
+ };
630
+ /**
631
+ * No sense to mess up the `setUpRouterEventsListener` method as we have
632
+ * to perform this check only once and unsubscribe after the first event
633
+ * is triggered
634
+ */
635
+ /**
636
+ * No sense to mess up the `setUpRouterEventsListener` method as we have
637
+ * to perform this check only once and unsubscribe after the first event
638
+ * is triggered
639
+ * @private
640
+ * @return {?}
641
+ */
642
+ RouterState.prototype.checkInitialNavigationOnce = /**
643
+ * No sense to mess up the `setUpRouterEventsListener` method as we have
644
+ * to perform this check only once and unsubscribe after the first event
645
+ * is triggered
646
+ * @private
647
+ * @return {?}
648
+ */
649
+ function () {
650
+ var _this = this;
651
+ // Caretaker note: we have still left the `typeof` condition in order to avoid
652
+ // creating a breaking change for projects that still use the View Engine.
653
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
654
+ // Angular is running tests in development mode thus we can be sure that this method will be
655
+ // skipped in tests.
656
+ isAngularInTestMode()) {
657
+ return;
658
+ }
659
+ /** @type {?} */
660
+ var subscription = this._router.events
661
+ .pipe(first((/**
662
+ * @param {?} event
663
+ * @return {?}
664
+ */
665
+ function (event) { return event instanceof RoutesRecognized; })))
666
+ .subscribe((/**
667
+ * @param {?} __0
668
+ * @return {?}
669
+ */
670
+ function (_a) {
671
+ // `location.pathname` always equals manually entered URL in the address bar
672
+ // e.g. `location.pathname === '/foo'`, but the `router` state has been initialized
673
+ // with another URL (e.g. used in combination with `NgxsStoragePlugin`), thus the
674
+ // `RouterNavigation` action will be dispatched and the user will be redirected to the
675
+ // previously saved URL. We want to prevent such behavior, so we perform this check
676
+ var url = _a.url;
677
+ // `location.pathname` always equals manually entered URL in the address bar
678
+ // e.g. `location.pathname === '/foo'`, but the `router` state has been initialized
679
+ // with another URL (e.g. used in combination with `NgxsStoragePlugin`), thus the
680
+ // `RouterNavigation` action will be dispatched and the user will be redirected to the
681
+ // previously saved URL. We want to prevent such behavior, so we perform this check
682
+ // `url` is a recognized URL by the Angular's router, while `currentUrl` is an actual URL
683
+ // entered in the browser's address bar
684
+ // `PathLocationStrategy.prototype.path()` returns a concatenation of
685
+ // `PlatformLocation.pathname` and normalized `PlatformLocation.search`.
686
+ // `Location.prototype.normalize` strips base href from the URL,
687
+ // if `baseHref` (declared in angular.json) for example is `/en`
688
+ // and the URL is `/test#anchor` - then `_locationStrategy.path(true)` will return `/en/test#anchor`,
689
+ // but `/en/test#anchor` is not known to the Angular's router, so we have to strip `/en`
690
+ // from the URL
691
+ /** @type {?} */
692
+ var currentUrl = _this._location.normalize(_this._locationStrategy.path(true));
693
+ /** @type {?} */
694
+ var currentUrlTree = _this._urlSerializer.parse(currentUrl);
695
+ // We need to serialize the URL because in that example `/test/?redirect=https://google.com/`
696
+ // Angular will recognize it as `/test?redirect=https:%2F%2Fwww.google.com%2F`
697
+ // so we have to run the `currentUrl` via the `UrlSerializer` that will encode characters
698
+ /** @type {?} */
699
+ var currentSerializedUrl = _this._urlSerializer.serialize(currentUrlTree);
700
+ // If URLs differ from each other - we've got to perform a redirect to the manually entered URL
701
+ // in the address bar, as it must have a priority
702
+ if (currentSerializedUrl !== url) {
703
+ _this._router.navigateByUrl(currentUrl);
704
+ }
705
+ }));
706
+ this._subscription.add(subscription);
707
+ };
708
+ var RouterState_1;
709
+ RouterState.ctorParameters = function () { return [
710
+ { type: Store },
711
+ { type: Router },
712
+ { type: RouterStateSerializer },
713
+ { type: NgZone },
714
+ { type: UrlSerializer },
715
+ { type: LocationStrategy },
716
+ { type: Location }
717
+ ]; };
718
+ RouterState.decorators = [
719
+ { type: Injectable }
720
+ ];
721
+ /** @nocollapse */
722
+ RouterState.ctorParameters = function () { return [
723
+ { type: Store },
724
+ { type: Router },
725
+ { type: RouterStateSerializer },
726
+ { type: NgZone },
727
+ { type: UrlSerializer },
728
+ { type: LocationStrategy },
729
+ { type: Location }
730
+ ]; };
731
+ __decorate([
732
+ Action(Navigate),
733
+ __metadata("design:type", Function),
734
+ __metadata("design:paramtypes", [Object, Navigate]),
735
+ __metadata("design:returntype", void 0)
736
+ ], RouterState.prototype, "navigate", null);
737
+ __decorate([
738
+ Action([RouterNavigation, RouterError, RouterCancel, RouterDataResolved]),
739
+ __metadata("design:type", Function),
740
+ __metadata("design:paramtypes", [Object, Object]),
741
+ __metadata("design:returntype", void 0)
742
+ ], RouterState.prototype, "angularRouterAction", null);
743
+ __decorate([
744
+ Selector(),
745
+ __metadata("design:type", Function),
746
+ __metadata("design:paramtypes", [Object]),
747
+ __metadata("design:returntype", void 0)
748
+ ], RouterState, "state", null);
749
+ __decorate([
750
+ Selector(),
751
+ __metadata("design:type", Function),
752
+ __metadata("design:paramtypes", [Object]),
753
+ __metadata("design:returntype", Object)
754
+ ], RouterState, "url", null);
755
+ RouterState = RouterState_1 = __decorate([
756
+ State({
757
+ name: 'router',
758
+ defaults: {
759
+ state: undefined,
760
+ navigationId: undefined,
761
+ trigger: 'none'
762
+ }
763
+ }),
764
+ __metadata("design:paramtypes", [Store,
765
+ Router,
766
+ RouterStateSerializer,
767
+ NgZone,
768
+ UrlSerializer,
769
+ LocationStrategy,
770
+ Location])
771
+ ], RouterState);
772
+ return RouterState;
773
+ }());
774
+ if (false) {
775
+ /**
776
+ * Determines how navigation was performed by the `RouterState` itself
777
+ * or outside via `new Navigate(...)`
778
+ * @type {?}
779
+ * @private
780
+ */
781
+ RouterState.prototype._trigger;
782
+ /**
783
+ * That's the serialized state from the `Router` class
784
+ * @type {?}
785
+ * @private
786
+ */
787
+ RouterState.prototype._routerState;
788
+ /**
789
+ * That's the value of the `RouterState` state
790
+ * @type {?}
791
+ * @private
792
+ */
793
+ RouterState.prototype._storeState;
794
+ /**
795
+ * @type {?}
796
+ * @private
797
+ */
798
+ RouterState.prototype._lastRoutesRecognized;
799
+ /**
800
+ * @type {?}
801
+ * @private
802
+ */
803
+ RouterState.prototype._subscription;
804
+ /**
805
+ * @type {?}
806
+ * @private
807
+ */
808
+ RouterState.prototype._store;
809
+ /**
810
+ * @type {?}
811
+ * @private
812
+ */
813
+ RouterState.prototype._router;
814
+ /**
815
+ * @type {?}
816
+ * @private
817
+ */
818
+ RouterState.prototype._serializer;
819
+ /**
820
+ * @type {?}
821
+ * @private
822
+ */
823
+ RouterState.prototype._ngZone;
824
+ /**
825
+ * @type {?}
826
+ * @private
827
+ */
828
+ RouterState.prototype._urlSerializer;
829
+ /**
830
+ * @type {?}
831
+ * @private
832
+ */
833
+ RouterState.prototype._locationStrategy;
834
+ /**
835
+ * @type {?}
836
+ * @private
837
+ */
838
+ RouterState.prototype._location;
810
839
  }
811
840
 
812
- /**
813
- * @fileoverview added by tsickle
814
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
815
- */
816
- var NgxsRouterPluginModule = /** @class */ (function () {
817
- function NgxsRouterPluginModule() {
818
- }
819
- /**
820
- * @return {?}
821
- */
822
- NgxsRouterPluginModule.forRoot = /**
823
- * @return {?}
824
- */
825
- function () {
826
- return {
827
- ngModule: NgxsRouterPluginModule,
828
- providers: [{ provide: RouterStateSerializer, useClass: DefaultRouterStateSerializer }]
829
- };
830
- };
831
- NgxsRouterPluginModule.decorators = [
832
- { type: NgModule, args: [{
833
- imports: [NgxsModule.forFeature([RouterState])]
834
- },] }
835
- ];
836
- return NgxsRouterPluginModule;
841
+ /**
842
+ * @fileoverview added by tsickle
843
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
844
+ */
845
+ var NgxsRouterPluginModule = /** @class */ (function () {
846
+ function NgxsRouterPluginModule() {
847
+ }
848
+ /**
849
+ * @return {?}
850
+ */
851
+ NgxsRouterPluginModule.forRoot = /**
852
+ * @return {?}
853
+ */
854
+ function () {
855
+ return {
856
+ ngModule: NgxsRouterPluginModule,
857
+ providers: [{ provide: RouterStateSerializer, useClass: DefaultRouterStateSerializer }]
858
+ };
859
+ };
860
+ NgxsRouterPluginModule.decorators = [
861
+ { type: NgModule, args: [{
862
+ imports: [NgxsModule.forFeature([RouterState])]
863
+ },] }
864
+ ];
865
+ return NgxsRouterPluginModule;
837
866
  }());
838
867
 
839
- /**
840
- * @fileoverview added by tsickle
841
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
868
+ /**
869
+ * @fileoverview added by tsickle
870
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
842
871
  */
843
872
 
844
- /**
845
- * @fileoverview added by tsickle
846
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
873
+ /**
874
+ * @fileoverview added by tsickle
875
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
847
876
  */
848
877
 
849
- /**
850
- * @fileoverview added by tsickle
851
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
878
+ /**
879
+ * @fileoverview added by tsickle
880
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
852
881
  */
853
882
 
854
883
  export { DefaultRouterStateSerializer, Navigate, NgxsRouterPluginModule, RouterCancel, RouterDataResolved, RouterError, RouterNavigation, RouterState, RouterStateSerializer };