@ngxs/router-plugin 3.7.3-dev.master-10b0883 → 3.7.4

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.
@@ -7,877 +7,877 @@ import { isAngularInTestMode } from '@ngxs/store/internals';
7
7
  import { Subscription } from 'rxjs';
8
8
  import { first } from 'rxjs/operators';
9
9
 
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;
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;
206
206
  }
207
207
 
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;
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;
298
298
  }());
299
299
 
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;
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;
839
839
  }
840
840
 
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;
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;
866
866
  }());
867
867
 
868
- /**
869
- * @fileoverview added by tsickle
870
- * @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
871
871
  */
872
872
 
873
- /**
874
- * @fileoverview added by tsickle
875
- * @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
876
876
  */
877
877
 
878
- /**
879
- * @fileoverview added by tsickle
880
- * @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
881
881
  */
882
882
 
883
883
  export { DefaultRouterStateSerializer, Navigate, NgxsRouterPluginModule, RouterCancel, RouterDataResolved, RouterError, RouterNavigation, RouterState, RouterStateSerializer };